|
|
|
@ -27,6 +27,7 @@ import (
|
|
|
|
|
batchv1 "k8s.io/api/batch/v1"
|
|
|
|
|
corev1 "k8s.io/api/core/v1"
|
|
|
|
|
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
|
|
|
|
|
networkingv1beta1 "k8s.io/api/networking/v1beta1"
|
|
|
|
|
apiextv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
|
|
|
|
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
|
|
|
"k8s.io/apimachinery/pkg/labels"
|
|
|
|
@ -175,6 +176,14 @@ func (w *waiter) waitForResources(created ResourceList) error {
|
|
|
|
|
if !w.statefulSetReady(sts) {
|
|
|
|
|
return false, nil
|
|
|
|
|
}
|
|
|
|
|
case *extensionsv1beta1.Ingress, *networkingv1beta1.Ingress:
|
|
|
|
|
ing, err := w.c.NetworkingV1beta1().Ingresses(v.Namespace).Get(v.Name, metav1.GetOptions{})
|
|
|
|
|
if err != nil {
|
|
|
|
|
return false, err
|
|
|
|
|
}
|
|
|
|
|
if !w.ingressReady(ing) {
|
|
|
|
|
return false, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case *corev1.ReplicationController:
|
|
|
|
|
ok, err = w.podsReadyForObject(value.Namespace, value)
|
|
|
|
@ -345,6 +354,14 @@ func (w *waiter) statefulSetReady(sts *appsv1.StatefulSet) bool {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (w *waiter) ingressReady(ing *networkingv1beta1.Ingress) bool {
|
|
|
|
|
if len(ing.Status.LoadBalancer.Ingress) == 0 {
|
|
|
|
|
w.log("Ingress is not ready: %s/%s", ing.GetNamespace(), ing.GetName())
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func getPods(client kubernetes.Interface, namespace, selector string) ([]corev1.Pod, error) {
|
|
|
|
|
list, err := client.CoreV1().Pods(namespace).List(metav1.ListOptions{
|
|
|
|
|
LabelSelector: selector,
|
|
|
|
|