-
Notifications
You must be signed in to change notification settings - Fork 146
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
Kargo app updater doesn't clear the app.Status.OperationState
when setting application operation, leading to inconsistencies during ArgoCD sync
#2985
Comments
See the discussion from this comment #2968 (comment) and below for more context. |
I did mention before in the other thread that this is kind of a no-no. A resource's Status is meant to be manipulated by the controller responsible for it and not by others. |
But you manipulate the operation field with bypassing server APIs ;) What's the substantial difference making it a no-no and operation field updates yes? However, I'll check if it's possible to clear the status field by the controller if it's about a completed operation finished before the current sync started. |
This is Kubernetes 101. Status is a special field. It is one of only a handful of fields that Kubernetes regards as a "subresource" and treats differently. What is different about a subresource is that the endpoints for creating/updating a resource ignore changes to subresources. Instead, the subresources get their own endpoints. RBAC is an area where you can see this on full display. Permission to update a resource kind X doesn't automatically come with permission to update X.status. That has to be requested separately. (Since, as I said -- it's a separate endpoint.) i.e. You would need to grant permissions on resource kind So if you were to look at the permissions of the Kargo controller, for instance, in addition to resource kinds like The reason you don't see this more often is precisely because, by convention, status subresources aren't meant to be manipulated by third parties. By convention, that field is exclusively for the controller responsible for the resource to reflect the observed state of the world. No one else should be touching it. |
Thanks for the explanation. I'll look into whether it's possible to handle better at ArgoCD side. Maybe it's just as simple as reset status field on app update if it became obsolete. |
…y a direct object update Some systems like Kargo update the application operation directly to initiate a new sync, bypassing the server. However, they can't update the status operation state to become nil, resulting in discrepancy, see akuity/kargo#2985 and the discussion. Handle this case on the app controller side. Signed-off-by: Andrii Korotkov <[email protected]>
…y a direct object update (argoproj#20875) Some systems like Kargo update the application operation directly to initiate a new sync, bypassing the server. However, they can't update the status operation state to become nil, resulting in discrepancy, see akuity/kargo#2985 and the discussion. Handle this case on the app controller side. Signed-off-by: Andrii Korotkov <[email protected]>
…y a direct object update (argoproj#20875) May fix argoproj#20875 Some systems like Kargo update the application operation directly to initiate a new sync, bypassing the server. However, they can't update the status operation state to become nil, resulting in discrepancy, see akuity/kargo#2985 and the discussion. Handle this case on the app controller side. Let's cherry-pick to v2.13. Signed-off-by: Andrii Korotkov <[email protected]>
…y a direct object update (argoproj#20875) May fix argoproj#20875 Some systems like Kargo update the application operation directly to initiate a new sync, bypassing the server. However, they can't update the status operation state to become nil, resulting in discrepancy, see akuity/kargo#2985 and the discussion. Handle this case on the app controller side. Let's cherry-pick to v2.13. Signed-off-by: Andrii Korotkov <[email protected]>
Trying this argoproj/argo-cd#20915 |
…y a direct object update (argoproj#20875) Fixes argoproj#20875 Some systems like Kargo update the application operation directly to initiate a new sync, bypassing the server. However, they can't update the status operation state to become nil, resulting in discrepancy, see akuity/kargo#2985 and the discussion. Handle this case on the app controller side. Let's cherry-pick to v2.13. Signed-off-by: Andrii Korotkov <[email protected]>
…y a direct object update (argoproj#20875) Fixes argoproj#20875 Some systems like Kargo update the application operation directly to initiate a new sync, bypassing the server. However, they can't update the status operation state to become nil, resulting in discrepancy, see akuity/kargo#2985 and the discussion. Handle this case on the app controller side. Let's cherry-pick to v2.13. Signed-off-by: Andrii Korotkov <[email protected]>
…y a direct object update (argoproj#20875) Fixes argoproj#20875 Some systems like Kargo update the application operation directly to initiate a new sync, bypassing the server. However, they can't update the status operation state to become nil, resulting in discrepancy, see akuity/kargo#2985 and the discussion. Handle this case on the app controller side. Let's cherry-pick to v2.13. Signed-off-by: Andrii Korotkov <[email protected]>
…y a direct object update (argoproj#20875) Fixes argoproj#20875 Some systems like Kargo update the application operation directly to initiate a new sync, bypassing the server. However, they can't update the status operation state to become nil, resulting in discrepancy, see akuity/kargo#2985 and the discussion. Handle this case on the app controller side. Let's cherry-pick to v2.13. Signed-off-by: Andrii Korotkov <[email protected]>
…y a direct object update (argoproj#20875) Fixes argoproj#20875 Some systems like Kargo update the application operation directly to initiate a new sync, bypassing the server. However, they can't update the status operation state to become nil, resulting in discrepancy, see akuity/kargo#2985 and the discussion. Handle this case on the app controller side. Let's cherry-pick to v2.13. Signed-off-by: Andrii Korotkov <[email protected]>
…y a direct object update (argoproj#20875) Fixes argoproj#20875 Some systems like Kargo update the application operation directly to initiate a new sync, bypassing the server. However, they can't update the status operation state to become nil, resulting in discrepancy, see akuity/kargo#2985 and the discussion. Handle this case on the app controller side. Let's cherry-pick to v2.13. Signed-off-by: Andrii Korotkov <[email protected]>
…y a direct object update (argoproj#20875) Fixes argoproj#20875 Some systems like Kargo update the application operation directly to initiate a new sync, bypassing the server. However, they can't update the status operation state to become nil, resulting in discrepancy, see akuity/kargo#2985 and the discussion. Handle this case on the app controller side. Let's cherry-pick to v2.13. Signed-off-by: Andrii Korotkov <[email protected]>
…y a direct object update (argoproj#20875) Fixes argoproj#20875 Some systems like Kargo update the application operation directly to initiate a new sync, bypassing the server. However, they can't update the status operation state to become nil, resulting in discrepancy, see akuity/kargo#2985 and the discussion. Handle this case on the app controller side. Let's cherry-pick to v2.13. Signed-off-by: Andrii Korotkov <[email protected]>
…y a direct object update (argoproj#20875) Fixes argoproj#20875 Some systems like Kargo update the application operation directly to initiate a new sync, bypassing the server. However, they can't update the status operation state to become nil, resulting in discrepancy, see akuity/kargo#2985 and the discussion. Handle this case on the app controller side. Let's cherry-pick to v2.13. Signed-off-by: Andrii Korotkov <[email protected]>
…y a direct object update (argoproj#20875) Fixes argoproj#20875 Some systems like Kargo update the application operation directly to initiate a new sync, bypassing the server. However, they can't update the status operation state to become nil, resulting in discrepancy, see akuity/kargo#2985 and the discussion. Handle this case on the app controller side. Let's cherry-pick to v2.13. Signed-off-by: Andrii Korotkov <[email protected]>
…y a direct object update (argoproj#20875) Fixes argoproj#20875 Some systems like Kargo update the application operation directly to initiate a new sync, bypassing the server. However, they can't update the status operation state to become nil, resulting in discrepancy, see akuity/kargo#2985 and the discussion. Handle this case on the app controller side. Let's cherry-pick to v2.13. Signed-off-by: Andrii Korotkov <[email protected]>
…y a direct object update (argoproj#20875) Fixes argoproj#20875 Some systems like Kargo update the application operation directly to initiate a new sync, bypassing the server. However, they can't update the status operation state to become nil, resulting in discrepancy, see akuity/kargo#2985 and the discussion. Handle this case on the app controller side. Let's cherry-pick to v2.13. Signed-off-by: Andrii Korotkov <[email protected]>
…y a direct object update (argoproj#20875) Fixes argoproj#20875 Some systems like Kargo update the application operation directly to initiate a new sync, bypassing the server. However, they can't update the status operation state to become nil, resulting in discrepancy, see akuity/kargo#2985 and the discussion. Handle this case on the app controller side. Let's cherry-pick to v2.13. Signed-off-by: Andrii Korotkov <[email protected]>
…y a direct object update (argoproj#20875) Fixes argoproj#20875 Some systems like Kargo update the application operation directly to initiate a new sync, bypassing the server. However, they can't update the status operation state to become nil, resulting in discrepancy, see akuity/kargo#2985 and the discussion. Handle this case on the app controller side. Let's cherry-pick to v2.13. Signed-off-by: Andrii Korotkov <[email protected]>
…y a direct object update (argoproj#20875) Fixes argoproj#20875 Some systems like Kargo update the application operation directly to initiate a new sync, bypassing the server. However, they can't update the status operation state to become nil, resulting in discrepancy, see akuity/kargo#2985 and the discussion. Handle this case on the app controller side. Let's cherry-pick to v2.13. Signed-off-by: Andrii Korotkov <[email protected]>
…y a direct object update (argoproj#20875) Fixes argoproj#20875 Some systems like Kargo update the application operation directly to initiate a new sync, bypassing the server. However, they can't update the status operation state to become nil, resulting in discrepancy, see akuity/kargo#2985 and the discussion. Handle this case on the app controller side. Let's cherry-pick to v2.13. Signed-off-by: Andrii Korotkov <[email protected]>
…y a direct object update (argoproj#20875) Fixes argoproj#20875 Some systems like Kargo update the application operation directly to initiate a new sync, bypassing the server. However, they can't update the status operation state to become nil, resulting in discrepancy, see akuity/kargo#2985 and the discussion. Handle this case on the app controller side. Let's cherry-pick to v2.13. Signed-off-by: Andrii Korotkov <[email protected]>
…y a direct object update (argoproj#20875) Fixes argoproj#20875 Some systems like Kargo update the application operation directly to initiate a new sync, bypassing the server. However, they can't update the status operation state to become nil, resulting in discrepancy, see akuity/kargo#2985 and the discussion. Handle this case on the app controller side. Let's cherry-pick to v2.13. Signed-off-by: Andrii Korotkov <[email protected]>
…y a direct object update (argoproj#20875) Fixes argoproj#20875 Some systems like Kargo update the application operation directly to initiate a new sync, bypassing the server. However, they can't update the status operation state to become nil, resulting in discrepancy, see akuity/kargo#2985 and the discussion. Handle this case on the app controller side. Let's cherry-pick to v2.13. Signed-off-by: Andrii Korotkov <[email protected]>
…y a direct object update (argoproj#20875) Fixes argoproj#20875 Some systems like Kargo update the application operation directly to initiate a new sync, bypassing the server. However, they can't update the status operation state to become nil, resulting in discrepancy, see akuity/kargo#2985 and the discussion. Handle this case on the app controller side. Let's cherry-pick to v2.13. Signed-off-by: Andrii Korotkov <[email protected]>
I've made it ready for review, working for both live environment and tests. Hope ArgoCD maintainers accept it. |
Checklist
kargo version
.Description
Kargo app updater doesn't clear the
app.Status.OperationState
when setting application operation, seekargo/internal/directives/argocd_updater.go
Lines 476 to 528 in cc293f0
SetAppOperation
https://github.com/argoproj/argo-cd/blob/32cc6638f78e15652c24eb2cd6403e6e7ec26ab0/util/argo/argo.go#L820. This seems to result in ArgoCD UI showing a new sync operation started with details of the old sync for a few seconds, as operation and status are not consistent between each other. There might be deeper consequences like app remaining out of sync.Screenshots
Courtesy of @stephaneetje.
Steps to Reproduce
Change the tag in helm values and trigger an update through Kargo.
Version
Not provided
Logs
Not provided
The text was updated successfully, but these errors were encountered: