Skip to content

Commit 317232b

Browse files
Merge pull request #1308 from ShazaAldawamneh/SCC_fix
AUTH-482: set required-scc for openshift workloads
2 parents 53c01a7 + 460f490 commit 317232b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

pkg/operator/status.go

+7
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ func (optr *Operator) syncStatus(co *osconfigv1.ClusterOperator, conds []osconfi
150150
for _, c := range conds {
151151
v1helpers.SetStatusCondition(&co.Status.Conditions, c)
152152
}
153+
if co.Annotations == nil {
154+
co.Annotations = map[string]string{}
155+
}
156+
co.Annotations["openshift.io/required-scc"] = "restricted-v2"
153157

154158
_, err := optr.osClient.ConfigV1().ClusterOperators().UpdateStatus(context.Background(), co, metav1.UpdateOptions{})
155159
return err
@@ -237,6 +241,9 @@ func (optr *Operator) defaultClusterOperator() *osconfigv1.ClusterOperator {
237241
return &osconfigv1.ClusterOperator{
238242
ObjectMeta: metav1.ObjectMeta{
239243
Name: clusterOperatorName,
244+
Annotations: map[string]string{
245+
"openshift.io/required-scc": "restricted-v2",
246+
},
240247
},
241248
Status: osconfigv1.ClusterOperatorStatus{
242249
Conditions: optr.defaultStatusConditions(),

pkg/operator/status_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ func TestGetOrCreateClusterOperator(t *testing.T) {
204204
expectedCO: &osconfigv1.ClusterOperator{
205205
ObjectMeta: metav1.ObjectMeta{
206206
Name: clusterOperatorName,
207+
Annotations: map[string]string{
208+
"openshift.io/required-scc": "restricted-v2",
209+
},
207210
},
208211
Status: osconfigv1.ClusterOperatorStatus{
209212
Conditions: defaultConditions,

0 commit comments

Comments
 (0)