nikhilsbhat / helm-drift

Helm plugin that identifies the configuration that has drifted from the Helm chart
https://artifacthub.io/packages/helm-plugin/helm-drift/drift
MIT License
62 stars 8 forks source link

max must be greater than 0 #4

Closed cep21 closed 11 months ago

cep21 commented 1 year ago

Just the project I was looking for!

I've tried running it on helm charts in my cluster and for every helm chart I get the error "max must be greater than 0"

< helm drift --log-level debug run datadog --from-release
{"level":"debug","msg":"all manifests rendered to disk was cleaned","time":"2023-05-25T10:46:16-07:00"}
{"level":"debug","msg":"got all required values to identify drifts from chart/release 'datadog' proceeding furter to fetch the same","time":"2023-05-25T10:46:16-07:00"}
{"level":"debug","msg":"from-release is selected, hence fetching manifests for 'datadog' from helm release","time":"2023-05-25T10:46:16-07:00"}
{"level":"debug","msg":"fetching chart manifest for release 'datadog' from kube cluster","time":"2023-05-25T10:46:16-07:00"}
{"level":"debug","msg":"chart manifest for release 'datadog' was successfully retrieved from kube cluster","time":"2023-05-25T10:46:17-07:00"}
{"level":"debug","msg":"splitting helm manifests with regex pattern: '---\\n# Source:\\s.*.'","time":"2023-05-25T10:46:17-07:00"}
{"level":"debug","msg":"rendering helm manifests to disk under /home/jack/.helm-drift/templates/datadog","time":"2023-05-25T10:46:17-07:00"}
{"level":"debug","msg":"creating directories '/home/jack/.helm-drift/templates/datadog' to generate manifests","time":"2023-05-25T10:46:17-07:00"}
2023/05/25 10:46:17 cmd.go:22: max must be greater than 0
Error: plugin "drift" exited with error

Unfortunately, I cannot share the values of the helm chats since they are private. Any idea why this could be the case?

nikhilsbhat commented 1 year ago

Hey @cep21, It's good to know that this plugin was helpful.

May I know which version of the plugin generated these logs and, if possible, a link to the helm chart that is failing? so that I can test things on it. Because the plugin is working for me, I have been using it for a while now.

cep21 commented 1 year ago

Sorry the charts are private and I cannot share much about them. But it is every chart in my company's clusters. I'm using whatever version is installed with helm plugin install https://github.com/nikhilsbhat/helm-drift. I'm unsure where the "max must be greater than 0" comes from with just the logging it currently has.

nikhilsbhat commented 1 year ago

@cep21 , It looks like the error is from a library that is used for progress bars. Pushing a fix for it.

nikhilsbhat commented 1 year ago

@cep21, Do try the newer version of the plugin; the progress bar thing is removed, plugin should not fail for the same error. Do update if you still face the same issue.

cep21 commented 1 year ago

It does not error now, but I seem to get no manifests created and so no diffs.

I ran helm drift run --log-level debug httpbin --from-release --skip-cleaning and see a directory ls -la ~/.helm-drift/templates/httpbin/ but it is empty.

But I can get all from my helm chart and see output.

> helm get all httpbin  | grep -A2 limit
  limits:
    cpu: 40m
    memory: 64Mi
--
          limits:
            cpu: 40m
            memory: 64Mi

The thing I changed was the deployment's limit ( I did this manually)

> kubectl get deployments.apps  httpbin  -o yaml | grep -A2 limit
          limits:
            cpu: 80m
            memory: 64Mi

But helm drift run --log-level debug httpbin --from-release shows no changes.

nikhilsbhat commented 1 year ago

Can you share the debug logs by masking/removing your crucial values. Also can you share the version of helm and kubectl that is being used.

nikhilsbhat commented 11 months ago

Closing this due to no updates on the issue. Hope the issue is resolved now.