@@ -9,19 +9,20 @@ import (
9
9
upgradeapiv1 "github.com/rancher/system-upgrade-controller/pkg/apis/upgrade.cattle.io/v1"
10
10
)
11
11
12
- var _ = Describe ("Upgrade " , func () {
12
+ var _ = Describe ("Plan Resolution " , func () {
13
13
e2e := framework .New ("resolve" )
14
14
15
- When ("plan missing channel and version" , func () {
15
+ When ("missing channel and version" , func () {
16
16
var (
17
17
err error
18
- plan = e2e . NewPlan ( "missing-" , "" , nil )
18
+ plan * upgradeapiv1. Plan
19
19
)
20
20
BeforeEach (func () {
21
+ plan = e2e .NewPlan ("missing-" , "" , nil )
21
22
plan , err = e2e .CreatePlan (plan )
22
23
Expect (err ).ToNot (HaveOccurred ())
23
24
24
- plan , err = e2e .PollPlanCondition (plan .Name , upgradeapiv1 .PlanLatestResolved , 2 * time . Second , 30 * time .Second )
25
+ plan , err = e2e .WaitForPlanCondition (plan .Name , upgradeapiv1 .PlanLatestResolved , 30 * time .Second )
25
26
Expect (err ).ToNot (HaveOccurred ())
26
27
})
27
28
It ("should not resolve" , func () {
@@ -31,18 +32,19 @@ var _ = Describe("Upgrade", func() {
31
32
})
32
33
})
33
34
34
- When ("plan has version" , func () {
35
+ When ("has version" , func () {
35
36
var (
36
37
err error
37
- plan = e2e . NewPlan ( "version-" , "" , nil )
38
+ plan * upgradeapiv1. Plan
38
39
)
39
40
BeforeEach (func () {
41
+ plan = e2e .NewPlan ("version-" , "" , nil )
40
42
plan .Spec .Version = "test"
41
43
42
44
plan , err = e2e .CreatePlan (plan )
43
45
Expect (err ).ToNot (HaveOccurred ())
44
46
45
- plan , err = e2e .PollPlanCondition (plan .Name , upgradeapiv1 .PlanLatestResolved , 2 * time . Second , 30 * time .Second )
47
+ plan , err = e2e .WaitForPlanCondition (plan .Name , upgradeapiv1 .PlanLatestResolved , 30 * time .Second )
46
48
Expect (err ).ToNot (HaveOccurred ())
47
49
})
48
50
It ("should resolve" , func () {
@@ -53,19 +55,20 @@ var _ = Describe("Upgrade", func() {
53
55
})
54
56
})
55
57
56
- When ("plan has version with semver+metadata" , func () {
58
+ When ("has version with semver+metadata" , func () {
57
59
var (
58
60
err error
59
- plan = e2e . NewPlan ( "version-semver-metadata-" , "" , nil )
61
+ plan * upgradeapiv1. Plan
60
62
semver = "v1.2.3+test"
61
63
)
62
64
BeforeEach (func () {
65
+ plan = e2e .NewPlan ("version-semver-metadata-" , "" , nil )
63
66
plan .Spec .Version = semver
64
67
65
68
plan , err = e2e .CreatePlan (plan )
66
69
Expect (err ).ToNot (HaveOccurred ())
67
70
68
- plan , err = e2e .PollPlanCondition (plan .Name , upgradeapiv1 .PlanLatestResolved , 2 * time . Second , 30 * time .Second )
71
+ plan , err = e2e .WaitForPlanCondition (plan .Name , upgradeapiv1 .PlanLatestResolved , 30 * time .Second )
69
72
Expect (err ).ToNot (HaveOccurred ())
70
73
})
71
74
It ("should resolve" , func () {
@@ -78,22 +81,23 @@ var _ = Describe("Upgrade", func() {
78
81
})
79
82
})
80
83
81
- When ("plan has channel" , func () {
84
+ When ("has channel" , func () {
82
85
var (
83
86
err error
84
- plan = e2e . NewPlan ( "channel-" , "" , nil )
87
+ plan * upgradeapiv1. Plan
85
88
channelSrv * httptest.Server
86
89
channelTag = "test"
87
90
)
88
91
BeforeEach (func () {
89
92
channelSrv = framework .ChannelServer (path .Join ("/local" , channelTag ))
93
+ plan = e2e .NewPlan ("channel-" , "" , nil )
90
94
plan .Spec .Channel = channelSrv .URL
91
95
Expect (plan .Spec .Channel ).ToNot (BeEmpty ())
92
96
93
97
plan , err = e2e .CreatePlan (plan )
94
98
Expect (err ).ToNot (HaveOccurred ())
95
99
96
- plan , err = e2e .PollPlanCondition (plan .Name , upgradeapiv1 .PlanLatestResolved , 2 * time . Second , 30 * time .Second )
100
+ plan , err = e2e .WaitForPlanCondition (plan .Name , upgradeapiv1 .PlanLatestResolved , 30 * time .Second )
97
101
Expect (err ).ToNot (HaveOccurred ())
98
102
})
99
103
AfterEach (func () {
@@ -109,22 +113,23 @@ var _ = Describe("Upgrade", func() {
109
113
})
110
114
})
111
115
112
- When ("plan has channel with semver+metadata" , func () {
116
+ When ("has channel with semver+metadata" , func () {
113
117
var (
114
118
err error
115
- plan = e2e . NewPlan ( "channel-semver-metadata-" , "" , nil )
119
+ plan * upgradeapiv1. Plan
116
120
channelSrv * httptest.Server
117
121
channelTag = "v1.2.3+test"
118
122
)
119
123
BeforeEach (func () {
120
124
channelSrv = framework .ChannelServer (path .Join ("/local/test" , channelTag ))
125
+ plan = e2e .NewPlan ("channel-semver-metadata-" , "" , nil )
121
126
plan .Spec .Channel = channelSrv .URL
122
127
Expect (plan .Spec .Channel ).ToNot (BeEmpty ())
123
128
124
129
plan , err = e2e .CreatePlan (plan )
125
130
Expect (err ).ToNot (HaveOccurred ())
126
131
127
- plan , err = e2e .PollPlanCondition (plan .Name , upgradeapiv1 .PlanLatestResolved , 2 * time . Second , 30 * time .Second )
132
+ plan , err = e2e .WaitForPlanCondition (plan .Name , upgradeapiv1 .PlanLatestResolved , 30 * time .Second )
128
133
Expect (err ).ToNot (HaveOccurred ())
129
134
})
130
135
AfterEach (func () {
0 commit comments