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

Updates TektonInstallerSet to allow replica changes to a deployment #530

Merged
merged 1 commit into from Dec 1, 2021

Conversation

sm43
Copy link
Member

@sm43 sm43 commented Nov 26, 2021

This now updates the installer set to allow replica changes, it does
it as follow

  • when creating a deployment it compute hash of spec and add it as
    annotation
  • while computing hash it set replicas to a const so that next time we
    can set replicas to same const and then calculate hash
  • if hash is different which would mean something is changed in spec
    other than hash
  • so it revert the spec to orignal and updates the replicas to what was
    on the cluster deployment
  • it will allow replica change but revert any other change to spec as the
    hash would change

Closes #491

Signed-off-by: Shivam Mukhade smukhade@redhat.com

/cc @nikhil-thomas @vdemeester @savitaashture

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 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. labels Nov 26, 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/reconciler/kubernetes/tektoninstallerset/install.go 80.9% 57.4% -23.4

@nikhil-thomas
Copy link
Member

/hold

@tekton-robot tekton-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 29, 2021
@nikhil-thomas
Copy link
Member

holding this pr so that we can make sure that we all agree on the level of control the operator should have on resources managed by operator.

@nikhil-thomas
Copy link
Member

@sm43 could you add the additional check where the exptetedhash is compared to annotation hash along with the exiting check.

This now updates the installer set to allow replica changes, it does
it as follow
- when creating a deployment it compute hash of spec and add it as
annotation
- while computing hash it set replicas to a const so that next time we
can set replicas to same const and then calculate hash
- if hash is different which would mean something is changed in spec
other than hash
- so it revert the spec to orignal and updates the replicas to what was
on the cluster deployment
- it will allow replica change but revert any other change to spec as the
hash would change

Signed-off-by: Shivam Mukhade <smukhade@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/reconciler/kubernetes/tektoninstallerset/install.go 80.9% 54.7% -26.1

@nikhil-thomas
Copy link
Member

/hold cancel

@tekton-robot tekton-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 30, 2021
@nikhil-thomas
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 30, 2021
@savitaashture
Copy link
Contributor

@sm43 should we add unit test to cover pending scenario so that coverage increases

@pradeepitm12
Copy link
Contributor

/lgtm

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

We will probably want to backport this to 0.50, 0.51 and 0.52 ? 😛

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 30, 2021
@savitaashture
Copy link
Contributor

/hold

@tekton-robot tekton-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 30, 2021
@savitaashture
Copy link
Contributor

@sm43 should we add unit test to cover pending scenario so that coverage increases

@sm43 added /hold and just checking will you add testcase as part of this PR or another one?

@sm43
Copy link
Member Author

sm43 commented Dec 1, 2021

@sm43 should we add unit test to cover pending scenario so that coverage increases

@sm43 added /hold and just checking will you add testcase as part of this PR or another one?

@savitaashture I will address the tests in a separate pr. :) we can merge this.

@savitaashture
Copy link
Contributor

@sm43 should we add unit test to cover pending scenario so that coverage increases

@sm43 added /hold and just checking will you add testcase as part of this PR or another one?

@savitaashture I will address the tests in a separate pr. :) we can merge this.

Sure 👍

@savitaashture savitaashture removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 1, 2021
Copy link
Contributor

@savitaashture savitaashture left a comment

Choose a reason for hiding this comment

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

🎉

/lgtm

@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: savitaashture, vdemeester

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:
  • OWNERS [savitaashture,vdemeester]

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 merged commit e20a2c9 into tektoncd:main Dec 1, 2021
@sm43 sm43 deleted the allow-replica-change branch August 19, 2022 05:29
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.

HorizontalPodAutoscaler on webhooks is getting "denied" by the operator
6 participants