Skip to content

preapply hook behavior #399

Description

@gakesson

Operating system

Ubuntu 20.04.4 LTS

Helmfile Version

0.146.0

Helm Version

v3.9.0

Bug description

Greetings folks,

I picked up the new helmfile version to start to use the preapply hook, but I'm a little bit puzzled by its behavior.
From what I think we agreed upon in the PR is that preapply will be invoked for every release even if sync is not invoked (=even when no change).
Also coming back to #79 (comment) :

preapply hooks will trigger everytime a release is applied, indifferent if there is changes to the release or not.

But if I try the helmfile I attached in this issue, preapply sort of behaves exactly as presync, i.e. if I do helmfile apply two consecutive times then preapply is only invoked the first time. Second time it is not because it is no change to the release.

@mumoshu @yxxhero @Sajfer WDYT?

Example helmfile.yaml

repositories:
- name: incubator
  url: https://charts.helm.sh/incubator
---
releases:
- name: service-a
  chart: incubator/raw
  values:
  - resources:
    - apiVersion: v1
      kind: ConfigMap
      metadata:
        name: raw1
        namespace: default
      data:
        foo: FOO
  hooks:
    - events: ["preapply"]
      showlogs: true
      command: "echo"
      args: ["Hello from preapply"]

Error message you've seen (if any)

No error message

Steps to reproduce

N/A

Working Helmfile Version

N/A

Relevant discussion

#79

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions