Skip to content

Commit

Permalink
chore(service create): Tolerate if obeservedGeneration has not been s…
Browse files Browse the repository at this point in the history
…et yet during startup
  • Loading branch information
rhuss committed Jun 9, 2019
1 parent 25571ed commit ae6a3bf
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/wait/wait_for_ready.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,14 @@ func isGivenEqualsObservedGeneration(object runtime.Object) (bool, error) {
if !ok {
return false, fmt.Errorf("cannot extract status from %v", object)
}
givenGeneration, ok := meta["generation"]
observedGeneration, ok := status["observedGeneration"]
if !ok {
return false, fmt.Errorf("no field 'generation' in metadata of %v", object)
// Can be the case if not status has been attached yet
return false, nil
}
observedGeneration, ok := status["observedGeneration"]
givenGeneration, ok := meta["generation"]
if !ok {
return false, fmt.Errorf("no field 'observedGeneration' in status of %v", object)
return false, fmt.Errorf("no field 'generation' in metadata of %v", object)
}
return givenGeneration == observedGeneration, nil
}

0 comments on commit ae6a3bf

Please sign in to comment.