Skip to content
New issue

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

Set Kubernetes user-agent to include version #411

Merged
merged 2 commits into from
Jan 4, 2023
Merged

Conversation

swenson
Copy link

@swenson swenson commented Dec 23, 2022

We weren't setting the user-agent, so Kubernetes sets a default of the command-line (vault-k8s, which is okay) and an automatically set version in the Kubernetes code base. This is probably not what we want, since it implies that the Kubernetes version is the vault-k8s version, and it is often just 0.0.0. See https://github.com/kubernetes/client-go/blob/master/pkg/version/base.go

Instead, we set the user-agent based on our own version.

I didn't see an easy way to test this in a unit test, but I did test it manually by running vault-k8s with the environment variable GODEBUG=http2debug=1 set.

We weren't setting the user-agent, so Kubernetes sets a default
of the command-line (`vault-k8s`, which is okay) and an automatically
set version in the Kubernetes code base. This is probably not what
we want, since it implies that the Kubernetes version is the
`vault-k8s` version, and it is often just `0.0.0`.
See https://github.com/kubernetes/client-go/blob/master/pkg/version/base.go

Instead, we set the user-agent based on our own version.

I didn't see an easy way to test this in a unit test, but I did
test it manually by running `vault-k8s` with the environment
variable `GODEBUG=http2debug=1` set.
@tvoran
Copy link
Member

tvoran commented Jan 3, 2023

Probably should update the changelog here too.

@swenson
Copy link
Author

swenson commented Jan 4, 2023

Thanks!

@swenson swenson merged commit 6ec9741 into main Jan 4, 2023
@swenson swenson deleted the vault-9514/user-agent branch January 4, 2023 23:21
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