@@ -69,24 +69,8 @@ var _ = Describe("Upgrade", Ordered, func() {
69
69
BeforeEach (func () {
70
70
testRuntime .InitRuntime ()
71
71
})
72
- It ("Fails if flag is missing" , func () {
73
- testRuntime .ApiServer .AppendHandlers (RespondWithJSON (http .StatusOK , hypershiftClusterNotReady ))
74
- err := runWithRuntime (testRuntime .RosaRuntime , Cmd )
75
- Expect (err ).ToNot (BeNil ())
76
- Expect (err .Error ()).To (
77
- ContainSubstring ("The '--control-plane' option is currently mandatory for Hosted Control Plane" ))
78
- })
79
- It ("Fails if cluster is not hypershift and we are using hypershift specific flags" , func () {
80
- args .controlPlane = true
81
- testRuntime .ApiServer .AppendHandlers (RespondWithJSON (http .StatusOK , classicCluster ))
82
- err := runWithRuntime (testRuntime .RosaRuntime , Cmd )
83
- Expect (err ).ToNot (BeNil ())
84
- Expect (err .Error ()).To (
85
- ContainSubstring ("The '--control-plane' option is only supported for Hosted Control Planes" ))
86
- })
87
72
88
73
It ("Fails if cluster is not hypershift and we are using hypershift specific flags" , func () {
89
- args .controlPlane = false
90
74
args .schedule = cronSchedule
91
75
testRuntime .ApiServer .AppendHandlers (RespondWithJSON (http .StatusOK , classicCluster ))
92
76
err := runWithRuntime (testRuntime .RosaRuntime , Cmd )
@@ -95,7 +79,6 @@ var _ = Describe("Upgrade", Ordered, func() {
95
79
ContainSubstring ("The '--schedule' option is only supported for Hosted Control Planes" ))
96
80
})
97
81
It ("Fails if we are using minor version flag for manual upgrades" , func () {
98
- args .controlPlane = true
99
82
args .schedule = ""
100
83
args .allowMinorVersionUpdates = true
101
84
testRuntime .ApiServer .AppendHandlers (RespondWithJSON (http .StatusOK , hypershiftClusterReady ))
@@ -105,7 +88,6 @@ var _ = Describe("Upgrade", Ordered, func() {
105
88
"option needs to be used with --schedule" ))
106
89
})
107
90
It ("Fails if we are mixing scheduling type flags" , func () {
108
- args .controlPlane = true
109
91
args .schedule = cronSchedule
110
92
args .scheduleDate = "31 Jan"
111
93
testRuntime .ApiServer .AppendHandlers (RespondWithJSON (http .StatusOK , hypershiftClusterReady ))
@@ -115,7 +97,6 @@ var _ = Describe("Upgrade", Ordered, func() {
115
97
"options are mutually exclusive with '--schedule'" ))
116
98
})
117
99
It ("Fails if we are mixing automatic scheduling and version flags" , func () {
118
- args .controlPlane = true
119
100
args .schedule = cronSchedule
120
101
args .scheduleDate = ""
121
102
args .version = "4.13.0"
@@ -126,7 +107,6 @@ var _ = Describe("Upgrade", Ordered, func() {
126
107
"option is mutually exclusive with '--version'" ))
127
108
})
128
109
It ("Fails if cluster is not ready" , func () {
129
- args .controlPlane = true
130
110
args .allowMinorVersionUpdates = false
131
111
args .schedule = ""
132
112
args .scheduleDate = ""
@@ -142,7 +122,6 @@ var _ = Describe("Upgrade", Ordered, func() {
142
122
Expect (err .Error ()).To (ContainSubstring ("Cluster 'cluster1' is not yet ready" ))
143
123
})
144
124
It ("Cluster is ready but existing upgrade scheduled" , func () {
145
- args .controlPlane = true
146
125
args .schedule = cronSchedule
147
126
testRuntime .ApiServer .AppendHandlers (RespondWithJSON (http .StatusOK , hypershiftClusterReady ))
148
127
// An existing policy upgrade
@@ -162,7 +141,6 @@ var _ = Describe("Upgrade", Ordered, func() {
162
141
"There is already a pending upgrade to version 4.12.18 on 2023-06-02 12:30 UTC" ))
163
142
})
164
143
It ("Cluster is ready and with automatic scheduling but bad cron format" , func () {
165
- args .controlPlane = true
166
144
// not a valid cron
167
145
args .schedule = "* a"
168
146
testRuntime .ApiServer .AppendHandlers (RespondWithJSON (http .StatusOK , hypershiftClusterReady ))
@@ -176,7 +154,6 @@ var _ = Describe("Upgrade", Ordered, func() {
176
154
})
177
155
178
156
It ("Cluster is ready and with manual scheduling but bad format" , func () {
179
- args .controlPlane = true
180
157
args .schedule = ""
181
158
// Not a valid date format
182
159
args .scheduleDate = "Jan 23"
@@ -193,7 +170,6 @@ var _ = Describe("Upgrade", Ordered, func() {
193
170
"schedule date should use the format 'yyyy-mm-dd'\n Schedule time should use the format 'HH:mm'" ))
194
171
})
195
172
It ("Cluster is ready and with manual scheduling but no upgrades available" , func () {
196
- args .controlPlane = true
197
173
args .schedule = ""
198
174
// Not a valid date format
199
175
args .scheduleDate = dateSchedule
@@ -210,7 +186,6 @@ var _ = Describe("Upgrade", Ordered, func() {
210
186
Expect (stderr ).To (ContainSubstring ("There are no available upgrades" ))
211
187
})
212
188
It ("Cluster is ready and with automatic scheduling, no upgrades available -> still success" , func () {
213
- args .controlPlane = true
214
189
args .schedule = "20 5 * * *"
215
190
args .scheduleDate = ""
216
191
args .scheduleTime = ""
@@ -235,7 +210,6 @@ var _ = Describe("Upgrade", Ordered, func() {
235
210
Expect (stderr ).To (BeEmpty ())
236
211
})
237
212
It ("Cluster is ready and with manual scheduling and available upgrades but a wrong version in input" , func () {
238
- args .controlPlane = true
239
213
args .schedule = ""
240
214
// Not a valid date format
241
215
args .scheduleDate = dateSchedule
@@ -253,7 +227,6 @@ var _ = Describe("Upgrade", Ordered, func() {
253
227
ContainSubstring ("Expected a valid version to upgrade cluster to.\n Valid versions: [4.13.1]" ))
254
228
})
255
229
It ("Cluster is ready and with manual scheduling and one available upgrade but cluster not found" , func () {
256
- args .controlPlane = true
257
230
args .schedule = ""
258
231
// Not a valid date format
259
232
args .scheduleDate = dateSchedule
@@ -278,7 +251,6 @@ var _ = Describe("Upgrade", Ordered, func() {
278
251
Expect (err .Error ()).To (ContainSubstring ("There is no cluster with identifier or name" ))
279
252
})
280
253
It ("Fails if node-drain-grace-period flag is specified for hypershift clusters" , func () {
281
- args .controlPlane = true
282
254
args .schedule = "20 5 * * *"
283
255
args .scheduleDate = ""
284
256
args .scheduleTime = ""
0 commit comments