Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CNF-14285: ztp: reference: Change "pod-security.kubernetes.io/" label to be prefix based #2051

Merged
merged 2 commits into from
Sep 30, 2024
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
9 changes: 2 additions & 7 deletions ztp/kube-compare-reference/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ parts:

templateFunctionFiles:
- validate_node_selector.tmpl
- optional_labels.tmpl
- unordered_list.tmpl

fieldsToOmit:
Expand All @@ -184,13 +183,11 @@ fieldsToOmit:
- pathToKey: metadata.annotations."machineconfiguration.openshift.io/mc-name-suffix"
- pathToKey: metadata.labels."kubernetes.io/metadata.name"
- pathToKey: metadata.labels."olm.operatorgroup.uid"
- pathToKey: metadata.labels."pod-security.kubernetes.io"
- pathToKey: metadata.labels."security.openshift.io/scc.podSecurityLabelSync"
- pathToKey: metadata.resourceVersion
- pathToKey: metadata.uid
- pathToKey: spec.finalizers
- pathToKey: metadata.creationTimestamp
- pathToKey: metadata."pod-security.kubernetes.io"
- pathToKey: metadata.generation
- pathToKey: status # TODO: We need to check status in Subscription and CatalogSource. CNF-13521
- pathToKey: metadata.finalizers
Expand All @@ -202,10 +199,8 @@ fieldsToOmit:
- pathToKey: metadata.annotations."include.release.openshift.io/single-node-developer"
- pathToKey: metadata.annotations."release.openshift.io/create-only"
- pathToKey: metadata.labels."lca.openshift.io/target-ocp-version"
- pathToKey: metadata.labels."pod-security.kubernetes.io/audit"
- pathToKey: metadata.labels."pod-security.kubernetes.io/audit-version"
- pathToKey: metadata.labels."pod-security.kubernetes.io/warn"
- pathToKey: metadata.labels."pod-security.kubernetes.io/warn-version"
- pathToKey: metadata.labels."pod-security.kubernetes.io/"
isPrefix: true
Copy link
Member

@lack lack Sep 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a little more we can remove: Look for every other pod-security.kubernetes.io in this section:
(line 187 and line 193 can be deleted too)

- pathToKey: metadata.annotations."capability.openshift.io/name"
- pathToKey: metadata.annotations."olm.providedAPIs"
- pathToKey: metadata.annotations."operator.sriovnetwork.openshift.io/last-network-namespace"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,3 @@ metadata:
name: openshift-local-storage
annotations:
workload.openshift.io/allowed: management
{{- if .metadata.labels }}
labels:
{{- template "allowLabels" (list .metadata.labels
"pod-security.kubernetes.io"
) }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,3 @@ apiVersion: v1
kind: Namespace
metadata:
name: vran-acceleration-operators
{{- if .metadata.labels }}
labels:
{{- template "allowLabels" (list .metadata.labels
"pod-security.kubernetes.io"
) }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@ apiVersion: v1
kind: Namespace
metadata:
name: openshift-storage
{{- if .metadata.labels }}
labels:
# from 4.15+ LVM operator can be part of the management partition.
{{- template "requiredLabels" (list .metadata.labels
"workload.openshift.io/allowed: \"management\""
"openshift.io/cluster-monitoring: \"true\""
) }}
{{- template "allowLabels" (list .metadata.labels
"pod-security.kubernetes.io"
) }}
{{- end }}
workload.openshift.io/allowed: "management"
openshift.io/cluster-monitoring: "true"
21 changes: 0 additions & 21 deletions ztp/kube-compare-reference/optional_labels.tmpl

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,3 @@ metadata:
name: openshift-logging
annotations:
workload.openshift.io/allowed: management
{{- if .metadata.labels }}
labels:
{{- template "allowLabels" (list .metadata.labels
"pod-security.kubernetes.io"
) }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,3 @@ metadata:
workload.openshift.io/allowed: management
labels:
kubernetes.io/metadata.name: openshift-lifecycle-agent
{{- if .metadata.labels }}
labels:
{{- template "requiredLabels" (list .metadata.labels
"kubernetes.io/metadata.name: openshift-lifecycle-agent"
) }}
{{- template "allowLabels" (list .metadata.labels
"pod-security.kubernetes.io"
) }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,3 @@ metadata:
workload.openshift.io/allowed: management
labels:
openshift.io/cluster-monitoring: "true"
{{- if .metadata.labels }}
labels:
{{- template "requiredLabels" (list .metadata.labels
"openshift.io/cluster-monitoring: \"true\""
) }}
{{- template "allowLabels" (list .metadata.labels
"pod-security.kubernetes.io"
) }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,3 @@ metadata:
name: openshift-sriov-network-operator
annotations:
workload.openshift.io/allowed: management
{{- if .metadata.labels }}
labels:
{{- template "allowLabels" (list .metadata.labels
"pod-security.kubernetes.io"
) }}
{{- end }}