Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/shield/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ maintainers:
- name: mavimo
email: marcovito.moscaritolo@sysdig.com
type: application
version: 1.55.0
version: 1.55.1
appVersion: "1.0.0"
2 changes: 1 addition & 1 deletion charts/shield/templates/cluster/_labels.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Common labels
*/}}
{{- define "cluster.labels" -}}
{{- $labels := merge (dict) .Values.cluster.labels (include "cluster.self_labels" . | fromYaml) (include "shield.labels" . | fromYaml) }}
{{- $labels := merge (dict) (include "cluster.self_labels" . | fromYaml) .Values.cluster.labels (include "shield.labels" . | fromYaml) }}
{{- with $labels -}}
{{- . | toYaml -}}
{{- end -}}
Expand Down
2 changes: 1 addition & 1 deletion charts/shield/templates/host/_labels.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ GKE Autopilot labels
Common labels
*/}}
{{- define "host.labels" -}}
{{- $labels := merge (dict) .Values.host.labels (include "host.gke_autopilot_labels" . | fromYaml) (include "host.self_labels" . | fromYaml) (include "shield.labels" . | fromYaml) }}
{{- $labels := merge (dict) (include "host.self_labels" . | fromYaml) (include "host.gke_autopilot_labels" . | fromYaml) .Values.host.labels (include "shield.labels" . | fromYaml) }}
{{- with $labels -}}
{{- . | toYaml -}}
{{- end -}}
Expand Down
2 changes: 1 addition & 1 deletion charts/shield/templates/host/_windows_labels.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Common labels
*/}}
{{- define "host.windows.labels" -}}
{{- $labels := merge (dict) .Values.host_windows.labels (include "host.windows.self_labels" . | fromYaml) (include "shield.labels" . | fromYaml) }}
{{- $labels := merge (dict) (include "host.windows.self_labels" . | fromYaml) .Values.host_windows.labels (include "shield.labels" . | fromYaml) }}
{{- with $labels -}}
{{- . | toYaml -}}
{{- end -}}
Expand Down
11 changes: 11 additions & 0 deletions charts/shield/tests/cluster/deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1893,3 +1893,14 @@ tests:
path: metadata.labels["env"]
value: component-workload
template: templates/cluster/deployment.yaml

- it: cluster.labels cannot override the built-in sysdig/component label
set:
cluster:
labels:
sysdig/component: override
asserts:
- equal:
path: metadata.labels["sysdig/component"]
value: cluster
template: templates/cluster/deployment.yaml
10 changes: 10 additions & 0 deletions charts/shield/tests/host/daemonset-windows_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -615,3 +615,13 @@ tests:
- equal:
path: metadata.labels["env"]
value: component-workload

- it: host_windows.labels cannot override the built-in sysdig/component label
set:
host_windows:
labels:
sysdig/component: override
asserts:
- equal:
path: metadata.labels["sysdig/component"]
value: host
26 changes: 26 additions & 0 deletions charts/shield/tests/host/daemonset_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1372,3 +1372,29 @@ tests:
- equal:
path: metadata.labels["env"]
value: component-workload

- it: host.labels cannot override the built-in sysdig/component label
set:
host:
labels:
sysdig/component: override
asserts:
- equal:
path: metadata.labels["sysdig/component"]
value: host

- it: host.labels cannot override the GKE Autopilot labels
values:
- ../values/gke-autopilot.yaml
set:
gke_autopilot_allowlist: sysdig-agent-v2.0.0
host:
labels:
autopilot.gke.io/no-connect: "false"
cloud.google.com/matching-allowlist: override
asserts:
- isSubset:
path: metadata.labels
content:
autopilot.gke.io/no-connect: "true"
cloud.google.com/matching-allowlist: sysdig-agent-v2.0.0
Loading