Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add webhookconfiguration options to tektonConfig additional options #2129

Merged
merged 1 commit into from
Jun 10, 2024

Conversation

jkhelil
Copy link
Member

@jkhelil jkhelil commented Apr 29, 2024

Changes

Adds webhook configuration options(FailurePolicy, TimeoutSeconds, SideEffects) to tektonConfig additional options

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

Release Notes

Adds webhook configuration options(FailurePolicy, TimeoutSeconds, SideEffects) to tektonConfig additional options

@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Apr 29, 2024
@tekton-robot tekton-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 29, 2024
@tekton-robot
Copy link
Contributor

Hi @jkhelil. Thanks for your PR.

I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 29, 2024
@jkandasa
Copy link
Member

/ok-to-test

@tekton-robot tekton-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 29, 2024
@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-operator-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/common/transformer_additional_options.go 87.5% 87.1% -0.4

@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-operator-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/common/transformer_additional_options.go 87.5% 87.1% -0.4

@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-operator-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/common/transformer_additional_options.go 87.5% 87.1% -0.4

@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-operator-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/common/transformer_additional_options.go 87.5% 87.1% -0.4

@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-operator-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/common/transformer_additional_options.go 87.5% 87.1% -0.4

* `deployments` - additional deployments to be created by the operator
* `statefulsets` - additional statefulsets to be created by the operator
* `horizontalPodAutoscalers` - additional horizontalPodAutoscalers to be created by the operator
* `webhookConfigurationOptions` - additional options for pipelines webooks, To get detailed information about webhooks options visit https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jkandasa

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 7, 2024
@jkhelil jkhelil force-pushed the SRVKP-4442 branch 2 times, most recently from 1f29b82 to 8c8cb88 Compare May 7, 2024 06:33
@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-operator-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/common/transformer_additional_options.go 87.5% 87.1% -0.4

@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-operator-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/common/transformer_additional_options.go 87.5% 87.1% -0.4

@@ -650,3 +655,12 @@ The following fields are supported in `HorizontalPodAutoscaler` (aka HPA)
[schedule]:https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#cron-schedule-syntax
[priorityClassName]: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#pod-priority
[priorityClass]: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#priorityclass

### webhookConfigurationOptions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use 4 number of ####, so that webhookConfigurationOptions should comes under Options header
Header can be webhookConfigurationOptions => Webhook Configuration Options

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, this needs to be moved little above the links

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

validation.webhook.pipeline.tekton.dev:
failurePolicy: "Ignore"
timeoutSeconds: 20
SideEffects: None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove the changes from TektonPipeline.md

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-operator-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/operator/v1alpha1/additional_options_validation.go Do not exist 88.9%
pkg/apis/operator/v1alpha1/tektonconfig_validation.go 42.5% 43.2% 0.7
pkg/apis/operator/v1alpha1/tektonpipeline_validation.go 83.3% 84.2% 0.9
pkg/reconciler/common/transformer_additional_options.go 87.5% 87.1% -0.4

@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-operator-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/operator/v1alpha1/additional_options_validation.go Do not exist 88.9%
pkg/apis/operator/v1alpha1/tektonconfig_validation.go 42.5% 43.2% 0.7
pkg/apis/operator/v1alpha1/tektonpipeline_validation.go 83.3% 84.2% 0.9
pkg/reconciler/common/transformer_additional_options.go 87.5% 87.1% -0.4

@jkhelil
Copy link
Member Author

jkhelil commented May 22, 2024

@piyush-garg @savitaashture can you have a fresh look please ?

@@ -115,6 +115,8 @@ func (tc *TektonConfig) Validate(ctx context.Context) (errs *apis.FieldError) {

errs = errs.Also(tc.Spec.Pipeline.PipelineProperties.validate("spec.pipeline"))

errs = errs.Also(tc.Spec.Pipeline.Options.validate("spec.pipeline.options"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should be doing here the config options one, and for others we should in respective valdations. I think we should validate this for all components

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -655,6 +664,14 @@ The following fields are supported in `HorizontalPodAutoscaler` (aka HPA)

**NOTE**: If a Deployment or StatefulSet has a Horizontal Pod Autoscaling (HPA) and is in active state, Operator will not control the replicas to that resource. However if `status.desiredReplicas` and `spec.minReplicas` not present in HPA, operator takes the control. Also if HPA disabled, operator takes control. Even though the operator takes the control, the replicas value will be adjusted to the hpa's scaling range.

#### webhookConfigurationOptions
Defines additional options for each webhooks. Use webhook name as a key to define options for a webhook. To get detailed information about webhooks options visit https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should add a note for if the webhook does not exist we that name, the configuration will be ignored

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment added

@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-operator-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/operator/v1alpha1/additional_options_validation.go Do not exist 88.9%
pkg/apis/operator/v1alpha1/tektonconfig_validation.go 42.5% 44.4% 1.9
pkg/apis/operator/v1alpha1/tektonpipeline_validation.go 83.3% 84.2% 0.9
pkg/reconciler/common/transformer_additional_options.go 87.5% 87.1% -0.4

@jkhelil
Copy link
Member Author

jkhelil commented May 31, 2024

@savitaashture @piyush-garg @jkandasa
Can you retake a look/lgtm please ?

@jkhelil jkhelil force-pushed the SRVKP-4442 branch 2 times, most recently from 1f934c0 to 7fc18d5 Compare May 31, 2024 14:50
@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-operator-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/operator/v1alpha1/additional_options_validation.go Do not exist 88.9%
pkg/apis/operator/v1alpha1/tektonconfig_validation.go 42.5% 45.7% 3.1
pkg/apis/operator/v1alpha1/tektonpipeline_validation.go 83.3% 84.2% 0.9
pkg/reconciler/common/transformer_additional_options.go 87.5% 87.1% -0.4

@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-operator-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/operator/v1alpha1/additional_options_validation.go Do not exist 88.9%
pkg/apis/operator/v1alpha1/tektonconfig_validation.go 42.5% 45.7% 3.1
pkg/apis/operator/v1alpha1/tektonpipeline_validation.go 83.3% 84.2% 0.9
pkg/reconciler/common/transformer_additional_options.go 87.5% 87.1% -0.4

the following options are supported for webhookConfigurationOptions
* `failurePolicy` - defines how unrecognized errors and timeout errors from the admission webhook are handled. Allowed values are `Ignore` or `Fail`
* `timeoutSeconds` - allows configuring how long the API server should wait for a webhook to respond before treating the call as a failure.
* `sideEffects` - indicates whether the webhook have a side effet. Allowed values are `None`, `NoneOnDryRun`, `Unknown`, or 'Some'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jkhelil i see the valid values for sideEffects are None and NoneOnDryRun based on the official k8s doc https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#side-effects

Can you please recheck for Unknown, or 'Some'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see all the 4 values here https://github.com/kubernetes/api/blob/master/admissionregistration/v1beta1/types.go#L74-L87 but not sure why k8s doc did not list this 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have picked the values from the code https://github.com/kubernetes/kubernetes/blob/master/pkg/apis/admissionregistration/types.go#L122
and the values seems very old, so I am thinking the doc is not up to date

@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-operator-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/operator/v1alpha1/additional_options_validation.go Do not exist 88.9%
pkg/apis/operator/v1alpha1/tektonconfig_validation.go 42.5% 45.7% 3.1
pkg/apis/operator/v1alpha1/tektonpipeline_validation.go 83.3% 84.2% 0.9
pkg/reconciler/common/transformer_additional_options.go 87.5% 87.1% -0.4

@savitaashture
Copy link
Contributor

LGTM

Thank you @jkhelil

@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-operator-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/operator/v1alpha1/additional_options_validation.go Do not exist 88.9%
pkg/apis/operator/v1alpha1/tektonconfig_validation.go 42.5% 45.7% 3.1
pkg/apis/operator/v1alpha1/tektonpipeline_validation.go 83.3% 84.2% 0.9
pkg/reconciler/common/transformer_additional_options.go 87.5% 87.1% -0.4

errs = errs.Also(tc.Spec.Hub.Options.validate("spec.hub.options"))
errs = errs.Also(tc.Spec.Dashboard.Options.validate("spec.dashboard.options"))
errs = errs.Also(tc.Spec.Chain.Options.validate("spec.chain.options"))
errs = errs.Also(tc.Spec.Trigger.Options.validate("spec.trigger.options"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont we need to have one for config like errs = errs.Also(tc.Spec.Options.validate("spec.options"))

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@piyush-garg TektonConfigSpec struct doestnt have Options

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohk, thanks

@piyush-garg
Copy link
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 7, 2024
@jkhelil
Copy link
Member Author

jkhelil commented Jun 10, 2024

/retest

@tekton-robot tekton-robot merged commit 8b91274 into tektoncd:main Jun 10, 2024
8 checks passed
@jkhelil jkhelil deleted the SRVKP-4442 branch September 2, 2024 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants