mumoshu / terraform-provider-helmfile

Deploy Helmfile releases from Terraform
126 stars 20 forks source link

apply_output and diff_output of a previous run are shown when there are no changes in the current one #26

Closed andrewnazarov closed 4 years ago

andrewnazarov commented 4 years ago

When the are no changes in manifests apply_output and diff_output that are shown to the user contain information from the previous successful run. This could be misleading.

Terraform apply says No changes. Infrastructure is up-to-date., but then diff_output shows something like:

...
core, core-instance-frontend, Deployment (apps) has changed:
 ...
         labels:
           app.kubernetes.io/name: frontend
           app.kubernetes.io/instance: core-instance-frontend
 -         app.kubernetes.io/version: 17213-57d9c33d
 +         app.kubernetes.io/version: 17114-8524e206
       spec:
         containers:
           - name: frontend
 -           image: "eu.gcr.io/my-project/frontend:17213-57d9c33d"
 +           image: "eu.gcr.io/my-project/frontend:17114-8524e206"
             imagePullPolicy: Always
             envFrom:
             - configMapRef:
 ...
 Comparing release=core-instance-saml, chart=chartmuseum/saml
 Comparing release=monitoring-addon-core-instance, chart=chartmuseum/monitoring-addon
 Listing releases matching ^core-instance-stash-backup$
 Affected releases are:
   **core-instance-frontend (chartmuseum/frontend) UPDATED**
 **Identified at least one change**

Same for apply_output.

mumoshu commented 4 years ago

@andrewnazarov v0.3.15 should fix this. It is intended to work by instructing you to run an extra terraform apply to "reset" apply_output/diff_output, by showing plan to empty apply_output, even when there was no helmfile diff detected.

Probably it isn't very intuitive but to me it seems practical.