diff --git a/pkg/charts/linkerd2/values.go b/pkg/charts/linkerd2/values.go index 1904451b6..fffeed596 100644 --- a/pkg/charts/linkerd2/values.go +++ b/pkg/charts/linkerd2/values.go @@ -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{} diff --git a/pkg/charts/linkerd2/values_test.go b/pkg/charts/linkerd2/values_test.go index ef6b5edf7..4ddcd9a31 100644 --- a/pkg/charts/linkerd2/values_test.go +++ b/pkg/charts/linkerd2/values_test.go @@ -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", diff --git a/pkg/inject/inject.go b/pkg/inject/inject.go index 0e0d1202c..53a58702f 100644 --- a/pkg/inject/inject.go +++ b/pkg/inject/inject.go @@ -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)) diff --git a/test/integration/install/install_test.go b/test/integration/install/install_test.go index cdd5bc98b..b3dad6e4c 100644 --- a/test/integration/install/install_test.go +++ b/test/integration/install/install_test.go @@ -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{