3.14. Setting additional options for webhooks
Optionally, you can set the failurePolicy, timeoutSeconds, or sideEffects options for the webhooks created by several controllers in OpenShift Pipelines. For more information about these options, see the Kubernetes documentation.
Prerequisites
-
You installed the
occommand-line utility. -
You are logged into your OpenShift Container Platform cluster with administrator rights for the namespace in which OpenShift Pipelines is installed, typically the
openshift-pipelinesnamespace.
Procedure
View the list of webhooks that the OpenShift Pipelines controllers created. There are two types of webhooks: mutating webhooks and validating webhooks.
To view the list of mutating webhooks, enter the following command:
$ oc get MutatingWebhookConfigurationExample output
NAME WEBHOOKS AGE annotation.operator.tekton.dev 1 4m20s proxy.operator.tekton.dev 1 4m20s webhook.operator.tekton.dev 1 4m22s webhook.pipeline.tekton.dev 1 4m20s webhook.triggers.tekton.dev 1 3m50sTo view the list of validating webhooks, enter the following command:
$ oc get ValidatingWebhookConfigurationExample output
NAME WEBHOOKS AGE config.webhook.operator.tekton.dev 1 4m24s config.webhook.pipeline.tekton.dev 1 4m22s config.webhook.triggers.tekton.dev 1 3m52s namespace.operator.tekton.dev 1 4m22s validation.pipelinesascode.tekton.dev 1 2m49s validation.webhook.operator.tekton.dev 1 4m24s validation.webhook.pipeline.tekton.dev 1 4m22s validation.webhook.triggers.tekton.dev 1 3m52s
In the
TektonConfigcustom resource (CR), add configuration for mutating and validating webhooks under the section for each of the controllers as necessary, as shown in the following examples. Use thevalidation.webhook.pipeline.tekton.devspec for the validating webhooks and thewebhook.pipeline.tekton.devspec for the mutating webhooks.重要-
You cannot set configuration for
operatorwebhooks. -
All settings are optional. For example, you can set the
timeoutSecondsparameter and omit thefailurePolicyandsideEffectsparameters.
Example settings for the Pipelines controller
apiVersion: operator.tekton.dev/v1 kind: TektonConfig metadata: name: config spec: pipeline: options: webhookConfigurationOptions: validation.webhook.pipeline.tekton.dev: failurePolicy: Fail timeoutSeconds: 20 sideEffects: None webhook.pipeline.tekton.dev: failurePolicy: Fail timeoutSeconds: 20 sideEffects: NoneExample settings for the Triggers controller
apiVersion: operator.tekton.dev/v1 kind: TektonConfig metadata: name: config spec: triggers: options: webhookConfigurationOptions: validation.webhook.triggers.tekton.dev: failurePolicy: Fail timeoutSeconds: 20 sideEffects: None webhook.triggers.tekton.dev: failurePolicy: Fail timeoutSeconds: 20 sideEffects: NoneExample settings for the Pipelines as Code controller
apiVersion: operator.tekton.dev/v1 kind: TektonConfig metadata: name: config spec: pipelinesAsCode: options: webhookConfigurationOptions: validation.pipelinesascode.tekton.dev: failurePolicy: Fail timeoutSeconds: 20 sideEffects: None pipelines.triggers.tekton.dev: failurePolicy: Fail timeoutSeconds: 20 sideEffects: NoneExample settings for the Tekton Hub controller
apiVersion: operator.tekton.dev/v1 kind: TektonConfig metadata: name: config spec: hub: options: webhookConfigurationOptions: validation.webhook.hub.tekton.dev: failurePolicy: Fail timeoutSeconds: 20 sideEffects: None webhook.hub.tekton.dev: failurePolicy: Fail timeoutSeconds: 20 sideEffects: None-
You cannot set configuration for