@@ -2,7 +2,6 @@ package e2e_test
22
33import (
44 "context"
5- "fmt"
65 "log"
76 "time"
87
@@ -14,7 +13,6 @@ import (
1413 corev1 "k8s.io/api/core/v1"
1514 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1615 "k8s.io/apimachinery/pkg/types"
17- "k8s.io/utils/ptr"
1816 "sigs.k8s.io/controller-runtime/pkg/client"
1917
2018 oadpv1alpha1 "github.com/openshift/oadp-operator/api/v1alpha1"
@@ -89,11 +87,6 @@ var _ = ginkgo.Describe("OADP upgrade scenarios", ginkgo.Ordered, func() {
8987 LogLevel : "debug" ,
9088 DefaultPlugins : dpaCR .VeleroDefaultPlugins ,
9189 },
92- Restic : & oadpv1alpha1.ResticConfig {
93- NodeAgentCommonFields : oadpv1alpha1.NodeAgentCommonFields {
94- Enable : ptr .To (true ),
95- },
96- },
9790 },
9891 BackupLocations : []oadpv1alpha1.BackupLocation {
9992 {
@@ -128,9 +121,7 @@ var _ = ginkgo.Describe("OADP upgrade scenarios", ginkgo.Ordered, func() {
128121 log .Print ("Checking if Velero Pod is running" )
129122 gomega .Eventually (lib .VeleroPodIsRunning (kubernetesClientForSuiteRun , namespace ), time .Minute * 3 , time .Second * 5 ).Should (gomega .BeTrue ())
130123
131- // check that NodeAgent Pods are running
132- log .Printf ("Checking if Node Agent Pods are running" )
133- gomega .Eventually (lib .AreNodeAgentPodsRunning (kubernetesClientForSuiteRun , namespace ), time .Minute * 3 , time .Second * 5 ).Should (gomega .BeTrue ())
124+ // TODO check NodeAgent Pod if using restic or kopia
134125
135126 // check if BSL is available
136127 log .Print ("Checking if BSL is available" )
@@ -142,7 +133,7 @@ var _ = ginkgo.Describe("OADP upgrade scenarios", ginkgo.Ordered, func() {
142133
143134 // TODO backup/restore
144135
145- // Update spec.channel in Subscription to stable
136+ // Update spec.channel in Subscription to dev
146137 log .Print ("Updating Subscription oadp-operator spec.channel" )
147138 err = runTimeClientForSuiteRun .Get (context .Background (), types.NamespacedName {Namespace : subscription .Namespace , Name : subscription .Name }, & subscription )
148139 gomega .Expect (err ).To (gomega .BeNil ())
@@ -161,21 +152,6 @@ var _ = ginkgo.Describe("OADP upgrade scenarios", ginkgo.Ordered, func() {
161152 // check DPA after controller-manager Pod is running
162153 gomega .Eventually (lib .ManagerPodIsUp (kubernetesClientForSuiteRun , namespace ), time .Minute * 8 , time .Second * 15 ).Should (gomega .BeTrue ())
163154
164- // check if updated DPA is reconciled
165- log .Print ("Checking if DPA was reconciled after update" )
166- gomega .Eventually (dpaCR .IsReconciledFalse ("Delete restic object from spec.configuration, use spec.configuration.nodeAgent instead" ), time .Minute * 3 , time .Second * 5 ).Should (gomega .BeTrue ())
167-
168- log .Print ("Updating DPA" )
169- dpaSpec .Configuration .Restic = nil
170- dpaSpec .Configuration .NodeAgent = & oadpv1alpha1.NodeAgentConfig {
171- UploaderType : "restic" ,
172- NodeAgentCommonFields : oadpv1alpha1.NodeAgentCommonFields {
173- Enable : ptr .To (true ),
174- },
175- }
176- err = dpaCR .CreateOrUpdate (dpaSpec )
177- gomega .Expect (err ).To (gomega .BeNil ())
178-
179155 // check if updated DPA is reconciled
180156 log .Print ("Checking if DPA was reconciled after update" )
181157 // TODO do not use Consistently, using because no field in DPA is updated telling when it was last reconciled
@@ -189,37 +165,7 @@ var _ = ginkgo.Describe("OADP upgrade scenarios", ginkgo.Ordered, func() {
189165
190166 timeAfterVeleroIsRunning := time .Now ()
191167
192- // check if updated NodeAgent Pods are running
193- log .Print ("Checking if Node Agent Pods were recreated after update" )
194- gomega .Eventually (func () (bool , error ) {
195- nodeAgentDaemonSet , err := lib .GetNodeAgentDaemonSet (kubernetesClientForSuiteRun , namespace )
196- if err != nil {
197- return false , err
198- }
199-
200- numScheduled := nodeAgentDaemonSet .Status .CurrentNumberScheduled
201- numDesired := nodeAgentDaemonSet .Status .DesiredNumberScheduled
202- // check correct number of NodeAgent Pods are initialized
203- if numScheduled != numDesired {
204- return false , fmt .Errorf ("wrong number of Node Agent Pods" )
205- }
206-
207- podList , err := lib .GetAllPodsWithLabel (kubernetesClientForSuiteRun , namespace , "name=node-agent" )
208- if err != nil {
209- return false , err
210- }
211- if err != nil {
212- return false , err
213- }
214- for _ , pod := range podList .Items {
215- if ! pod .CreationTimestamp .After (timeAfterUpgrade ) {
216- return false , fmt .Errorf ("not all Node Agent Pods were updated" )
217- }
218- }
219- return true , nil
220- }, time .Minute * 3 , time .Second * 5 ).Should (gomega .BeTrue ())
221- log .Printf ("Checking if Node Agent Pods are running" )
222- gomega .Eventually (lib .AreNodeAgentPodsRunning (kubernetesClientForSuiteRun , namespace ), time .Minute * 3 , time .Second * 5 ).Should (gomega .BeTrue ())
168+ // TODO check NodeAgent Pod if using restic or kopia
223169
224170 // check if updated BSL is available
225171 log .Print ("Checking if BSL was reconciled after update" )
@@ -233,9 +179,9 @@ var _ = ginkgo.Describe("OADP upgrade scenarios", ginkgo.Ordered, func() {
233179
234180 // TODO backup/restore
235181 },
236- ginkgo .Entry ("Upgrade from stable-1.4 (oadp-1.4 branch) to stable (master branch) channel" , ginkgo .Label ("upgrade" ), channelUpgradeCase {
237- previous : "stable-1.4 " ,
238- next : "stable " ,
182+ ginkgo .Entry ("Upgrade from stable (oadp-1.5 branch) to dev (master branch) channel" , ginkgo .Label ("upgrade" ), channelUpgradeCase {
183+ previous : "stable" ,
184+ next : "dev " ,
239185 // to test production
240186 // production: true,
241187 }),
0 commit comments