Skip to content

Commit

Permalink
extended: debug failed tag update
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmichalis committed Aug 26, 2016
1 parent a910aa8 commit b7e3d89
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
18 changes: 16 additions & 2 deletions test/extended/deployments/deployments.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
o "github.com/onsi/gomega"

kapi "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/errors"
"k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/util/wait"
e2e "k8s.io/kubernetes/test/e2e/framework"
Expand Down Expand Up @@ -260,8 +261,21 @@ var _ = g.Describe("deploymentconfigs", func() {
o.Expect(waitForLatestCondition(oc, name, deploymentRunTimeout, deploymentReachedCompletion)).NotTo(o.HaveOccurred())

g.By("verifying the post deployment action happened: tag is set")
out, err := oc.Run("get").Args("istag/sample-stream:deployed").Output()
o.Expect(err).NotTo(o.HaveOccurred())
var out string
pollErr := wait.PollImmediate(100*time.Millisecond, 10*time.Second, func() (bool, error) {
out, err = oc.Run("get").Args("istag/sample-stream:deployed").Output()
if errors.IsNotFound(err) {
return false, nil
}
if err != nil {
return false, err
}
return true, nil
})
if pollErr == wait.ErrWaitTimeout {
pollErr = err
}
o.Expect(pollErr).NotTo(o.HaveOccurred())

if !strings.Contains(out, "origin-pod") {
err = fmt.Errorf("expected %q to be part of the image reference in %q", "origin-pod", out)
Expand Down
2 changes: 1 addition & 1 deletion test/extended/testdata/tag-images-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
recreateParams:
timeoutSeconds: 20
post:
failurePolicy: Ignore
failurePolicy: Abort
tagImages:
- containerName: sample-name
to:
Expand Down

0 comments on commit b7e3d89

Please sign in to comment.