ensure user has custom access before testing
@@ -3,10 +3,13 @@ package builds
import (
"fmt"
"strings"
+ "time"
g "github.com/onsi/ginkgo"
o "github.com/onsi/gomega"
+ "k8s.io/apimachinery/pkg/util/wait"
+
exutil "github.com/openshift/origin/test/extended/util"
)
@@ -73,6 +76,15 @@ var _ = g.Describe("[Feature:Builds] forcePull should affect pulling builder ima
err := oc.AsAdmin().Run("create").Args("clusterrolebinding", binding, "--clusterrole", "system:build-strategy-custom", "--user", oc.Username()).Execute()
o.Expect(err).NotTo(o.HaveOccurred())
+ err = wait.PollImmediate(time.Second, time.Minute, func() (bool, error) {
+ err := oc.Run("auth").Args("can-i", "--all-namespaces", "--quiet", "create", "builds.build.openshift.io", "--subresource=custom").Execute()
+ if err != nil {
+ return false, nil
+ }
+ return true, nil
+ })
+ o.Expect(err).NotTo(o.HaveOccurred())
+
g.By("waiting for openshift/ruby:latest ImageStreamTag")
err = exutil.WaitForAnImageStreamTag(oc, "openshift", "ruby", "latest")
o.Expect(err).NotTo(o.HaveOccurred())
