Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure Build ConfigMaps Are Removed #23025

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 10 additions & 4 deletions test/extended/builds/remove_buildconfig.go
Expand Up @@ -6,6 +6,7 @@ import (
g "github.com/onsi/ginkgo"
o "github.com/onsi/gomega"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/wait"

exutil "github.com/openshift/origin/test/extended/util"
Expand Down Expand Up @@ -55,12 +56,17 @@ var _ = g.Describe("[Feature:Builds][Conformance] remove all builds when build c

g.By("waiting for builds to clear")
err = wait.Poll(3*time.Second, 3*time.Minute, func() (bool, error) {
out, err := oc.Run("get").Args("builds").Output()
builds, err := oc.BuildClient().BuildV1().Builds(oc.Namespace()).List(metav1.ListOptions{})
o.Expect(err).NotTo(o.HaveOccurred())
if out == "No resources found." {
return true, nil
if len(builds.Items) > 0 {
return false, nil
}
return false, nil
configMaps, err := oc.KubeClient().CoreV1().ConfigMaps(oc.Namespace()).List(metav1.ListOptions{})
o.Expect(err).NotTo(o.HaveOccurred())
if len(configMaps.Items) > 0 {
return false, nil
}
return true, nil
})
if err == wait.ErrWaitTimeout {
g.Fail("timed out waiting for builds to clear")
Expand Down