Skip to content

Commit 00f46b7

Browse files
OSD-24266 : Disabled IDMS/ICSP validatingwebhook in HCP
1 parent 1033563 commit 00f46b7

File tree

3 files changed

+8
-43
lines changed

3 files changed

+8
-43
lines changed

config/package/resources.yaml.gotmpl

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -173,48 +173,6 @@ webhooks:
173173
---
174174
apiVersion: admissionregistration.k8s.io/v1
175175
kind: ValidatingWebhookConfiguration
176-
metadata:
177-
annotations:
178-
package-operator.run/phase: webhooks
179-
service.beta.openshift.io/inject-cabundle: "false"
180-
creationTimestamp: null
181-
name: sre-imagecontentpolicies-validation
182-
webhooks:
183-
- admissionReviewVersions:
184-
- v1
185-
clientConfig:
186-
caBundle: '{{.config.serviceca | b64enc }}'
187-
url: https://validation-webhook.{{.package.metadata.namespace}}.svc.cluster.local/imagecontentpolicies-validation
188-
failurePolicy: Fail
189-
matchPolicy: Equivalent
190-
name: imagecontentpolicies-validation.managed.openshift.io
191-
rules:
192-
- apiGroups:
193-
- config.openshift.io
194-
apiVersions:
195-
- '*'
196-
operations:
197-
- CREATE
198-
- UPDATE
199-
resources:
200-
- imagedigestmirrorsets
201-
- imagetagmirrorsets
202-
scope: Cluster
203-
- apiGroups:
204-
- operator.openshift.io
205-
apiVersions:
206-
- '*'
207-
operations:
208-
- CREATE
209-
- UPDATE
210-
resources:
211-
- imagecontentsourcepolicies
212-
scope: Cluster
213-
sideEffects: None
214-
timeoutSeconds: 2
215-
---
216-
apiVersion: admissionregistration.k8s.io/v1
217-
kind: ValidatingWebhookConfiguration
218176
metadata:
219177
annotations:
220178
package-operator.run/phase: webhooks

pkg/webhooks/imagecontentpolicies/imagecontentpolicies.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func (w *ImageContentPoliciesWebhook) ClassicEnabled() bool {
170170
}
171171

172172
func (w *ImageContentPoliciesWebhook) HypershiftEnabled() bool {
173-
return true
173+
return false
174174
}
175175

176176
// authorizeImageDigestMirrorSet should reject an ImageDigestMirrorSet that matches an unauthorized mirror list

pkg/webhooks/imagecontentpolicies/imagecontentpolicies_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,13 @@ func TestImageContentPolicy(t *testing.T) {
504504
t.Errorf("expected allowed request with code: %d, got %d", http.StatusForbidden, resp.Result.Code)
505505
}
506506
}
507+
508+
enabled := hook.HypershiftEnabled()
509+
510+
if enabled {
511+
t.Error("expected to disable in hypershift")
512+
}
513+
507514
})
508515
}
509516
}

0 commit comments

Comments
 (0)