pulumi / pulumi-kubernetes-operator

A Kubernetes Operator that automates the deployment of Pulumi Stacks
Apache License 2.0
221 stars 55 forks source link

Show processing state in printer columns (i.e., in the output of `kubectl get stack`) #396

Open squaremo opened 1 year ago

squaremo commented 1 year ago

It is hard to see from the outside whether a Stack object is responding to changes you've made. For example, whether it has seen, and is running, new code you've committed. At present, only the last state reached is shown; so if it goes from success to success with a new source revision, you won't see any change.

The obvious way to improve this is to use additionalPrinterColumns so that kubectl get stack will show a summary of the state, including when it's processing. The Ready/Reconciling/Stalled conditions give enough info to show what's happening at the time of asking; they may need to be summarised in a new .status field for it to be usable in additionalPrinterColumns.

The revision under processing would also be useful -- in most cases this will be the last attempted revision, but there may need to be work done to ensure this (and .lastSuccessfulCommit) is kept accurate.

State How to calculate it Revision reported
Ready Condition Ready=True .status.lastUpdate.lastSuccessfulCommit
Retrying Condition Reconciling=True, Reason=RetryingAfterFailure .status.lastUpdate.lastAttemptedCommit
Running Condition Reconciling=True, Reason=Processing needs to be set from locals in Reconcile, I think
Stalled Condition Stalled=True .status.lastUpdate.lastAttemptedCommit