Add Kubernetes version to user-agent #224
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.
This change bumps image size from 33.21mb to 48.05mb due to addition of Kubernetes client, I was worried about it initially but since we'll need Kubernetes client for other features as well, I think it's acceptable to include it. We can take a look on reducing the image size later if we want to.
A note about escaping, with this change we pass multi user-agents separated by space to
mount-s3
.systemd
quotes all entries passed toExecStart
since v207 (released on Sep 13, 2013, the original support for transient units - the way we startsystemd
services - added on v205 which released on Jul 3, 2013). I tried quoting arguments before passing tosystemd
but that causes double escaping on quotes and causes--user-agent-prefix="\"s3-csi-driver/... k8s/...\""
to be passed tomount-s3
.Given that even very old
systemd
s can handle quoting, I expect this change to be safe. I also tested this change on AL2, AL2023, Ubuntu 20.04 and Ubuntu 22.04, and it works fine on these hosts.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.