awslabs / mountpoint-s3-csi-driver

Built on Mountpoint for Amazon S3, the Mountpoint CSI driver presents an Amazon S3 bucket as a storage volume accessible by containers in your Kubernetes cluster.
Apache License 2.0
193 stars 23 forks source link

Add Kubernetes version to user-agent #224

Closed unexge closed 2 months ago

unexge commented 2 months ago

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 to ExecStart since v207 (released on Sep 13, 2013, the original support for transient units - the way we start systemd services - added on v205 which released on Jul 3, 2013). I tried quoting arguments before passing to systemd but that causes double escaping on quotes and causes --user-agent-prefix="\"s3-csi-driver/... k8s/...\"" to be passed to mount-s3.

Given that even very old systemds 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.