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

Handle validation, defaults and working behavior for Replicas #751

Merged
merged 1 commit into from
Sep 10, 2020

Conversation

savitaashture
Copy link
Contributor

@savitaashture savitaashture commented Sep 10, 2020

Changes

  1. PR fixes Replicas validation is not working as expected when triggers upgraded from v0.7.0 to v0.8.0 #750
  2. Edit operation for replicas on deployment was not working eventhough replicas not provided as part of el.spec.

That means if user don't specify replicas as part of el.spec then the edit operation on deployment should be success(edit operation on deployments can be done manually or any other mechanism ex: HPA).
as per the discussion from this PR #715 (comment)

Signed-off-by: Savita Ashture sashture@redhat.com

/cc @dibyom

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

  1. End user have a flexibility to set replicas as part of eventlistener spec
  2. If no replicas set on eventlistener spec then user can do edit operation on deployment manually or by any other mechanism (ex: HPA)
  3. If user provide negative value to replicas validation will fail and provide below error
Error from server (BadRequest): error when creating "STDIN": admission webhook "validation.webhook.triggers.tekton.dev" denied the request: validation failed: invalid value: -1: spec.replicas
  1. If user provide replicas value as 0 then a default value 1 will be set by webhook

@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Sep 10, 2020
@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 10, 2020
@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/reconciler/v1alpha1/eventlistener/eventlistener.go 75.5% 76.2% 0.8

@dibyom
Copy link
Member

dibyom commented Sep 10, 2020

Nice, thanks for fixing this.

The only minor comment I have is that the PR description contains a lot of useful info. It would be nice to have that as part of the commit message too!

/approve

@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dibyom

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 Sep 10, 2020
@savitaashture savitaashture changed the title Fix replicas validation and update operation for replica set Handle validation, defaults and working behavior for Replicas Sep 10, 2020
@savitaashture
Copy link
Contributor Author

Nice, thanks for fixing this.

The only minor comment I have is that the PR description contains a lot of useful info. It would be nice to have that as part of the commit message too!

/approve

@dibyom modified commit message

@dibyom
Copy link
Member

dibyom commented Sep 10, 2020

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 10, 2020
@dibyom
Copy link
Member

dibyom commented Sep 10, 2020

/retest

@tekton-robot tekton-robot merged commit 5a47a00 into tektoncd:master Sep 10, 2020
dibyom added a commit to dibyom/triggers that referenced this pull request Sep 10, 2020
WIP

Fixes tektoncd#751

Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
@dibyom dibyom mentioned this pull request Sep 10, 2020
3 tasks
dibyom added a commit to dibyom/triggers that referenced this pull request Sep 10, 2020
In tektoncd#712, we added a feature to propagate annotations added to the EL to its
underlying resources. However, this resulted in infinite reconcile loops since
the deployment controller will add a standard revision annotation that the EL
controller will keep trying to overwrite. To fix this, this commit switches the
annotation propagation to merge any annotations set on the underlying resources
before adding any extra annotations from the EL.

Fixes tektoncd#751

Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replicas validation is not working as expected when triggers upgraded from v0.7.0 to v0.8.0
3 participants