Skip to content

preapply not working #518

Description

@gakesson

Operating system

Ubuntu 20.04.4 LTS

Helmfile Version

0.148.1

Helm Version

v3.9.0

Bug description

The behavior reported in issue #399 is still present for latest released helmfile version.

Run helmfile apply first time (preapply hook is triggered, which is expected):

$ helmfile apply
Adding repo incubator https://charts.helm.sh/incubator
"incubator" has been added to your repositories

Comparing release=service-a, chart=incubator/raw
********************

	Release was not present in Helm.  Diff will show entire contents as new.

********************
default, raw1, ConfigMap (v1) has been added:
- 
+ # Source: raw/templates/resources.yaml
+ apiVersion: v1
+ data:
+   foo: FOO
+ kind: ConfigMap
+ metadata:
+   labels:
+     app: raw
+     chart: raw-0.2.5
+     heritage: Helm
+     release: service-a
+   name: raw1
+   namespace: default


hook[preapply] logs | Hello from preapply
hook[preapply] logs | 
Upgrading release=service-a, chart=incubator/raw
Release "service-a" does not exist. Installing it now.
NAME: service-a
LAST DEPLOYED: Sun Nov 13 10:14:19 2022
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None

Listing releases matching ^service-a$
service-a	default	1       	2022-11-13 10:14:19.144289815 +0100 CET	deployed	raw-0.2.5	0.2.3      


UPDATED RELEASES:
NAME        CHART           VERSION
service-a   incubator/raw     0.2.5

Run helmfile apply again (no preapply hook triggered :-( ):

$ helmfile apply
Adding repo incubator https://charts.helm.sh/incubator
"incubator" has been added to your repositories

Comparing release=service-a, chart=incubator/raw

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)

N/A

Steps to reproduce

N/A

Working Helmfile Version

N/A

Relevant discussion

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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