addressing comment

Signed-off-by: Stefan McShane <stefanmcshane@users.noreply.github.com>
pull/10920/head
Stefan McShane 2 years ago
parent dcd54d59e6
commit 1a3e9a95dd

@ -89,6 +89,13 @@ type ReadyChecker struct {
// IsReady will fetch the latest state of the object from the server prior to // IsReady will fetch the latest state of the object from the server prior to
// performing readiness checks, and it will return any error encountered. // performing readiness checks, and it will return any error encountered.
func (c *ReadyChecker) IsReady(ctx context.Context, v *resource.Info) (bool, error) { func (c *ReadyChecker) IsReady(ctx context.Context, v *resource.Info) (bool, error) {
var (
// This defaults to true, otherwise we get to a point where
// things will always return false unless one of the objects
// that manages pods has been hit
ok = true
err error
)
switch value := AsVersioned(v).(type) { switch value := AsVersioned(v).(type) {
case *corev1.Pod: case *corev1.Pod:
pod, err := c.client.CoreV1().Pods(v.Namespace).Get(ctx, v.Name, metav1.GetOptions{}) pod, err := c.client.CoreV1().Pods(v.Namespace).Get(ctx, v.Name, metav1.GetOptions{})
@ -394,7 +401,7 @@ func (c *ReadyChecker) statefulSetReady(sts *appsv1.StatefulSet) bool {
// Dereference all the pointers because StatefulSets like them // Dereference all the pointers because StatefulSets like them
var partition int var partition int
// 1 is the default for replicas if not set // 1 is the default for replicas if not set
var replicas = 1 replicas := 1
// For some reason, even if the update strategy is a rolling update, the // For some reason, even if the update strategy is a rolling update, the
// actual rollingUpdate field can be nil. If it is, we can safely assume // actual rollingUpdate field can be nil. If it is, we can safely assume
// there is no partition value // there is no partition value

Loading…
Cancel
Save