Both content/en/docs/how-tos/staged-update.md and content/en/docs/tutorials/ArgoCD/index.md show approval kubectl patch commands with a hardcoded \"observedGeneration\":1:
kubectl patch clusterapprovalrequests <name> --type='merge' \
-p '{"status":{"conditions":[{"type":"Approved","status":"True","reason":"approved","message":"approved","lastTransitionTime":"...","observedGeneration":1}]}}' \
--subresource=status
The observedGeneration in a metav1.Condition must match the actual .metadata.generation of the ApprovalRequest object at the time of patching; hardcoding 1 will cause the approval controller to reject the condition or misinterpret the approval state if the object has been updated.
The examples should retrieve the generation dynamically, for example:
GEN=$(kubectl get clusterapprovalrequest <name> -o jsonpath='{.metadata.generation}')
and substitute $GEN in the patch payload, or use the kubectl fleet approve plugin (which already handles this correctly) as the primary example.
Both
content/en/docs/how-tos/staged-update.mdandcontent/en/docs/tutorials/ArgoCD/index.mdshow approvalkubectl patchcommands with a hardcoded\"observedGeneration\":1:The
observedGenerationin ametav1.Conditionmust match the actual.metadata.generationof the ApprovalRequest object at the time of patching; hardcoding1will cause the approval controller to reject the condition or misinterpret the approval state if the object has been updated.The examples should retrieve the generation dynamically, for example:
GEN=$(kubectl get clusterapprovalrequest <name> -o jsonpath='{.metadata.generation}')and substitute
$GENin the patch payload, or use thekubectl fleet approveplugin (which already handles this correctly) as the primary example.