diff --git a/.travis.yml b/.travis.yml index 42ad2b9482..1be75dca4c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,7 +54,7 @@ install: before_script: - "${PULUMI_SCRIPTS}/ci/ensure-dependencies" script: - - travis_wait 30 make travis_${TRAVIS_EVENT_TYPE} + - travis_wait 60 make travis_${TRAVIS_EVENT_TYPE} after_failure: - "${PULUMI_SCRIPTS}/ci/upload-failed-tests" notifications: diff --git a/pkg/await/apps_deployment.go b/pkg/await/apps_deployment.go index 965adb9586..4463f216c0 100644 --- a/pkg/await/apps_deployment.go +++ b/pkg/await/apps_deployment.go @@ -3,7 +3,6 @@ package await import ( "fmt" "reflect" - "strings" "time" "github.com/golang/glog" @@ -459,7 +458,7 @@ func (dia *deploymentInitAwaiter) checkReplicaSetStatus() { // we would now have fewer replicas than we had requested in the `Deployment` we last submitted // when we last ran `pulumi up`. rawSpecReplicas, specReplicasExists := openapi.Pluck(rs.Object, "spec", "replicas") - specReplicas, _ := rawSpecReplicas.(float64) + specReplicas, _ := rawSpecReplicas.(int64) if !specReplicasExists { specReplicas = 1 } @@ -505,8 +504,6 @@ func (dia *deploymentInitAwaiter) changeTriggeredRollout() bool { } func (dia *deploymentInitAwaiter) processPodEvent(event watch.Event) { - inputDeploymentName := dia.config.currentInputs.GetName() - pod, isUnstructured := event.Object.(*unstructured.Unstructured) if !isUnstructured { glog.V(3).Infof("Pod watch received unknown object type '%s'", @@ -515,10 +512,11 @@ func (dia *deploymentInitAwaiter) processPodEvent(event watch.Event) { } // Check whether this Pod was created by our Deployment. - podName := pod.GetName() - if !strings.HasPrefix(podName+"-", inputDeploymentName) { + currentReplicaSet := dia.replicaSets[dia.currentGeneration] + if !isOwnedBy(pod, currentReplicaSet) { return } + podName := pod.GetName() // If Pod was deleted, remove it from our aggregated checkers. if event.Type == watch.Deleted { @@ -653,6 +651,10 @@ func canonicalizeDeploymentAPIVersion(ver string) string { } func isOwnedBy(obj, possibleOwner *unstructured.Unstructured) bool { + if possibleOwner == nil { + return false + } + var possibleOwnerAPIVersion string // Canonicalize apiVersion for Deployments. diff --git a/pkg/await/apps_deployment_test.go b/pkg/await/apps_deployment_test.go index a711d1e355..35d0e830c3 100644 --- a/pkg/await/apps_deployment_test.go +++ b/pkg/await/apps_deployment_test.go @@ -486,7 +486,7 @@ func Test_Apps_Deployment(t *testing.T) { // Failed Pod should show up in the errors. pods <- watchAddedEvent(deployedFailedPod(inputNamespace, readyPodName, replicaSetGeneratedName)) - // // Unrelated successful Pod should generate no errors. + // Unrelated successful Pod should generate no errors. pods <- watchAddedEvent(deployedReadyPod(inputNamespace, readyPodName, "bar")) // Timeout. Failure. @@ -496,6 +496,7 @@ func Test_Apps_Deployment(t *testing.T) { object: deploymentProgressing(inputNamespace, deploymentInputName, revision1), subErrors: []string{ "Minimum number of live Pods was not attained", + `1 Pods failed to run because: [ImagePullBackOff] Back-off pulling image "sdkjlsdlkj"`, }}, }, { @@ -511,7 +512,7 @@ func Test_Apps_Deployment(t *testing.T) { // Failed Pod should show up in the errors. pods <- watchAddedEvent(deployedFailedPod(inputNamespace, readyPodName, replicaSetGeneratedName)) - // // Unrelated successful Pod should generate no errors. + // Unrelated successful Pod should generate no errors. pods <- watchAddedEvent(deployedReadyPod(inputNamespace, readyPodName, "bar")) // Timeout. Failure. @@ -521,6 +522,7 @@ func Test_Apps_Deployment(t *testing.T) { object: deploymentProgressing(inputNamespace, deploymentInputName, revision2), subErrors: []string{ "Minimum number of live Pods was not attained", + `1 Pods failed to run because: [ImagePullBackOff] Back-off pulling image "sdkjlsdlkj"`, }}, }, {