Commit 3ac4762d authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #53673 from timothysc/downward_hostip_e2e

Automatic merge from submit-queue (batch tested with PRs 53678, 53677, 53682, 53673). 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>. Fix to prevent downward api change break on older versions Signed-off-by: 's avatarTimothy St. Clair <timothysc@gmail.com> **What this PR does / why we need it**: Prevents "should provide pod and host IP as an env var [Conformance]" from running on older versions whose api does not have that field and will break on those clusters. This is not a upstream tested configuration, but downstream folks do this regularly. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: N/A **Special notes for your reviewer**: N/A **Release note**: ``` Prevent downward api-change from breaking on older version ``` /cc @kubernetes/sig-testing-bugs @jpbetz @marun
parents f3b6fb7a db7cb5f7
...@@ -41,6 +41,7 @@ go_library( ...@@ -41,6 +41,7 @@ go_library(
"//pkg/kubelet:go_default_library", "//pkg/kubelet:go_default_library",
"//pkg/kubelet/sysctl:go_default_library", "//pkg/kubelet/sysctl:go_default_library",
"//pkg/security/apparmor:go_default_library", "//pkg/security/apparmor:go_default_library",
"//pkg/util/version:go_default_library",
"//test/e2e/framework:go_default_library", "//test/e2e/framework:go_default_library",
"//test/utils:go_default_library", "//test/utils:go_default_library",
"//test/utils/image:go_default_library", "//test/utils/image:go_default_library",
......
...@@ -23,11 +23,14 @@ import ( ...@@ -23,11 +23,14 @@ import (
"k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/uuid" "k8s.io/apimachinery/pkg/util/uuid"
utilversion "k8s.io/kubernetes/pkg/util/version"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
) )
var hostIPVersion = utilversion.MustParseSemantic("v1.8.0")
var _ = framework.KubeDescribe("Downward API", func() { var _ = framework.KubeDescribe("Downward API", func() {
f := framework.NewDefaultFramework("downward-api") f := framework.NewDefaultFramework("downward-api")
...@@ -63,6 +66,7 @@ var _ = framework.KubeDescribe("Downward API", func() { ...@@ -63,6 +66,7 @@ var _ = framework.KubeDescribe("Downward API", func() {
}) })
It("should provide pod and host IP as an env var [Conformance]", func() { It("should provide pod and host IP as an env var [Conformance]", func() {
framework.SkipUnlessServerVersionGTE(hostIPVersion, f.ClientSet.Discovery())
podName := "downward-api-" + string(uuid.NewUUID()) podName := "downward-api-" + string(uuid.NewUUID())
env := []v1.EnvVar{ env := []v1.EnvVar{
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment