Skip to content

Commit 2eabf97

Browse files
committed
Ensure request returns current server version
1 parent f38ce57 commit 2eabf97

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

test/e2e/apimachinery/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ go_library(
2121
"framework.go",
2222
"garbage_collector.go",
2323
"generated_clientset.go",
24+
"get_code_version.go",
2425
"namespace.go",
2526
"protocol.go",
2627
"resource_quota.go",
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
Copyright 2019 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package apimachinery
18+
19+
import (
20+
"k8s.io/apimachinery/pkg/version"
21+
"k8s.io/kubernetes/test/e2e/framework"
22+
23+
"github.com/onsi/ginkgo"
24+
)
25+
26+
var _ = SIGDescribe("get-code-version", func() {
27+
f := framework.NewDefaultFramework("get-code-version")
28+
ginkgo.It("should find the server version", func() {
29+
30+
ginkgo.By("Request ServerVersion")
31+
32+
var version *version.Info
33+
version, err := f.ClientSet.Discovery().ServerVersion()
34+
framework.ExpectNoError(err, "Fail to access ServerVersion")
35+
36+
ginkgo.By("Confirm major version")
37+
framework.ExpectEqual(version.Major, "1", "unable to find major version")
38+
framework.Logf("Major version: %v", version.Major)
39+
40+
ginkgo.By("Confirm minor version")
41+
framework.ExpectEqual(version.Minor, "19+", "unable to find minor version")
42+
framework.Logf("Minor version: %v", version.Minor)
43+
})
44+
})

0 commit comments

Comments
 (0)