mirror of https://github.com/linkerd/linkerd2.git
Populate empty proxy-version annotation (#9382)
Addresses: #9311 * Set injected `proxy-version` annotation to `values.LinkerdVersion` when image version is empty. * Set `Proxy.Image.Version` consistently between CLI and Helm Tested when installed via CLI: ``` $ k get po -o yaml -n emojivoto | grep proxy-version linkerd.io/proxy-version: dev-0911ad92-jchase linkerd.io/proxy-version: dev-0911ad92-jchase linkerd.io/proxy-version: dev-0911ad92-jchase linkerd.io/proxy-version: dev-0911ad92-jchase ``` Untested when installed via Helm. Signed-off-by: Jeremy Chase <jeremy.chase@gmail.com> Co-authored-by: Kevin Leimkuhler <kleimkuhler@icloud.com>
This commit is contained in:
parent
5cb6755ebe
commit
32b4ac4f3a
|
@ -266,7 +266,6 @@ func NewValues() (*Values, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
v.Proxy.Image.Version = version.Version
|
||||
v.DebugContainer.Image.Version = version.Version
|
||||
v.CliVersion = k8s.CreatedByAnnotationValue()
|
||||
v.ProfileValidator.TLS = &TLS{}
|
||||
|
|
|
@ -103,7 +103,7 @@ func TestNewValues(t *testing.T) {
|
|||
EnableExternalProfiles: false,
|
||||
Image: &Image{
|
||||
Name: "cr.l5d.io/linkerd/proxy",
|
||||
Version: "dev-undefined",
|
||||
Version: "",
|
||||
},
|
||||
LogLevel: "warn,linkerd=info",
|
||||
LogFormat: "plain",
|
||||
|
|
|
@ -795,7 +795,12 @@ func (conf *ResourceConfig) serviceAccountVolumeMount() *corev1.VolumeMount {
|
|||
// annotations.
|
||||
func (conf *ResourceConfig) injectObjectMeta(values *podPatch) {
|
||||
|
||||
values.Annotations[k8s.ProxyVersionAnnotation] = values.Proxy.Image.Version
|
||||
// Default proxy version to linkerd version
|
||||
if values.Proxy.Image.Version != "" {
|
||||
values.Annotations[k8s.ProxyVersionAnnotation] = values.Proxy.Image.Version
|
||||
} else {
|
||||
values.Annotations[k8s.ProxyVersionAnnotation] = values.LinkerdVersion
|
||||
}
|
||||
|
||||
// Add the cert bundle's checksum to the workload's annotations.
|
||||
checksumBytes := sha256.Sum256([]byte(values.IdentityTrustAnchorsPEM))
|
||||
|
|
|
@ -625,7 +625,8 @@ func TestOverridesSecret(t *testing.T) {
|
|||
}
|
||||
knownKeys["proxy"] = tree.Tree{
|
||||
"image": tree.Tree{
|
||||
"name": reg + "/proxy",
|
||||
"name": reg + "/proxy",
|
||||
"version": TestHelper.GetVersion(),
|
||||
},
|
||||
}
|
||||
knownKeys["proxyInit"].(tree.Tree)["image"] = tree.Tree{
|
||||
|
|
Loading…
Reference in New Issue