Always test PDB's during service upgrade test

OpenShift has been running this tests on various platform for several
years now without any problems.
This commit is contained in:
Maciej Szulik 2024-02-15 12:35:10 +01:00
parent 109491f3cb
commit ec7e051bc0
No known key found for this signature in database
GPG Key ID: F15E55D276FA84C4

View File

@ -41,8 +41,6 @@ type ServiceUpgradeTest struct {
// Name returns the tracking name of the test. // Name returns the tracking name of the test.
func (ServiceUpgradeTest) Name() string { return "service-upgrade" } func (ServiceUpgradeTest) Name() string { return "service-upgrade" }
func shouldTestPDBs() bool { return framework.ProviderIs("gce", "gke") }
// Setup creates a service with a load balancer and makes sure it's reachable. // Setup creates a service with a load balancer and makes sure it's reachable.
func (t *ServiceUpgradeTest) Setup(ctx context.Context, f *framework.Framework) { func (t *ServiceUpgradeTest) Setup(ctx context.Context, f *framework.Framework) {
serviceName := "service-test" serviceName := "service-test"
@ -67,11 +65,9 @@ func (t *ServiceUpgradeTest) Setup(ctx context.Context, f *framework.Framework)
rc, err := jig.Run(ctx, jig.AddRCAntiAffinity) rc, err := jig.Run(ctx, jig.AddRCAntiAffinity)
framework.ExpectNoError(err) framework.ExpectNoError(err)
if shouldTestPDBs() { ginkgo.By("creating a PodDisruptionBudget to cover the ReplicationController")
ginkgo.By("creating a PodDisruptionBudget to cover the ReplicationController") _, err = jig.CreatePDB(ctx, rc)
_, err = jig.CreatePDB(ctx, rc) framework.ExpectNoError(err)
framework.ExpectNoError(err)
}
// Hit it once before considering ourselves ready // Hit it once before considering ourselves ready
ginkgo.By("hitting the pod through the service's LoadBalancer") ginkgo.By("hitting the pod through the service's LoadBalancer")
@ -93,8 +89,7 @@ func (t *ServiceUpgradeTest) Test(ctx context.Context, f *framework.Framework, d
case upgrades.MasterUpgrade, upgrades.ClusterUpgrade: case upgrades.MasterUpgrade, upgrades.ClusterUpgrade:
t.test(ctx, f, done, true, true) t.test(ctx, f, done, true, true)
case upgrades.NodeUpgrade: case upgrades.NodeUpgrade:
// Node upgrades should test during disruption only on GCE/GKE for now. t.test(ctx, f, done, true, false)
t.test(ctx, f, done, shouldTestPDBs(), false)
default: default:
t.test(ctx, f, done, false, false) t.test(ctx, f, done, false, false)
} }