We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have a state file that worked fine until I added a gs:// repository. Now when I run apply, I get a segfault;
gs://
2024-07-04 14:48:01 INFO: Setting up helm 2024-07-04 14:48:01 INFO: Listing helm repositories 2024-07-04 14:48:01 INFO: Checking Helm version 2024-07-04 14:48:01 INFO: Validating that [ gcs ] is installed 2024-07-04 14:48:02 INFO: Cleaning up sensitive and temp files panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0xacfeec] goroutine 1 [running]: github.com/Praqma/helmsman/internal/gcs.IsRunningInGCP() github.com/Praqma/helmsman/internal/gcs/gcs.go:21 +0x2c github.com/Praqma/helmsman/internal/gcs.Auth() github.com/Praqma/helmsman/internal/gcs/gcs.go:47 +0x128 github.com/Praqma/helmsman/internal/app.addHelmRepos(0xc0007265d0) github.com/Praqma/helmsman/internal/app/helm_helpers.go:211 +0x76a github.com/Praqma/helmsman/internal/app.Main() github.com/Praqma/helmsman/internal/app/main.go:76 +0x2f6 main.main() github.com/Praqma/helmsman/cmd/helmsman/main.go:9 +0x19
This points to this function - and specifically the resp.Body.Close() line;
resp.Body.Close()
func IsRunningInGCP() bool { resp, err := http.Get("http://metadata.google.internal") resp.Body.Close() return err == nil }
My suspicion is that the resp.Body is actually nil, since the URL cannot be resolved. From the go http docs;
resp.Body
nil
When err is nil, resp always contains a non-nil resp.Body. Caller should close resp.Body when done reading from it.
From that I read that if err is not nil, the resp.Body may be nil.
err
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
I have a state file that worked fine until I added a
gs://
repository. Now when I run apply, I get a segfault;This points to this function - and specifically the
resp.Body.Close()
line;My suspicion is that the
resp.Body
is actuallynil
, since the URL cannot be resolved. From the go http docs;From that I read that if
err
is notnil
, theresp.Body
may benil
.The text was updated successfully, but these errors were encountered: