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

Validates component CR name in webhook #501

Merged
merged 1 commit into from
Nov 17, 2021

Conversation

PuneetPunamiya
Copy link
Member

  • This patch adds a check where it validates the name
    of the component CR before applying it on the cluster

  • This patch also moves all the constants to pkg/apis/const.go

Fixes: #497

Signed-off-by: Puneet Punamiya ppunamiy@redhat.com

Changes

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

@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Nov 11, 2021
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 11, 2021
@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/tektonaddon_validation.go 95.0% 95.5% 0.5
pkg/apis/operator/v1alpha1/tektonconfig_validation.go 88.2% 88.9% 0.7
pkg/apis/operator/v1alpha1/tektonpipeline_validation.go 76.9% 80.0% 3.1
pkg/apis/operator/v1alpha1/tektontrigger_validation.go 90.0% 91.7% 1.7

@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/tektonaddon_validation.go 95.0% 95.5% 0.5
pkg/apis/operator/v1alpha1/tektonconfig_validation.go 88.2% 86.1% -2.1
pkg/apis/operator/v1alpha1/tektondashboard_validation.go 100.0% 85.7% -14.3
pkg/apis/operator/v1alpha1/tektonpipeline_validation.go 76.9% 73.3% -3.6
pkg/apis/operator/v1alpha1/tektontrigger_validation.go 90.0% 83.3% -6.7

@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/tektonaddon_validation.go 95.0% 90.9% -4.1
pkg/apis/operator/v1alpha1/tektonconfig_validation.go 88.2% 86.1% -2.1
pkg/apis/operator/v1alpha1/tektondashboard_validation.go 100.0% 85.7% -14.3
pkg/apis/operator/v1alpha1/tektonpipeline_validation.go 76.9% 73.3% -3.6
pkg/apis/operator/v1alpha1/tektontrigger_validation.go 90.0% 83.3% -6.7

@PuneetPunamiya
Copy link
Member Author

/test pull-tekton-operator-integration-tests

@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/tektonaddon_validation.go 95.0% 90.9% -4.1
pkg/apis/operator/v1alpha1/tektonconfig_validation.go 88.2% 86.1% -2.1
pkg/apis/operator/v1alpha1/tektondashboard_validation.go 100.0% 85.7% -14.3
pkg/apis/operator/v1alpha1/tektonpipeline_validation.go 76.9% 73.3% -3.6
pkg/apis/operator/v1alpha1/tektontrigger_validation.go 90.0% 83.3% -6.7

@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/tektonaddon_validation.go 95.0% 90.9% -4.1
pkg/apis/operator/v1alpha1/tektonconfig_validation.go 88.2% 86.1% -2.1
pkg/apis/operator/v1alpha1/tektondashboard_validation.go 100.0% 85.7% -14.3
pkg/apis/operator/v1alpha1/tektonpipeline_validation.go 76.9% 73.3% -3.6
pkg/apis/operator/v1alpha1/tektontrigger_validation.go 90.0% 83.3% -6.7

@nikhil-thomas
Copy link
Member

/approve

@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nikhil-thomas

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 Nov 12, 2021
@PuneetPunamiya PuneetPunamiya force-pushed the validate-component-cr branch 2 times, most recently from f92885f to a38510b Compare November 12, 2021 05:12
@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/tektonaddon_validation.go 95.0% 90.9% -4.1
pkg/apis/operator/v1alpha1/tektonconfig_validation.go 88.2% 86.1% -2.1
pkg/apis/operator/v1alpha1/tektondashboard_validation.go 100.0% 85.7% -14.3
pkg/apis/operator/v1alpha1/tektonpipeline_validation.go 76.9% 73.3% -3.6
pkg/apis/operator/v1alpha1/tektontrigger_validation.go 90.0% 83.3% -6.7

@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/tektonaddon_validation.go 95.0% 90.9% -4.1
pkg/apis/operator/v1alpha1/tektonconfig_validation.go 88.2% 86.1% -2.1
pkg/apis/operator/v1alpha1/tektondashboard_validation.go 100.0% 85.7% -14.3
pkg/apis/operator/v1alpha1/tektonpipeline_validation.go 76.9% 73.3% -3.6
pkg/apis/operator/v1alpha1/tektontrigger_validation.go 90.0% 83.3% -6.7

@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/tektonaddon_validation.go 95.0% 87.0% -8.0
pkg/apis/operator/v1alpha1/tektonconfig_validation.go 88.2% 83.8% -4.5
pkg/apis/operator/v1alpha1/tektondashboard_validation.go 100.0% 75.0% -25.0
pkg/apis/operator/v1alpha1/tektonpipeline_validation.go 76.9% 68.8% -8.2
pkg/apis/operator/v1alpha1/tektontrigger_validation.go 90.0% 76.9% -13.1

@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/tektonaddon_validation.go 95.0% 87.0% -8.0
pkg/apis/operator/v1alpha1/tektonconfig_validation.go 88.2% 83.8% -4.5
pkg/apis/operator/v1alpha1/tektondashboard_validation.go 100.0% 75.0% -25.0
pkg/apis/operator/v1alpha1/tektonpipeline_validation.go 76.9% 68.8% -8.2
pkg/apis/operator/v1alpha1/tektontrigger_validation.go 90.0% 76.9% -13.1

   - This patch adds a check where it validates the name
     of the component CR before applying it on the cluster

   - This patch also moves all the constants to `pkg/apis/const.go`

Fixes: tektoncd#497

Signed-off-by: Puneet Punamiya <ppunamiy@redhat.com>
@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/tektonaddon_validation.go 95.0% 87.0% -8.0
pkg/apis/operator/v1alpha1/tektonconfig_validation.go 88.2% 83.8% -4.5
pkg/apis/operator/v1alpha1/tektondashboard_validation.go 100.0% 75.0% -25.0
pkg/apis/operator/v1alpha1/tektonpipeline_validation.go 76.9% 68.8% -8.2
pkg/apis/operator/v1alpha1/tektontrigger_validation.go 90.0% 76.9% -13.1

@sm43
Copy link
Member

sm43 commented Nov 17, 2021

/lgtm
/thankyou
/meow

@tekton-robot
Copy link
Contributor

@sm43: cat image

In response to this:

/lgtm
/thankyou
/meow

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 lgtm Indicates that a PR is ready to be merged. label Nov 17, 2021
@tekton-robot tekton-robot merged commit cd93490 into tektoncd:main Nov 17, 2021
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. 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.

Validate Component CR name in webhook
4 participants