Skip to content

Commit 4e2c56b

Browse files
joelanfordci-robot
authored andcommitted
UPSTREAM: <carry>: manifests: add hostPath mount for /etc/containers
Signed-off-by: Joe Lanford <[email protected]>
1 parent 99eac20 commit 4e2c56b

8 files changed

+46
-3
lines changed

openshift/generate-manifests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ for container_name in "${!IMAGE_MAPPINGS[@]}"; do
5555
placeholder="${IMAGE_MAPPINGS[$container_name]}"
5656
$YQ -i "(select(.kind == \"Deployment\")|.spec.template.spec.containers[]|select(.name==\"$container_name\")|.image) = \"$placeholder\"" "$TMP_KUSTOMIZE_OUTPUT"
5757
$YQ -i 'select(.kind == "Deployment").spec.template.metadata.annotations += {"target.workload.openshift.io/management": "{\"effect\": \"PreferredDuringScheduling\"}"}' "$TMP_KUSTOMIZE_OUTPUT"
58-
$YQ -i 'select(.kind == "Deployment").spec.template.metadata.annotations += {"openshift.io/required-scc": "restricted-v2"}' "$TMP_KUSTOMIZE_OUTPUT"
58+
$YQ -i 'select(.kind == "Deployment").spec.template.metadata.annotations += {"openshift.io/required-scc": "privileged"}' "$TMP_KUSTOMIZE_OUTPUT"
5959
$YQ -i 'select(.kind == "Deployment").spec.template.spec += {"priorityClassName": "system-cluster-critical"}' "$TMP_KUSTOMIZE_OUTPUT"
6060
$YQ -i 'select(.kind == "Namespace").metadata.annotations += {"workload.openshift.io/allowed": "management"}' "$TMP_KUSTOMIZE_OUTPUT"
6161
done

openshift/kustomize/overlays/openshift/kustomization.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,16 @@ resources:
1010
- ../../../../config/base/manager
1111

1212
patches:
13+
- target:
14+
kind: ClusterRole
15+
name: manager-role
16+
path: patches/manager_role.yaml
1317
- target:
1418
kind: Deployment
1519
name: controller-manager
1620
path: patches/manager_deployment_ca.yaml
21+
- target:
22+
kind: Deployment
23+
name: controller-manager
24+
path: patches/manager_deployment_mount_etc_containers.yaml
25+
- path: patches/manager_namespace_privileged.yaml
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
- op: add
2+
path: /spec/template/spec/volumes/-
3+
value: {"name":"etc-containers", "hostPath":{"path":"/etc/containers", "type": "Directory"}}
4+
- op: add
5+
path: /spec/template/spec/containers/0/volumeMounts/-
6+
value: {"name":"etc-containers", "readOnly": true, "mountPath":"/etc/containers"}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: system
5+
labels:
6+
pod-security.kubernetes.io/enforce: privileged
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
- op: add
2+
path: /rules/-
3+
value:
4+
apiGroups: [security.openshift.io]
5+
resources: [securitycontextconstraints]
6+
resourceNames: [privileged]
7+
verbs: [use]

openshift/manifests/00-namespace-openshift-operator-controller.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v1
22
kind: Namespace
33
metadata:
44
labels:
5-
pod-security.kubernetes.io/enforce: restricted
5+
pod-security.kubernetes.io/enforce: privileged
66
pod-security.kubernetes.io/enforce-version: latest
77
name: openshift-operator-controller
88
annotations:

openshift/manifests/09-clusterrole-operator-controller-manager-role.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,11 @@ rules:
4747
verbs:
4848
- patch
4949
- update
50+
- apiGroups:
51+
- security.openshift.io
52+
resourceNames:
53+
- privileged
54+
resources:
55+
- securitycontextconstraints
56+
verbs:
57+
- use

openshift/manifests/18-deployment-openshift-operator-controller-operator-controller-controller-manager.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ spec:
1818
annotations:
1919
kubectl.kubernetes.io/default-container: manager
2020
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
21-
openshift.io/required-scc: restricted-v2
21+
openshift.io/required-scc: privileged
2222
labels:
2323
control-plane: operator-controller-controller-manager
2424
spec:
@@ -78,6 +78,9 @@ spec:
7878
name: olmv1-certificate
7979
readOnly: true
8080
subPath: olm-ca.crt
81+
- mountPath: /etc/containers
82+
name: etc-containers
83+
readOnly: true
8184
securityContext:
8285
runAsNonRoot: true
8386
seccompProfile:
@@ -94,4 +97,8 @@ spec:
9497
name: operator-controller-openshift-ca
9598
optional: false
9699
name: olmv1-certificate
100+
- hostPath:
101+
path: /etc/containers
102+
type: Directory
103+
name: etc-containers
97104
priorityClassName: system-cluster-critical

0 commit comments

Comments
 (0)