Skip to content

Commit 4775bda

Browse files
Updates validating webhook name to validation.webhook.manual-approval.openshift-pipelines.org
Signed-off-by: PuneetPunamiya <[email protected]>
1 parent b59711e commit 4775bda

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

cmd/webhook/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func getEnvOrDefault(key, defaultValue string) string {
3838
func main() {
3939
serviceName := getEnvOrDefault("WEBHOOK_SERVICE_NAME", "manual-approval-webhook")
4040
secretName := getEnvOrDefault("WEBHOOK_SECRET_NAME", "manual-approval-gate-webhook-certs")
41-
webhookName := getEnvOrDefault("WEBHOOK_ADMISSION_CONTROLLER_NAME", "webhook.manual.approval.dev")
41+
webhookName := getEnvOrDefault("WEBHOOK_ADMISSION_CONTROLLER_NAME", "validation.webhook.manual-approval.openshift-pipelines.org")
4242

4343
systemNamespace := os.Getenv("SYSTEM_NAMESPACE")
4444
// Scope informers to the webhook's namespace instead of cluster-wide

config/kubernetes/201-clusterrole.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ rules:
8989
- apiGroups: ["admissionregistration.k8s.io"]
9090
resources: ["validatingwebhookconfigurations"]
9191
# validation.webhook.approvaltask.openshift.org performs schema validation when you, for example, create TaskLoops.
92-
resourceNames: ["webhook.manual.approval.dev"]
92+
resourceNames: ["validation.webhook.manual-approval.openshift-pipelines.org"]
9393
# When there are changes to the configs or secrets, knative updates the validatingwebhook config
9494
# with the updated certificates or the refreshed set of rules.
9595
verbs: ["get", "list", "update", "patch", "watch"]

config/kubernetes/400-webhook-controller.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ metadata:
2323
apiVersion: admissionregistration.k8s.io/v1
2424
kind: ValidatingWebhookConfiguration
2525
metadata:
26-
name: webhook.manual.approval.dev
26+
name: validation.webhook.manual-approval.openshift-pipelines.org
2727
webhooks:
2828
- admissionReviewVersions: ["v1"]
2929
clientConfig:
@@ -32,7 +32,7 @@ webhooks:
3232
namespace: tekton-pipelines
3333
failurePolicy: Fail
3434
sideEffects: None
35-
name: webhook.manual.approval.dev
35+
name: validation.webhook.manual-approval.openshift-pipelines.org
3636

3737
---
3838

config/openshift/201-clusterrole.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ rules:
9090
- apiGroups: ["admissionregistration.k8s.io"]
9191
resources: ["validatingwebhookconfigurations"]
9292
# validation.webhook.approvaltask.openshift.org performs schema validation when you, for example, create TaskLoops.
93-
resourceNames: ["webhook.manual.approval.dev"]
93+
resourceNames: ["validation.webhook.manual-approval.openshift-pipelines.org"]
9494
# When there are changes to the configs or secrets, knative updates the validatingwebhook config
9595
# with the updated certificates or the refreshed set of rules.
9696
verbs: ["get", "list", "update", "patch", "watch", "delete", "create"]

config/openshift/400-webhook-controller.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ metadata:
2323
apiVersion: admissionregistration.k8s.io/v1
2424
kind: ValidatingWebhookConfiguration
2525
metadata:
26-
name: webhook.manual.approval.dev
26+
name: validation.webhook.manual-approval.openshift-pipelines.org
2727
webhooks:
2828
- admissionReviewVersions: ["v1"]
2929
clientConfig:
@@ -32,7 +32,7 @@ webhooks:
3232
namespace: openshift-pipelines
3333
failurePolicy: Fail
3434
sideEffects: None
35-
name: webhook.manual.approval.dev
35+
name: validation.webhook.manual-approval.openshift-pipelines.org
3636

3737
---
3838

test/e2e_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ func TestValidateUserUpdateOwnApprovalStatus(t *testing.T) {
296296

297297
_, err = clients.ApprovalTaskClient.ApprovalTasks("default").Patch(context.TODO(), cr.GetName(), types.MergePatchType, patch, metav1.PatchOptions{})
298298

299-
errMsg := `admission webhook "webhook.manual.approval.dev" denied the request: User can only update their own approval input`
299+
errMsg := `admission webhook "validation.webhook.manual-approval.openshift-pipelines.org" denied the request: User can only update their own approval input`
300300
assert.Equal(t, errMsg, err.Error())
301301
})
302302
}
@@ -369,7 +369,7 @@ func TestValidateUserDoesNotExists(t *testing.T) {
369369

370370
_, err = clients.ApprovalTaskClient.ApprovalTasks("default").Patch(context.TODO(), cr.GetName(), types.MergePatchType, patch, metav1.PatchOptions{})
371371

372-
errMsg := `admission webhook "webhook.manual.approval.dev" denied the request: User does not exist in the in the approval list`
372+
errMsg := `admission webhook "validation.webhook.manual-approval.openshift-pipelines.org" denied the request: User does not exist in the in the approval list`
373373
assert.Equal(t, errMsg, err.Error())
374374
})
375375
}
@@ -481,7 +481,7 @@ func TestValidateApprovalTaskHasReachedFinalState(t *testing.T) {
481481
}
482482

483483
_, err = clients.ApprovalTaskClient.ApprovalTasks("default").Patch(context.TODO(), cr.GetName(), types.MergePatchType, patch, metav1.PatchOptions{})
484-
errMsg := `admission webhook "webhook.manual.approval.dev" denied the request: ApprovalTask has already reached it's final state`
484+
errMsg := `admission webhook "validation.webhook.manual-approval.openshift-pipelines.org" denied the request: ApprovalTask has already reached it's final state`
485485
assert.Equal(t, errMsg, err.Error())
486486
})
487487
}

0 commit comments

Comments
 (0)