Kubernetes field annotations have lowest priority
vholer opened this issue · 1 comments
vholer commented
During the search for data in Kubernetes secrets, multiple key name options are evaluated including a custom name taken from the annotation. The annotation is evaluated only as a very last option if common key names are not found. This doesn't give the user option to override the actual key name. E.g.,
sshpiper/plugin/kubernetes/kubernetes.go
Line 161 in 694d09a
IMHO, the annotation should be evaluated first before ssh-privatekey
or privatekey
. Applies also for other Secret attributes:
161: for _, k := range []string{"ssh-privatekey", "privatekey", anno["privatekey_field_name"]} {
170: for _, k := range []string{"ssh-publickey", "publickey", anno["publickey_field_name"]} {
192: for _, k := range []string{"password", anno["password_field_name"]} {
tg123 commented
hmmm yup you're right
lets fix it
i will do it at the weekend
or your PR is welcomed