Customize User-Agent with k8sec version #153
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.
Sets a custom
User-Agent
header with requests made by k8sec. This allows administrators to track usage of k8sec via apiserver's audit logs.By default, client-go attempts to assemble a user-agent string that contains information about its version/runtime:
https://github.com/kubernetes/client-go/blob/782ff783b635df54ddf44d55f3bd3e48eb4dcb9a/rest/config.go#L498-L506
If you'd like to keep this, there's an option to append your own user agent info to these defaults. However, since a given version of k8sec will be built with a specific version of client-go, it seems like just including the main tool version is the right move.