Set Kubernetes user-agent to include version #411
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 thevault-k8s
version, and it is often just0.0.0
. See https://github.com/kubernetes/client-go/blob/master/pkg/version/base.goInstead, 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 variableGODEBUG=http2debug=1
set.