We have a use case where we want to create a DaemonSet and wait for its replicas to be ready before moving forward with the rest of the work. I was trying to use the kstatus/status library to do that. I thought I would apply the DaemonSet and then continuously check the result returned by status.Compute().
However, immediately after applying the DaemonSet, the status.Compute() method returns a Current result seemingly because the status is: status:map[currentNumberScheduled:0 desiredNumberScheduled:0 numberMisscheduled:0 numberReady:0]]}
Is this expected? Should we add an exception case to return an InProgress result when desiredNumberScheduled == 0?
Maybe we can use status.desiredNumberScheduled == 0 && status.observedGeneration == 0 as a signal that DaemonSet controller hasn't acted on the manifest?
We have a use case where we want to create a DaemonSet and wait for its replicas to be ready before moving forward with the rest of the work. I was trying to use the
kstatus/status
library to do that. I thought I would apply the DaemonSet and then continuously check the result returned bystatus.Compute()
.However, immediately after applying the DaemonSet, the
status.Compute()
method returns aCurrent
result seemingly because the status is:status:map[currentNumberScheduled:0 desiredNumberScheduled:0 numberMisscheduled:0 numberReady:0]]}
Is this expected? Should we add an exception case to return an
InProgress
result whendesiredNumberScheduled == 0
?Here's the code I was using:
Here's the output of the run:
Because I had a "bad" DaemonSet that didn't start, if I run the program again, it worked correctly: