@@ -2,7 +2,6 @@ package e2e_test
2
2
3
3
import (
4
4
"context"
5
- "fmt"
6
5
"log"
7
6
"time"
8
7
@@ -14,7 +13,6 @@ import (
14
13
corev1 "k8s.io/api/core/v1"
15
14
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
16
15
"k8s.io/apimachinery/pkg/types"
17
- "k8s.io/utils/ptr"
18
16
"sigs.k8s.io/controller-runtime/pkg/client"
19
17
20
18
oadpv1alpha1 "github.com/openshift/oadp-operator/api/v1alpha1"
@@ -89,11 +87,6 @@ var _ = ginkgo.Describe("OADP upgrade scenarios", ginkgo.Ordered, func() {
89
87
LogLevel : "debug" ,
90
88
DefaultPlugins : dpaCR .VeleroDefaultPlugins ,
91
89
},
92
- Restic : & oadpv1alpha1.ResticConfig {
93
- NodeAgentCommonFields : oadpv1alpha1.NodeAgentCommonFields {
94
- Enable : ptr .To (true ),
95
- },
96
- },
97
90
},
98
91
BackupLocations : []oadpv1alpha1.BackupLocation {
99
92
{
@@ -128,9 +121,7 @@ var _ = ginkgo.Describe("OADP upgrade scenarios", ginkgo.Ordered, func() {
128
121
log .Print ("Checking if Velero Pod is running" )
129
122
gomega .Eventually (lib .VeleroPodIsRunning (kubernetesClientForSuiteRun , namespace ), time .Minute * 3 , time .Second * 5 ).Should (gomega .BeTrue ())
130
123
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
134
125
135
126
// check if BSL is available
136
127
log .Print ("Checking if BSL is available" )
@@ -142,7 +133,7 @@ var _ = ginkgo.Describe("OADP upgrade scenarios", ginkgo.Ordered, func() {
142
133
143
134
// TODO backup/restore
144
135
145
- // Update spec.channel in Subscription to stable
136
+ // Update spec.channel in Subscription to dev
146
137
log .Print ("Updating Subscription oadp-operator spec.channel" )
147
138
err = runTimeClientForSuiteRun .Get (context .Background (), types.NamespacedName {Namespace : subscription .Namespace , Name : subscription .Name }, & subscription )
148
139
gomega .Expect (err ).To (gomega .BeNil ())
@@ -161,21 +152,6 @@ var _ = ginkgo.Describe("OADP upgrade scenarios", ginkgo.Ordered, func() {
161
152
// check DPA after controller-manager Pod is running
162
153
gomega .Eventually (lib .ManagerPodIsUp (kubernetesClientForSuiteRun , namespace ), time .Minute * 8 , time .Second * 15 ).Should (gomega .BeTrue ())
163
154
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
-
179
155
// check if updated DPA is reconciled
180
156
log .Print ("Checking if DPA was reconciled after update" )
181
157
// 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() {
189
165
190
166
timeAfterVeleroIsRunning := time .Now ()
191
167
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
223
169
224
170
// check if updated BSL is available
225
171
log .Print ("Checking if BSL was reconciled after update" )
@@ -233,9 +179,9 @@ var _ = ginkgo.Describe("OADP upgrade scenarios", ginkgo.Ordered, func() {
233
179
234
180
// TODO backup/restore
235
181
},
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 " ,
239
185
// to test production
240
186
// production: true,
241
187
}),
0 commit comments