Skip to content

Commit

Permalink
Merge pull request #32919 from janetkuo/1.3-skip-rollingupdate-old-ku…
Browse files Browse the repository at this point in the history
…bectl

Automatic merge from submit-queue

Skip kubectl rolling-update test for client older than 1.4

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

**What this PR does / why we need it**: Fixing upgrade test kubernetes-e2e-gke-1.4-1.3-gci-kubectl-skew 

Supersedes #32890; garbage collector was introduced in 1.4 which breaks kubectl rolling-update with kubectl <1.4; skip this in 1.3 test to make it passing kubernetes-e2e-gke-1.4-1.3-gci-kubectl-skew 

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

**Special notes for your reviewer**:

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
```

Garbage collector was introduced in v1.4, which caused kubectl rolling-update
with kubectl version < 1.4 to fail. This is cherrypicked into 1.3 merely for
fixing test failures on kubernetes-e2e-gke-1.4-1.3-gci-kubectl-skew
  • Loading branch information
Kubernetes Submit Queue authored Sep 17, 2016
2 parents c1aa524 + eae9c18 commit 2b61827
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/e2e/framework/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -1571,6 +1571,16 @@ func ServerVersionGTE(v semver.Version, c discovery.ServerVersionInterface) (boo
return sv.GTE(v), nil
}

func SkipUnlessKubectlVersionGTE(v semver.Version) {
gte, err := KubectlVersionGTE(v)
if err != nil {
Failf("Failed to get kubectl version: %v", err)
}
if !gte {
Skipf("Not supported for kubectl versions before %q", v)
}
}

// KubectlVersionGTE returns true if the kubectl version is greater than or
// equal to v.
func KubectlVersionGTE(v semver.Version) (bool, error) {
Expand Down
6 changes: 6 additions & 0 deletions test/e2e/kubectl.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ var (
//
// TODO(ihmccreery): remove once we don't care about v1.1 anymore, (tentatively in v1.4).
podProbeParametersVersion = version.MustParse("v1.2.0-alpha.4")

// Garbage collector was introduced in v1.4.0 and breaks kubectl rolling-update older than
// v1.4.0. We don't expect older kubectl to work on v1.4 cluster. See
// https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG.md#kubectl-rolling-update
kubectlRollingUpdateVersion = version.MustParse("v1.4.0")
)

// Stops everything from filePath from namespace ns and checks if everything matching selectors from the given namespace is correctly stopped.
Expand Down Expand Up @@ -934,6 +939,7 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
})

It("should support rolling-update to same image [Conformance]", func() {
framework.SkipUnlessKubectlVersionGTE(kubectlRollingUpdateVersion)
By("running the image " + nginxImage)
framework.RunKubectlOrDie("run", rcName, "--image="+nginxImage, "--generator=run/v1", nsFlag)
By("verifying the rc " + rcName + " was created")
Expand Down

0 comments on commit 2b61827

Please sign in to comment.