Skip to content

Commit 7a78783

Browse files
committed
Default to legacy psa settings (#273)
The catalogSource api was recently updated to support running the associated pod in a "restricted" workflow as defined by the Pod Security Admission controller. By default, the catalogSource pods have been configured to run in "restricted" mode, which is disruptive to customers managing and deploying their own catalogSources as they need to rebuild their catalogs to run in "restricted" mode if a namespace is marked as "restricted". In an effort to provide users with a bit more time to rebuilt their catalogSources, this change configures catalogSources to run in "legacy" mode by default. A series of other changes will be made to update the namespaces associated with marketplace and olm to support catalogSources running in "legacy" mode by default. Signed-off-by: Alexander Greene <[email protected]>
1 parent 104da7e commit 7a78783

File tree

7 files changed

+32
-24
lines changed

7 files changed

+32
-24
lines changed

manifests/0000_50_olm_00-catalogsources.crd.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ spec:
8282
description: If specified, indicates the pod's priority. If not specified, the pod priority will be default or zero if there is no default.
8383
type: string
8484
securityContextConfig:
85-
description: 'SecurityContextConfig can be one of `legacy` or `restricted`. The CatalogSource''s pod is either injected with the right pod.spec.securityContext and pod.spec.container[*].securityContext values to allow the pod to run in Pod Security Admission(PSA) controller''s `restricted` mode, or doesn''t set these values at all, in which case the pod can only be run in PSA `baseline` or `privileged` namespaces. By default, SecurityContextConfig is set to `restricted`. If the value is unspecified, the default value of `restricted` is used. Specifying any other value will result in a validation error. When using older catalog images, which could not be run in `restricted` mode, the SecurityContextConfig should be set to `legacy`. More information about PSA can be found here: https://kubernetes.io/docs/concepts/security/pod-security-admission/'''
85+
description: "SecurityContextConfig can be one of `legacy` or `restricted`. The CatalogSource's pod is either injected with the right pod.spec.securityContext and pod.spec.container[*].securityContext values to allow the pod to run in Pod Security Admission (PSA) `restricted` mode, or doesn't set these values at all, in which case the pod can only be run in PSA `baseline` or `privileged` namespaces. Currently if the SecurityContextConfig is unspecified, the default value of `legacy` is used. Specifying a value other than `legacy` or `restricted` result in a validation error. When using older catalog images, which could not be run in `restricted` mode, the SecurityContextConfig should be set to `legacy`. \n In a future version will the default will be set to `restricted`, catalog maintainers should rebuild their catalogs with a version of opm that supports running catalogSource pods in `restricted` mode to prepare for these changes. \n More information about PSA can be found here: https://kubernetes.io/docs/concepts/security/pod-security-admission/'"
8686
type: string
87-
default: restricted
87+
default: legacy
8888
enum:
8989
- legacy
9090
- restricted

staging/api/crds/operators.coreos.com_catalogsources.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ spec:
8080
description: If specified, indicates the pod's priority. If not specified, the pod priority will be default or zero if there is no default.
8181
type: string
8282
securityContextConfig:
83-
description: 'SecurityContextConfig can be one of `legacy` or `restricted`. The CatalogSource''s pod is either injected with the right pod.spec.securityContext and pod.spec.container[*].securityContext values to allow the pod to run in Pod Security Admission(PSA) controller''s `restricted` mode, or doesn''t set these values at all, in which case the pod can only be run in PSA `baseline` or `privileged` namespaces. By default, SecurityContextConfig is set to `restricted`. If the value is unspecified, the default value of `restricted` is used. Specifying any other value will result in a validation error. When using older catalog images, which could not be run in `restricted` mode, the SecurityContextConfig should be set to `legacy`. More information about PSA can be found here: https://kubernetes.io/docs/concepts/security/pod-security-admission/'''
83+
description: "SecurityContextConfig can be one of `legacy` or `restricted`. The CatalogSource's pod is either injected with the right pod.spec.securityContext and pod.spec.container[*].securityContext values to allow the pod to run in Pod Security Admission (PSA) `restricted` mode, or doesn't set these values at all, in which case the pod can only be run in PSA `baseline` or `privileged` namespaces. Currently if the SecurityContextConfig is unspecified, the default value of `legacy` is used. Specifying a value other than `legacy` or `restricted` result in a validation error. When using older catalog images, which could not be run in `restricted` mode, the SecurityContextConfig should be set to `legacy`. \n In a future version will the default will be set to `restricted`, catalog maintainers should rebuild their catalogs with a version of opm that supports running catalogSource pods in `restricted` mode to prepare for these changes. \n More information about PSA can be found here: https://kubernetes.io/docs/concepts/security/pod-security-admission/'"
8484
type: string
85-
default: restricted
85+
default: legacy
8686
enum:
8787
- legacy
8888
- restricted

staging/api/crds/zz_defs.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

staging/api/pkg/operators/v1alpha1/catalogsource_types.go

+12-8
Original file line numberDiff line numberDiff line change
@@ -120,17 +120,21 @@ type GrpcPodConfig struct {
120120
// +optional
121121
PriorityClassName *string `json:"priorityClassName,omitempty"`
122122

123-
// SecurityContextConfig can be one of `legacy` or `restricted`. The CatalogSource's pod is either injected with
124-
// the right pod.spec.securityContext and pod.spec.container[*].securityContext values to allow the pod to run in
125-
// Pod Security Admission(PSA) controller's `restricted` mode, or doesn't set these values at all, in which case the pod
126-
// can only be run in PSA `baseline` or `privileged` namespaces. By default, SecurityContextConfig is set to `restricted`.
127-
// If the value is unspecified, the default value of `restricted` is used. Specifying any other value will result in a
128-
// validation error. When using older catalog images, which could not be run in `restricted` mode, the SecurityContextConfig
129-
// should be set to `legacy`.
123+
// SecurityContextConfig can be one of `legacy` or `restricted`. The CatalogSource's pod is either injected with the
124+
// right pod.spec.securityContext and pod.spec.container[*].securityContext values to allow the pod to run in Pod
125+
// Security Admission (PSA) `restricted` mode, or doesn't set these values at all, in which case the pod can only be
126+
// run in PSA `baseline` or `privileged` namespaces. Currently if the SecurityContextConfig is unspecified, the default
127+
// value of `legacy` is used. Specifying a value other than `legacy` or `restricted` result in a validation error.
128+
// When using older catalog images, which could not be run in `restricted` mode, the SecurityContextConfig should be
129+
// set to `legacy`.
130+
//
131+
// In a future version will the default will be set to `restricted`, catalog maintainers should rebuild their catalogs
132+
// with a version of opm that supports running catalogSource pods in `restricted` mode to prepare for these changes.
133+
//
130134
// More information about PSA can be found here: https://kubernetes.io/docs/concepts/security/pod-security-admission/'
131135
// +optional
132136
// +kubebuilder:validation:Enum=legacy;restricted
133-
// +kubebuilder:default:=restricted
137+
// +kubebuilder:default:=legacy
134138
SecurityContextConfig SecurityConfig `json:"securityContextConfig,omitempty"`
135139
}
136140

vendor/github.com/operator-framework/api/crds/operators.coreos.com_catalogsources.yaml

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/operator-framework/api/crds/zz_defs.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/operator-framework/api/pkg/operators/v1alpha1/catalogsource_types.go

+12-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)