mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 18:00:08 +00:00
Ensure request returns current server version
This commit is contained in:
parent
f38ce5725a
commit
2eabf97a58
@ -21,6 +21,7 @@ go_library(
|
|||||||
"framework.go",
|
"framework.go",
|
||||||
"garbage_collector.go",
|
"garbage_collector.go",
|
||||||
"generated_clientset.go",
|
"generated_clientset.go",
|
||||||
|
"get_code_version.go",
|
||||||
"namespace.go",
|
"namespace.go",
|
||||||
"protocol.go",
|
"protocol.go",
|
||||||
"resource_quota.go",
|
"resource_quota.go",
|
||||||
|
44
test/e2e/apimachinery/get_code_version.go
Normal file
44
test/e2e/apimachinery/get_code_version.go
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2019 The Kubernetes Authors.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package apimachinery
|
||||||
|
|
||||||
|
import (
|
||||||
|
"k8s.io/apimachinery/pkg/version"
|
||||||
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
|
|
||||||
|
"github.com/onsi/ginkgo"
|
||||||
|
)
|
||||||
|
|
||||||
|
var _ = SIGDescribe("get-code-version", func() {
|
||||||
|
f := framework.NewDefaultFramework("get-code-version")
|
||||||
|
ginkgo.It("should find the server version", func() {
|
||||||
|
|
||||||
|
ginkgo.By("Request ServerVersion")
|
||||||
|
|
||||||
|
var version *version.Info
|
||||||
|
version, err := f.ClientSet.Discovery().ServerVersion()
|
||||||
|
framework.ExpectNoError(err, "Fail to access ServerVersion")
|
||||||
|
|
||||||
|
ginkgo.By("Confirm major version")
|
||||||
|
framework.ExpectEqual(version.Major, "1", "unable to find major version")
|
||||||
|
framework.Logf("Major version: %v", version.Major)
|
||||||
|
|
||||||
|
ginkgo.By("Confirm minor version")
|
||||||
|
framework.ExpectEqual(version.Minor, "19+", "unable to find minor version")
|
||||||
|
framework.Logf("Minor version: %v", version.Minor)
|
||||||
|
})
|
||||||
|
})
|
Loading…
Reference in New Issue
Block a user