mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 02:41:25 +00:00
Split upgrade tests into sig-owned directories
This commit is contained in:
parent
3b5d809eed
commit
7ac0711af4
24
test/e2e/cloud/gcp/apps/framework.go
Normal file
24
test/e2e/cloud/gcp/apps/framework.go
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2021 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 apps
|
||||||
|
|
||||||
|
import "github.com/onsi/ginkgo"
|
||||||
|
|
||||||
|
// SIGDescribe annotates the test with the SIG label.
|
||||||
|
func SIGDescribe(text string, body func()) bool {
|
||||||
|
return ginkgo.Describe("[sig-apps] "+text, body)
|
||||||
|
}
|
51
test/e2e/cloud/gcp/apps/stateful_apps.go
Normal file
51
test/e2e/cloud/gcp/apps/stateful_apps.go
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2021 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 apps
|
||||||
|
|
||||||
|
import (
|
||||||
|
"k8s.io/kubernetes/test/e2e/cloud/gcp/common"
|
||||||
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
|
"k8s.io/kubernetes/test/e2e/upgrades"
|
||||||
|
"k8s.io/kubernetes/test/e2e/upgrades/apps"
|
||||||
|
"k8s.io/kubernetes/test/utils/junit"
|
||||||
|
|
||||||
|
"github.com/onsi/ginkgo"
|
||||||
|
)
|
||||||
|
|
||||||
|
var upgradeTests = []upgrades.Test{
|
||||||
|
&apps.MySQLUpgradeTest{},
|
||||||
|
&apps.EtcdUpgradeTest{},
|
||||||
|
&apps.CassandraUpgradeTest{},
|
||||||
|
}
|
||||||
|
|
||||||
|
var _ = SIGDescribe("stateful Upgrade [Feature:StatefulUpgrade]", func() {
|
||||||
|
f := framework.NewDefaultFramework("stateful-upgrade")
|
||||||
|
|
||||||
|
ginkgo.Describe("stateful upgrade", func() {
|
||||||
|
ginkgo.It("should maintain a functioning cluster", func() {
|
||||||
|
upgCtx, err := common.GetUpgradeContext(f.ClientSet.Discovery())
|
||||||
|
framework.ExpectNoError(err)
|
||||||
|
|
||||||
|
testSuite := &junit.TestSuite{Name: "Stateful upgrade"}
|
||||||
|
statefulUpgradeTest := &junit.TestCase{Name: "[sig-apps] stateful-upgrade", Classname: "upgrade_tests"}
|
||||||
|
testSuite.TestCases = append(testSuite.TestCases, statefulUpgradeTest)
|
||||||
|
|
||||||
|
upgradeFunc := common.ClusterUpgradeFunc(f, upgCtx, statefulUpgradeTest, nil, nil)
|
||||||
|
upgrades.RunUpgradeSuite(upgCtx, upgradeTests, testSuite, upgrades.ClusterUpgrade, upgradeFunc)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
24
test/e2e/cloud/gcp/auth/framework.go
Normal file
24
test/e2e/cloud/gcp/auth/framework.go
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2021 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 auth
|
||||||
|
|
||||||
|
import "github.com/onsi/ginkgo"
|
||||||
|
|
||||||
|
// SIGDescribe annotates the test with the SIG label.
|
||||||
|
func SIGDescribe(text string, body func()) bool {
|
||||||
|
return ginkgo.Describe("[sig-auth] "+text, body)
|
||||||
|
}
|
@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2021 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 auth
|
||||||
|
|
||||||
|
import (
|
||||||
|
"k8s.io/kubernetes/test/e2e/cloud/gcp/common"
|
||||||
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
|
"k8s.io/kubernetes/test/e2e/upgrades"
|
||||||
|
"k8s.io/kubernetes/test/e2e/upgrades/auth"
|
||||||
|
"k8s.io/kubernetes/test/utils/junit"
|
||||||
|
|
||||||
|
"github.com/onsi/ginkgo"
|
||||||
|
)
|
||||||
|
|
||||||
|
var upgradeTests = []upgrades.Test{
|
||||||
|
&auth.ServiceAccountAdmissionControllerMigrationTest{},
|
||||||
|
}
|
||||||
|
|
||||||
|
var _ = SIGDescribe("ServiceAccount admission controller migration [Feature:BoundServiceAccountTokenVolume]", func() {
|
||||||
|
f := framework.NewDefaultFramework("serviceaccount-admission-controller-migration")
|
||||||
|
|
||||||
|
ginkgo.Describe("master upgrade", func() {
|
||||||
|
ginkgo.It("should maintain a functioning cluster", func() {
|
||||||
|
upgCtx, err := common.GetUpgradeContext(f.ClientSet.Discovery())
|
||||||
|
framework.ExpectNoError(err)
|
||||||
|
|
||||||
|
testSuite := &junit.TestSuite{Name: "ServiceAccount admission controller migration"}
|
||||||
|
serviceaccountAdmissionControllerMigrationTest := &junit.TestCase{
|
||||||
|
Name: "[sig-auth] serviceaccount-admission-controller-migration",
|
||||||
|
Classname: "upgrade_tests",
|
||||||
|
}
|
||||||
|
testSuite.TestCases = append(testSuite.TestCases, serviceaccountAdmissionControllerMigrationTest)
|
||||||
|
|
||||||
|
extraEnvs := []string{"KUBE_FEATURE_GATES=BoundServiceAccountTokenVolume=true"}
|
||||||
|
upgradeFunc := common.ControlPlaneUpgradeFunc(f, upgCtx, serviceaccountAdmissionControllerMigrationTest, extraEnvs)
|
||||||
|
upgrades.RunUpgradeSuite(upgCtx, upgradeTests, testSuite, upgrades.MasterUpgrade, upgradeFunc)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
@ -17,14 +17,10 @@ limitations under the License.
|
|||||||
package gcp
|
package gcp
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"k8s.io/kubernetes/test/e2e/cloud/gcp/common"
|
"k8s.io/kubernetes/test/e2e/cloud/gcp/common"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
|
||||||
"k8s.io/kubernetes/test/e2e/upgrades"
|
"k8s.io/kubernetes/test/e2e/upgrades"
|
||||||
"k8s.io/kubernetes/test/e2e/upgrades/apps"
|
"k8s.io/kubernetes/test/e2e/upgrades/apps"
|
||||||
"k8s.io/kubernetes/test/e2e/upgrades/auth"
|
|
||||||
"k8s.io/kubernetes/test/e2e/upgrades/autoscaling"
|
"k8s.io/kubernetes/test/e2e/upgrades/autoscaling"
|
||||||
"k8s.io/kubernetes/test/e2e/upgrades/network"
|
"k8s.io/kubernetes/test/e2e/upgrades/network"
|
||||||
"k8s.io/kubernetes/test/e2e/upgrades/node"
|
"k8s.io/kubernetes/test/e2e/upgrades/node"
|
||||||
@ -34,47 +30,25 @@ import (
|
|||||||
"github.com/onsi/ginkgo"
|
"github.com/onsi/ginkgo"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// TODO: Those tests should be splitted by SIG and moved to SIG-owned directories,
|
||||||
|
// however that involves also splitting the actual upgrade jobs too.
|
||||||
|
// Figure out the eventual solution for it.
|
||||||
var upgradeTests = []upgrades.Test{
|
var upgradeTests = []upgrades.Test{
|
||||||
&network.ServiceUpgradeTest{},
|
&apps.DaemonSetUpgradeTest{},
|
||||||
&node.SecretUpgradeTest{},
|
|
||||||
&apps.ReplicaSetUpgradeTest{},
|
|
||||||
&apps.StatefulSetUpgradeTest{},
|
|
||||||
&apps.DeploymentUpgradeTest{},
|
&apps.DeploymentUpgradeTest{},
|
||||||
&apps.JobUpgradeTest{},
|
&apps.JobUpgradeTest{},
|
||||||
&node.ConfigMapUpgradeTest{},
|
&apps.ReplicaSetUpgradeTest{},
|
||||||
|
&apps.StatefulSetUpgradeTest{},
|
||||||
&autoscaling.HPAUpgradeTest{},
|
&autoscaling.HPAUpgradeTest{},
|
||||||
&storage.PersistentVolumeUpgradeTest{},
|
&network.ServiceUpgradeTest{},
|
||||||
&apps.DaemonSetUpgradeTest{},
|
|
||||||
&node.AppArmorUpgradeTest{},
|
&node.AppArmorUpgradeTest{},
|
||||||
|
&node.ConfigMapUpgradeTest{},
|
||||||
|
&node.SecretUpgradeTest{},
|
||||||
|
&storage.PersistentVolumeUpgradeTest{},
|
||||||
&storage.VolumeModeDowngradeTest{},
|
&storage.VolumeModeDowngradeTest{},
|
||||||
}
|
}
|
||||||
|
|
||||||
var statefulsetUpgradeTests = []upgrades.Test{
|
var _ = SIGDescribe("Upgrade [Feature:Upgrade]", func() {
|
||||||
&apps.MySQLUpgradeTest{},
|
|
||||||
&apps.EtcdUpgradeTest{},
|
|
||||||
&apps.CassandraUpgradeTest{},
|
|
||||||
}
|
|
||||||
|
|
||||||
var kubeProxyUpgradeTests = []upgrades.Test{
|
|
||||||
&network.KubeProxyUpgradeTest{},
|
|
||||||
&network.ServiceUpgradeTest{},
|
|
||||||
}
|
|
||||||
|
|
||||||
var kubeProxyDowngradeTests = []upgrades.Test{
|
|
||||||
&network.KubeProxyDowngradeTest{},
|
|
||||||
&network.ServiceUpgradeTest{},
|
|
||||||
}
|
|
||||||
|
|
||||||
var serviceaccountAdmissionControllerMigrationTests = []upgrades.Test{
|
|
||||||
&auth.ServiceAccountAdmissionControllerMigrationTest{},
|
|
||||||
}
|
|
||||||
|
|
||||||
func kubeProxyDaemonSetExtraEnvs(enableKubeProxyDaemonSet bool) []string {
|
|
||||||
return []string{fmt.Sprintf("KUBE_PROXY_DAEMONSET=%v", enableKubeProxyDaemonSet)}
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO(#98326): Split the test by SIGs, move to appropriate directories and use SIGDescribe.
|
|
||||||
var _ = ginkgo.Describe("Upgrade [Feature:Upgrade]", func() {
|
|
||||||
f := framework.NewDefaultFramework("cluster-upgrade")
|
f := framework.NewDefaultFramework("cluster-upgrade")
|
||||||
|
|
||||||
// Create the frameworks here because we can only create them
|
// Create the frameworks here because we can only create them
|
||||||
@ -111,8 +85,7 @@ var _ = ginkgo.Describe("Upgrade [Feature:Upgrade]", func() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO(#98326): Split the test by SIGs, move to appropriate directories and use SIGDescribe.
|
var _ = SIGDescribe("Downgrade [Feature:Downgrade]", func() {
|
||||||
var _ = ginkgo.Describe("Downgrade [Feature:Downgrade]", func() {
|
|
||||||
f := framework.NewDefaultFramework("cluster-downgrade")
|
f := framework.NewDefaultFramework("cluster-downgrade")
|
||||||
|
|
||||||
ginkgo.Describe("cluster downgrade", func() {
|
ginkgo.Describe("cluster downgrade", func() {
|
||||||
@ -129,90 +102,3 @@ var _ = ginkgo.Describe("Downgrade [Feature:Downgrade]", func() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO(#98326): Move the test to sig-aps dir and use SIGDescribe.
|
|
||||||
var _ = ginkgo.Describe("[sig-apps] stateful Upgrade [Feature:StatefulUpgrade]", func() {
|
|
||||||
f := framework.NewDefaultFramework("stateful-upgrade")
|
|
||||||
|
|
||||||
ginkgo.Describe("stateful upgrade", func() {
|
|
||||||
ginkgo.It("should maintain a functioning cluster", func() {
|
|
||||||
upgCtx, err := common.GetUpgradeContext(f.ClientSet.Discovery())
|
|
||||||
framework.ExpectNoError(err)
|
|
||||||
|
|
||||||
testSuite := &junit.TestSuite{Name: "Stateful upgrade"}
|
|
||||||
statefulUpgradeTest := &junit.TestCase{Name: "[sig-apps] stateful-upgrade", Classname: "upgrade_tests"}
|
|
||||||
testSuite.TestCases = append(testSuite.TestCases, statefulUpgradeTest)
|
|
||||||
|
|
||||||
upgradeFunc := common.ClusterUpgradeFunc(f, upgCtx, statefulUpgradeTest, nil, nil)
|
|
||||||
upgrades.RunUpgradeSuite(upgCtx, statefulsetUpgradeTests, testSuite, upgrades.ClusterUpgrade, upgradeFunc)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
// TODO(#98326): Move the test to sig-network dir and use SIGDescribe.
|
|
||||||
var _ = ginkgo.Describe("kube-proxy migration [Feature:KubeProxyDaemonSetMigration]", func() {
|
|
||||||
f := framework.NewDefaultFramework("kube-proxy-ds-migration")
|
|
||||||
|
|
||||||
ginkgo.BeforeEach(func() {
|
|
||||||
e2eskipper.SkipUnlessProviderIs("gce")
|
|
||||||
})
|
|
||||||
|
|
||||||
ginkgo.Describe("Upgrade kube-proxy from static pods to a DaemonSet", func() {
|
|
||||||
ginkgo.It("should maintain a functioning cluster [Feature:KubeProxyDaemonSetUpgrade]", func() {
|
|
||||||
upgCtx, err := common.GetUpgradeContext(f.ClientSet.Discovery())
|
|
||||||
framework.ExpectNoError(err)
|
|
||||||
|
|
||||||
testSuite := &junit.TestSuite{Name: "kube-proxy upgrade"}
|
|
||||||
kubeProxyUpgradeTest := &junit.TestCase{
|
|
||||||
Name: "kube-proxy-ds-upgrade",
|
|
||||||
Classname: "upgrade_tests",
|
|
||||||
}
|
|
||||||
testSuite.TestCases = append(testSuite.TestCases, kubeProxyUpgradeTest)
|
|
||||||
|
|
||||||
extraEnvs := kubeProxyDaemonSetExtraEnvs(true)
|
|
||||||
upgradeFunc := common.ClusterUpgradeFunc(f, upgCtx, kubeProxyUpgradeTest, extraEnvs, extraEnvs)
|
|
||||||
upgrades.RunUpgradeSuite(upgCtx, kubeProxyUpgradeTests, testSuite, upgrades.ClusterUpgrade, upgradeFunc)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
ginkgo.Describe("Downgrade kube-proxy from a DaemonSet to static pods", func() {
|
|
||||||
ginkgo.It("should maintain a functioning cluster [Feature:KubeProxyDaemonSetDowngrade]", func() {
|
|
||||||
upgCtx, err := common.GetUpgradeContext(f.ClientSet.Discovery())
|
|
||||||
framework.ExpectNoError(err)
|
|
||||||
|
|
||||||
testSuite := &junit.TestSuite{Name: "kube-proxy downgrade"}
|
|
||||||
kubeProxyDowngradeTest := &junit.TestCase{
|
|
||||||
Name: "kube-proxy-ds-downgrade",
|
|
||||||
Classname: "upgrade_tests",
|
|
||||||
}
|
|
||||||
testSuite.TestCases = append(testSuite.TestCases, kubeProxyDowngradeTest)
|
|
||||||
|
|
||||||
extraEnvs := kubeProxyDaemonSetExtraEnvs(false)
|
|
||||||
upgradeFunc := common.ClusterDowngradeFunc(f, upgCtx, kubeProxyDowngradeTest, extraEnvs, extraEnvs)
|
|
||||||
upgrades.RunUpgradeSuite(upgCtx, kubeProxyDowngradeTests, testSuite, upgrades.ClusterUpgrade, upgradeFunc)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
// TODO(#98326): Move the test to sig-auth dir and use SIGDescribe.
|
|
||||||
var _ = ginkgo.Describe("[sig-auth] ServiceAccount admission controller migration [Feature:BoundServiceAccountTokenVolume]", func() {
|
|
||||||
f := framework.NewDefaultFramework("serviceaccount-admission-controller-migration")
|
|
||||||
|
|
||||||
ginkgo.Describe("master upgrade", func() {
|
|
||||||
ginkgo.It("should maintain a functioning cluster", func() {
|
|
||||||
upgCtx, err := common.GetUpgradeContext(f.ClientSet.Discovery())
|
|
||||||
framework.ExpectNoError(err)
|
|
||||||
|
|
||||||
testSuite := &junit.TestSuite{Name: "ServiceAccount admission controller migration"}
|
|
||||||
serviceaccountAdmissionControllerMigrationTest := &junit.TestCase{
|
|
||||||
Name: "[sig-auth] serviceaccount-admission-controller-migration",
|
|
||||||
Classname: "upgrade_tests",
|
|
||||||
}
|
|
||||||
testSuite.TestCases = append(testSuite.TestCases, serviceaccountAdmissionControllerMigrationTest)
|
|
||||||
|
|
||||||
extraEnvs := []string{"KUBE_FEATURE_GATES=BoundServiceAccountTokenVolume=true"}
|
|
||||||
upgradeFunc := common.ControlPlaneUpgradeFunc(f, upgCtx, serviceaccountAdmissionControllerMigrationTest, extraEnvs)
|
|
||||||
upgrades.RunUpgradeSuite(upgCtx, serviceaccountAdmissionControllerMigrationTests, testSuite, upgrades.MasterUpgrade, upgradeFunc)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
@ -18,5 +18,8 @@ package gcp
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
// ensure these packages are scanned by ginkgo for e2e tests
|
// ensure these packages are scanned by ginkgo for e2e tests
|
||||||
|
_ "k8s.io/kubernetes/test/e2e/cloud/gcp/apps"
|
||||||
|
_ "k8s.io/kubernetes/test/e2e/cloud/gcp/auth"
|
||||||
|
_ "k8s.io/kubernetes/test/e2e/cloud/gcp/network"
|
||||||
_ "k8s.io/kubernetes/test/e2e/cloud/gcp/node"
|
_ "k8s.io/kubernetes/test/e2e/cloud/gcp/node"
|
||||||
)
|
)
|
||||||
|
24
test/e2e/cloud/gcp/network/framework.go
Normal file
24
test/e2e/cloud/gcp/network/framework.go
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2021 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 network
|
||||||
|
|
||||||
|
import "github.com/onsi/ginkgo"
|
||||||
|
|
||||||
|
// SIGDescribe annotates the test with the SIG label.
|
||||||
|
func SIGDescribe(text string, body func()) bool {
|
||||||
|
return ginkgo.Describe("[sig-network] "+text, body)
|
||||||
|
}
|
88
test/e2e/cloud/gcp/network/kube_proxy_migration.go
Normal file
88
test/e2e/cloud/gcp/network/kube_proxy_migration.go
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2021 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 network
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"k8s.io/kubernetes/test/e2e/cloud/gcp/common"
|
||||||
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
|
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||||
|
"k8s.io/kubernetes/test/e2e/upgrades"
|
||||||
|
"k8s.io/kubernetes/test/e2e/upgrades/network"
|
||||||
|
"k8s.io/kubernetes/test/utils/junit"
|
||||||
|
|
||||||
|
"github.com/onsi/ginkgo"
|
||||||
|
)
|
||||||
|
|
||||||
|
var upgradeTests = []upgrades.Test{
|
||||||
|
&network.KubeProxyUpgradeTest{},
|
||||||
|
&network.ServiceUpgradeTest{},
|
||||||
|
}
|
||||||
|
|
||||||
|
var downgradeTests = []upgrades.Test{
|
||||||
|
&network.KubeProxyDowngradeTest{},
|
||||||
|
&network.ServiceUpgradeTest{},
|
||||||
|
}
|
||||||
|
|
||||||
|
func kubeProxyDaemonSetExtraEnvs(enableKubeProxyDaemonSet bool) []string {
|
||||||
|
return []string{fmt.Sprintf("KUBE_PROXY_DAEMONSET=%v", enableKubeProxyDaemonSet)}
|
||||||
|
}
|
||||||
|
|
||||||
|
var _ = SIGDescribe("kube-proxy migration [Feature:KubeProxyDaemonSetMigration]", func() {
|
||||||
|
f := framework.NewDefaultFramework("kube-proxy-ds-migration")
|
||||||
|
|
||||||
|
ginkgo.BeforeEach(func() {
|
||||||
|
e2eskipper.SkipUnlessProviderIs("gce")
|
||||||
|
})
|
||||||
|
|
||||||
|
ginkgo.Describe("Upgrade kube-proxy from static pods to a DaemonSet", func() {
|
||||||
|
ginkgo.It("should maintain a functioning cluster [Feature:KubeProxyDaemonSetUpgrade]", func() {
|
||||||
|
upgCtx, err := common.GetUpgradeContext(f.ClientSet.Discovery())
|
||||||
|
framework.ExpectNoError(err)
|
||||||
|
|
||||||
|
testSuite := &junit.TestSuite{Name: "kube-proxy upgrade"}
|
||||||
|
kubeProxyUpgradeTest := &junit.TestCase{
|
||||||
|
Name: "kube-proxy-ds-upgrade",
|
||||||
|
Classname: "upgrade_tests",
|
||||||
|
}
|
||||||
|
testSuite.TestCases = append(testSuite.TestCases, kubeProxyUpgradeTest)
|
||||||
|
|
||||||
|
extraEnvs := kubeProxyDaemonSetExtraEnvs(true)
|
||||||
|
upgradeFunc := common.ClusterUpgradeFunc(f, upgCtx, kubeProxyUpgradeTest, extraEnvs, extraEnvs)
|
||||||
|
upgrades.RunUpgradeSuite(upgCtx, upgradeTests, testSuite, upgrades.ClusterUpgrade, upgradeFunc)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
ginkgo.Describe("Downgrade kube-proxy from a DaemonSet to static pods", func() {
|
||||||
|
ginkgo.It("should maintain a functioning cluster [Feature:KubeProxyDaemonSetDowngrade]", func() {
|
||||||
|
upgCtx, err := common.GetUpgradeContext(f.ClientSet.Discovery())
|
||||||
|
framework.ExpectNoError(err)
|
||||||
|
|
||||||
|
testSuite := &junit.TestSuite{Name: "kube-proxy downgrade"}
|
||||||
|
kubeProxyDowngradeTest := &junit.TestCase{
|
||||||
|
Name: "kube-proxy-ds-downgrade",
|
||||||
|
Classname: "upgrade_tests",
|
||||||
|
}
|
||||||
|
testSuite.TestCases = append(testSuite.TestCases, kubeProxyDowngradeTest)
|
||||||
|
|
||||||
|
extraEnvs := kubeProxyDaemonSetExtraEnvs(false)
|
||||||
|
upgradeFunc := common.ClusterDowngradeFunc(f, upgCtx, kubeProxyDowngradeTest, extraEnvs, extraEnvs)
|
||||||
|
upgrades.RunUpgradeSuite(upgCtx, downgradeTests, testSuite, upgrades.ClusterUpgrade, upgradeFunc)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
Loading…
Reference in New Issue
Block a user