Skip to content

Commit

Permalink
Merge pull request kubernetes#53080 from jennybuckley/podpresets-test…
Browse files Browse the repository at this point in the history
…-skip

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Skip podpreset test if the alpha feature setttings/v1alpha1 is disabled

**What this PR does / why we need it**: Skip this test if it is not able to find the requested resource, so the test does not consistently fail.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes kubernetes#53079

**Special notes for your reviewer**:

**Release note**:

```release-note
Skip podpreset test if the alpha feature setttings/v1alpha1 is disabled
```
  • Loading branch information
Kubernetes Submit Queue authored Oct 11, 2017
2 parents a69e6fb + 653fbac commit 49b4a51
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/e2e/servicecatalog/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ go_library(
"//vendor/github.com/onsi/gomega:go_default_library",
"//vendor/k8s.io/api/core/v1:go_default_library",
"//vendor/k8s.io/api/settings/v1alpha1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/labels:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/watch:go_default_library",
Expand Down
7 changes: 7 additions & 0 deletions test/e2e/servicecatalog/podpreset.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (

"k8s.io/api/core/v1"
settings "k8s.io/api/settings/v1alpha1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/watch"
Expand Down Expand Up @@ -73,6 +74,9 @@ var _ = SIGDescribe("[Feature:PodPreset] PodPreset", func() {
}

_, err := createPodPreset(f.ClientSet, f.Namespace.Name, pip)
if errors.IsNotFound(err) {
framework.Skipf("podpresets requires k8s.io/api/settings/v1alpha1 to be enabled")
}
Expect(err).NotTo(HaveOccurred())

By("creating the pod")
Expand Down Expand Up @@ -178,6 +182,9 @@ var _ = SIGDescribe("[Feature:PodPreset] PodPreset", func() {
}

_, err := createPodPreset(f.ClientSet, f.Namespace.Name, pip)
if errors.IsNotFound(err) {
framework.Skipf("podpresets requires k8s.io/api/settings/v1alpha1 to be enabled")
}
Expect(err).NotTo(HaveOccurred())

By("creating the pod")
Expand Down

0 comments on commit 49b4a51

Please sign in to comment.