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

Unable to execute drift because prerequisites failing #17

Closed herrbpl closed 6 months ago

herrbpl commented 6 months ago

When trying to run drift helm --debug -l debug drift run -n test-bo02-ca-02 test-bo02 --from-release -l debug , I get

{"level":"info","msg":"exec: \"go\": executable file not found in $PATH","time":"2024-03-08T08:31:40Z"}
{"level":"info","msg":"helm-drift requires 'kubectl' to identify drifts","time":"2024-03-08T08:31:40Z"}
2024/03/08 08:31:40 cmd.go:22: validation failed, please install prerequisites to identify drifts
Error: plugin "drift" exited with error
helm.go:84: [debug] plugin "drift" exited with error

I have kubectl in path kubectl version

Client Version: v1.28.4
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.28.5-eks-5e0fdde

helm drift version

drift version: {"version":"0.0.8","revision":"407b5c7627dc9403ee4d4f09f16863cdbb5aec06","environment":"production","build-date":"2023-10-29T16:50:21Z","go-version":"go1.21.1","platform":"linux/amd64"} 

Documentation does mention about kubectl being needed but nothing more specific. Not sure if this is bug or documentation issue

herrbpl commented 6 months ago

Perhaps instead of checking for existance of 'go', validation should check for kubectl? https://github.com/nikhilsbhat/helm-drift/blob/main/pkg/validation.go#L11

nikhilsbhat commented 6 months ago

@herrbpl, As you pointed out, it is a bug where it checks for the presence of golang rather than kubectl during validations. I will work on this issue.

nikhilsbhat commented 6 months ago

@herrbpl, this commit should fix the issue. Latest release will have this change hence closing this.