Add podLabels and podAnnotations to Values struct (#5056)

PR https://github.com/linkerd/linkerd2/pull/5027 added `podLabels` and `podAnnotations` to `values.yaml` to allow setting labels and annotations on pods in the Helm template.  However, these fields were not added to the `Values` struct in `Values.go`.  This means that these fields were not serialized out to the `linkerd-config` or to the `linkerd-config-overrides`.  Furthermore, in PR #5005 which moves to using the `Values` struct more authoritatively, the `podLabels` and `podAnnotations` fields would not take effect at all.

Add these fields to the `Values` struct and update all test fixtures accordingly.

Signed-off-by: Alex Leong <alex@buoyant.io>
This commit is contained in:
Alex Leong 2020-10-09 09:27:28 -07:00 committed by GitHub
parent 5f694513bd
commit 530d8beccc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 75 additions and 0 deletions

View File

@ -91,6 +91,8 @@ func TestRender(t *testing.T) {
CNIEnabled: false,
IdentityTrustDomain: defaultValues.Global.IdentityTrustDomain,
IdentityTrustAnchorsPEM: defaultValues.Global.IdentityTrustAnchorsPEM,
PodAnnotations: map[string]string{},
PodLabels: map[string]string{},
Proxy: &charts.Proxy{
DestinationGetNetworks: "DestinationGetNetworks",
Image: &charts.Image{

View File

@ -65,6 +65,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: dev-undefined
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null

View File

@ -65,6 +65,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: dev-undefined
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null

View File

@ -853,6 +853,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: dev-undefined
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null

View File

@ -853,6 +853,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: dev-undefined
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null

View File

@ -853,6 +853,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: dev-undefined
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null

View File

@ -853,6 +853,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: dev-undefined
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null

View File

@ -850,6 +850,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: dev-undefined
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null

View File

@ -859,6 +859,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: dev-undefined
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null

View File

@ -859,6 +859,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: dev-undefined
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null

View File

@ -809,6 +809,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: dev-undefined
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null

View File

@ -929,6 +929,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: linkerd-version
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null
@ -1014,6 +1016,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: linkerd-version
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null
@ -1100,6 +1104,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: linkerd-version
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null
@ -1211,6 +1217,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: linkerd-version
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null
@ -1300,6 +1308,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: linkerd-version
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null

View File

@ -929,6 +929,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: linkerd-version
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null
@ -1014,6 +1016,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: linkerd-version
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null
@ -1100,6 +1104,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: linkerd-version
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null
@ -1211,6 +1217,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: linkerd-version
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null
@ -1300,6 +1308,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: linkerd-version
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null
@ -1406,6 +1416,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: linkerd-version
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null
@ -1492,6 +1504,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: linkerd-version
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null

View File

@ -935,6 +935,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: linkerd-version
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null
@ -1019,6 +1021,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: linkerd-version
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null
@ -1104,6 +1108,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: linkerd-version
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null
@ -1233,6 +1239,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: linkerd-version
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null
@ -1321,6 +1329,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: linkerd-version
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null

View File

@ -850,6 +850,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: dev-undefined
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null

View File

@ -853,6 +853,8 @@ data:
linkerdNamespaceLabel: LinkerdNamespaceLabel
linkerdVersion: ""
namespace: Namespace
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null

View File

@ -853,6 +853,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: dev-undefined
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null

View File

@ -853,6 +853,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: dev-undefined
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null

View File

@ -785,6 +785,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: dev-undefined
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null

View File

@ -853,6 +853,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: dev-undefined
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null

View File

@ -853,6 +853,8 @@ data:
linkerdNamespaceLabel: linkerd.io/is-control-plane
linkerdVersion: dev-undefined
namespace: linkerd
podAnnotations: {}
podLabels: {}
prometheusUrl: ""
proxy:
capabilities: null

View File

@ -94,6 +94,9 @@ type (
ImagePullSecrets []map[string]string `json:"imagePullSecrets"`
LinkerdVersion string `json:"linkerdVersion"`
PodAnnotations map[string]string `json:"podAnnotations"`
PodLabels map[string]string `json:"podLabels"`
Proxy *Proxy `json:"proxy"`
ProxyInit *ProxyInit `json:"proxyInit"`
}

View File

@ -52,6 +52,8 @@ func TestNewValues(t *testing.T) {
ControlPlaneTracing: false,
HighAvailability: false,
IdentityTrustDomain: "cluster.local",
PodAnnotations: map[string]string{},
PodLabels: map[string]string{},
Proxy: &Proxy{
EnableExternalProfiles: false,
Image: &Image{