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

Persist state in statusreconciler #15585

Merged

Conversation

adshmh
Copy link
Contributor

@adshmh adshmh commented Dec 12, 2019

status-reconciler now saves the last known configuration at every sync and loads it at startup time. Fixes #13084

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 12, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @adshmh. Thanks for your PR.

I'm waiting for a kubernetes 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.

@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Dec 12, 2019
@k8s-ci-robot k8s-ci-robot added area/prow Issues or PRs related to prow sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Dec 12, 2019
Copy link
Contributor

@stevekuznetsov stevekuznetsov left a comment

Choose a reason for hiding this comment

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

This looks amazing! Couple small comments

prow/cmd/status-reconciler/main.go Outdated Show resolved Hide resolved
@@ -53,6 +54,15 @@ type options struct {

tokenBurst int
tokensPerHour int

// The following are used for reading/writing to GCS.
gcsCredentialsFile string
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these two and their associated flags something that could be DRYed out into a struct and embedded in all the controllers that do something similar? (tide, deck, etc)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds great. Could I submit this change as a separate PR once this one is merged, as it will change multiple controllers?

Copy link
Contributor

Choose a reason for hiding this comment

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

@adshmh I think we forgot to expose this as a flag in the first place 🤦‍♂️

Perhaps we can fix that with the patch to share this code between components that mean to write to GCS?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for catching that. Yes, I will include that in the patch.

prow/cmd/status-reconciler/main.go Outdated Show resolved Hide resolved
prow/config/agent.go Outdated Show resolved Hide resolved
prow/statusreconciler/status.go Show resolved Hide resolved
prow/statusreconciler/status.go Outdated Show resolved Hide resolved
@stevekuznetsov
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-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 Dec 12, 2019
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
This change prevents config Agent from sending more than one
notification to each of its subscribers upon calling Start.

Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
Status-reconciler now saves the last known state, i.e. configuration, in
the specified status file, which can reside on either a local filesystem
or on GCS. Upon start, status-reconciler compares this last known
configuration to the current configuration, thus reacting to changes it
may not have otherwise observed.

Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
@adshmh adshmh force-pushed the 13084-statusreconciler-persist-state branch from a02aee0 to 2bd9505 Compare December 13, 2019 17:13
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 13, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adshmh, stevekuznetsov

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 13, 2019
@k8s-ci-robot k8s-ci-robot merged commit 014dcb6 into kubernetes:master Dec 13, 2019
@k8s-ci-robot k8s-ci-robot added this to the v1.18 milestone Dec 13, 2019
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. area/prow Issues or PRs related to prow cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", 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. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

prow: statusreconciler: dump last state to disk to allow for reconciliation across restarts
3 participants