travisghansen / argo-cd-helmfile

Integration between argo-cd and helmfile
MIT License
223 stars 55 forks source link

helmfile diff - invalid ownership metadata #22

Closed kfirfer closed 2 years ago

kfirfer commented 2 years ago

Hello

I dont know if its relating to helmfile / the integration But couldnt use helmdiff against the helm charts installed:

When I do : helmfile diff -f <file path> --validate

Im getting this output:

PATH:
  /opt/homebrew/bin/helm

ARGS:
  0: helm (4 bytes)
  1: diff (4 bytes)
  2: upgrade (7 bytes)
  3: --reset-values (14 bytes)
  4: --allow-unreleased (18 bytes)
  5: datadog (7 bytes)
  6: datadog/datadog (15 bytes)
  7: --version (9 bytes)
  8: 2.37.5 (6 bytes)
  9: --namespace (11 bytes)
  10: datadog (7 bytes)
  11: --values (8 bytes)
  12: /var/folders/9c/v5hnv4b107xdxr53sj9mt2s00000gn/T/helmfile3020135561/datadog-datadog-values-6676658555 (101 bytes)
  13: --values (8 bytes)
  14: /var/folders/9c/v5hnv4b107xdxr53sj9mt2s00000gn/T/helmfile2144237898/datadog-datadog-values-654b4745f4 (101 bytes)
  15: --values (8 bytes)
  16: /var/folders/9c/v5hnv4b107xdxr53sj9mt2s00000gn/T/helmfile2436640924/datadog-datadog-values-fbbdcb49d (100 bytes)
  17: --color (7 bytes)

ERROR:
  exit status 1

EXIT STATUS
  1

STDERR:
  Error: Failed to render chart: exit status 1: Error: rendered manifests contain a resource that already exists. Unable to continue with install: PodDisruptionBudget "datadog-cluster-agent" in namespace "datadog" exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "datadog"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "datadog"
  Error: plugin "diff" exited with error

COMBINED OUTPUT:
  ********************
        Release was not present in Helm.  Diff will show entire contents as new.
  ********************
  Error: Failed to render chart: exit status 1: Error: rendered manifests contain a resource that already exists. Unable to continue with install: PodDisruptionBudget "datadog-cluster-agent" in namespace "datadog" exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "datadog"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "datadog"
  Error: plugin "diff" exited with error
travisghansen commented 2 years ago

Yeah trying to run that won’t work as argo won’t install actual helm ‘releases’ to diff against. Argo just submits the templated yaml and doesn’t create the helm release configmaps/secrets.

kfirfer commented 2 years ago

I think its relating to helm diff plugin itself Created issue here: https://github.com/databus23/helm-diff/issues/404

Even with --allow-unreleased I dont get the diff

@travisghansen Thanks

travisghansen commented 2 years ago

Yeah in general if you’re using argo then viewing the diff in argo in the most meaningful approach.

kfirfer commented 2 years ago

But argocd install the helm chart automatically , how could I make the diff in argocd ?

travisghansen commented 2 years ago

If you bump the chart version or change values etc argocd will show you the diff.