Skip to content

credentials: unset env vars on reset instead of setting to "" - #64

Merged
tamalsaha merged 1 commit into
masterfrom
fix/unsetenv
Jun 5, 2026
Merged

tamalsaha merged 1 commit into
masterfrom
fix/unsetenv

Conversation

@tamalsaha

Copy link
Copy Markdown
Contributor

Summary

resetEnvVariables cleared each variable with os.Setenv(name, ""), which leaves the variable defined-but-empty. Any consumer that uses os.LookupEnv (or the equivalent in another language) sees it as present. The intent here is "no value at all" between reconciles for AWS/Google/Cloudflare credential env vars, so use os.Unsetenv.

Test plan

  • go build ./...
  • go vet ./...

Setenv(name, "") leaves the variable defined-but-empty, so any
consumer that uses os.LookupEnv (or the equivalent in another
language) sees it as present. The intent here is "no value at all"
between reconciles, so use Unsetenv.

Signed-off-by: Tamal Saha <tamal@appscode.com>
@tamalsaha
tamalsaha merged commit f38cd3f into master Jun 5, 2026
4 checks passed
@tamalsaha
tamalsaha deleted the fix/unsetenv branch June 5, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants