Repository navigation
feat(nomos): add --poll-until to nomos status - #2242
tomatotomata wants to merge 8 commits into
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
Hi @ahmadalguydi. Thanks for your PR. I'm waiting for a GoogleContainerTools member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Treat poll-until complete as full resource readiness, not only repository apply completion. Keep polling when a reported managed resource is not Current and document the behavior.\n\nAddresses maintainer review on GoogleContainerTools#2006.
|
Followed up on the readiness question in commit The Google CLA bot still requires the account holder to complete the CLA; that external signature step cannot be performed by the agent. |
|
/ok-to-test |
|
The presubmit failure was a syntax error in the new table literal at Could you please rerun the presubmit on the new head? /retest |
|
I traced the latest results to two separate causes. The required presubmit still wanted Go's simplified composite-literal form in |
tiffanny29631
left a comment
There was a problem hiding this comment.
Please update the PR description and title to reflect latest changes
|
I changed the polling target to separate successful Config Sync application from managed-resource readiness. The completion check now respects The focused tests and |
| } | ||
| if target != pollUntilSynced { | ||
| for _, resource := range repo.resources { | ||
| if resource.Status == kptv1alpha1.Failed { |
There was a problem hiding this comment.
checkConflict sets Status: "Conflict" for ownership overlaps, which never becomes Current. Please treat it as terminal like Failed, and pull the string into a constant shared with checkConflict. Also, before looking at resources, please check that the ResourceGroup status is fresh (observedGeneration == generation, no Reconciling=True). Otherwise current can pass on the previous inventory.
There was a problem hiding this comment.
Not blocking 1.26. Until then, a Conflict resource keeps current polling until the caller's timeout. Note for the follow-up: checking observedGeneration == generation on the ResourceGroup is enough, because the RG controller now always sets Reconciling=False.
There was a problem hiding this comment.
One related case to include in the follow-up here: when spec.override.statusMode: disabled is set on a RootSync or RepoSync (annotated on the ResourceGroup as configmanagement.gke.io/status: disabled), rg.Status.ResourceStatuses is omitted (len(repo.resources) == 0) and rg.Status.ObservedGeneration stays 0 even when rg.Spec.Resources is non-empty.
Right now, --poll-until=current treats len(repo.resources) == 0 as having no managed resources and exits 0 once the sync is SYNCED.
Once we add the rg.Status.ObservedGeneration == rg.Generation check in the follow-up, a ResourceGroup with statusMode: disabled will have ObservedGeneration (0) != Generation and would poll forever until timeout.
In the follow-up, we should check resourcegroup.IsStatusDisabled(rg) when --poll-until=current is used and fail fast with an error directing the user to --poll-until=synced (since resource-level status is disabled).
There was a problem hiding this comment.
Added it to #2326: with --poll-until=current, check resourcegroup.IsStatusDisabled(rg) first and fail fast with an error pointing to --poll-until=synced, before the ResourceGroup freshness check. For 1.26, a status-disabled ResourceGroup means current behaves like synced.
|
A few more things to address, we are on the right track, thanks for the patience! |
|
I'd recommend adding e2e test case(s) for this feature. |
|
Hi @tomatotomata, checking on the status of this PR. I want to encourage you to keep pushing this forward so we can include it in the Config Sync 1.26 release. Our feature complete date is 11/2, so time is a bit tight, but if we act quickly we can still make the cut! |
|
Hi @tomatotomata! Feature complete for 1.26 is coming up soon, and we'd love to get this in. Only two small things are left: Drop the complete alias and keep just synced and current. The rest of my review can go into a follow-up. If I don't hear from you by Wednesday (10/28), I'll jump in and push these changes to your branch so we make the cut. Thanks! |
…l-until Address the remaining review feedback for 1.26: - Support only `synced` and `current` for `--poll-until`. The `complete` alias added nothing over `current`, and flag values are hard to remove once released. - Report success only when at least one selected RootSync or RepoSync is found, so the command never exits 0 without checking anything. Clusters without sync objects are still skipped.
Verify that both targets exit once the root-sync is synced, that unsupported values are rejected, and that a --name matching nothing keeps polling until the caller's timeout.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Fixes #2006
Summary
Adds explicit completion targets for
nomos status:--poll-until=syncedwaits for the selected RootSync and RepoSync objects to reportSYNCEDwithout errors.--poll-until=currentalso waits for every reported managed resource to becomeCurrent.The
--namefilter scopes the completion check. An empty reachable cluster does not block other contexts, and at least one selected RootSync or RepoSync must be found. Incurrentmode, aFailedresource returns an error instead of polling forever;Unknownremains incomplete. Usesyncedwhen resource readiness is not required.Validation
go test ./cmd/nomos/status -run 'TestPollUntilReached|TestValidatePollUntil|TestClusterStates' -count=1passed.git diff --checkpassed.TestPrintStatusexpectation: the fixture expects UTC while the output uses the local Riyadh timezone. The focused polling and cluster-state tests pass, and the PR presubmits will validate the pushed head.Follow-ups: #2326