You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Message: fmt.Sprintf("%s is less than the current target %s, and the only supported rollback is to the cluster's previous version %s (%s)", targetVersion, currentVersion, *previousVersion, previousImage),
klog.V(2).Infof("Precondition %q allows rollbacks from %s to the previous version %s within a z-stream", p.Name(), currentVersion, targetVersion)
97
-
returnnil
98
-
}
99
-
return&precondition.Error{
100
-
Reason: "LowDesiredVersion",
101
-
Message: fmt.Sprintf("%s is less than the current target %s and matches the cluster's previous version, but rollbacks that change major or minor versions are not recommended", targetVersion, currentVersion),
102
-
Name: p.Name(),
103
-
}
104
-
}
105
57
return&precondition.Error{
106
58
Reason: "LowDesiredVersion",
107
-
Message: fmt.Sprintf("%s is less than the current target %s, and the cluster has no previous Semantic Version", targetVersion, currentVersion),
59
+
Message: fmt.Sprintf("%s is less than the current target %s, but rollbacks and downgrades are not recommended", targetVersion, currentVersion),
expected: "1.0.0 is less than the current target 1.0.1, and the cluster has no previous Semantic Version",
66
-
},
67
-
{
68
-
name: "rollback to previous in the same minor version",
69
-
clusterVersion: configv1.ClusterVersion{
70
-
Spec: configv1.ClusterVersionSpec{
71
-
DesiredUpdate: &configv1.Update{
72
-
Version: "1.0.0",
73
-
},
74
-
},
75
-
Status: configv1.ClusterVersionStatus{
76
-
Desired: configv1.Release{
77
-
Version: "1.0.1",
78
-
},
79
-
History: []configv1.UpdateHistory{
80
-
{
81
-
State: configv1.CompletedUpdate,
82
-
Version: "1.0.1",
83
-
},
84
-
{
85
-
State: configv1.CompletedUpdate,
86
-
Version: "1.0.0",
87
-
},
88
-
},
89
-
},
90
-
},
91
-
expected: "",
92
-
},
93
-
{
94
-
name: "rollback to previous completed with intermediate partial",
95
-
clusterVersion: configv1.ClusterVersion{
96
-
Spec: configv1.ClusterVersionSpec{
97
-
DesiredUpdate: &configv1.Update{
98
-
Version: "1.0.0",
99
-
},
100
-
},
101
-
Status: configv1.ClusterVersionStatus{
102
-
Desired: configv1.Release{
103
-
Version: "1.0.2",
104
-
Image: "example.com/image:1.0.2",
105
-
},
106
-
History: []configv1.UpdateHistory{
107
-
{
108
-
State: configv1.PartialUpdate,
109
-
Version: "1.0.2",
110
-
Image: "example.com/image:1.0.2",
111
-
},
112
-
{
113
-
State: configv1.PartialUpdate,
114
-
Version: "1.0.1",
115
-
Image: "example.com/image:1.0.1",
116
-
},
117
-
{
118
-
State: configv1.CompletedUpdate,
119
-
Version: "1.0.0",
120
-
Image: "example.com/image:1.0.0",
121
-
},
122
-
},
123
-
},
124
-
},
125
-
expected: "1.0.0 is less than the current target 1.0.2, and the only supported rollback is to the cluster's previous version 1.0.1 (example.com/image:1.0.1)",
126
-
},
127
-
{
128
-
name: "rollback to previous completed with intermediate image change",
129
-
clusterVersion: configv1.ClusterVersion{
130
-
Spec: configv1.ClusterVersionSpec{
131
-
DesiredUpdate: &configv1.Update{
132
-
Version: "1.0.0",
133
-
},
134
-
},
135
-
Status: configv1.ClusterVersionStatus{
136
-
Desired: configv1.Release{
137
-
Version: "1.0.1",
138
-
Image: "example.com/image:multi-arch",
139
-
},
140
-
History: []configv1.UpdateHistory{
141
-
{
142
-
State: configv1.CompletedUpdate,
143
-
Version: "1.0.1",
144
-
Image: "example.com/image:multi-arch",
145
-
},
146
-
{
147
-
State: configv1.CompletedUpdate,
148
-
Version: "1.0.1",
149
-
Image: "example.com/image:single-arch",
150
-
},
151
-
{
152
-
State: configv1.CompletedUpdate,
153
-
Version: "1.0.0",
154
-
},
155
-
},
156
-
},
157
-
},
158
-
expected: "1.0.0 is less than the current target 1.0.1, and the only supported rollback is to the cluster's previous version 1.0.1 (example.com/image:single-arch)",
159
-
},
160
-
{
161
-
name: "rollback to previous in an earlier minor release",
162
-
clusterVersion: configv1.ClusterVersion{
163
-
Spec: configv1.ClusterVersionSpec{
164
-
DesiredUpdate: &configv1.Update{
165
-
Version: "1.0.0",
166
-
},
167
-
},
168
-
Status: configv1.ClusterVersionStatus{
169
-
Desired: configv1.Release{
170
-
Version: "2.0.0",
171
-
},
172
-
History: []configv1.UpdateHistory{
173
-
{
174
-
State: configv1.CompletedUpdate,
175
-
Version: "2.0.0",
176
-
},
177
-
{
178
-
State: configv1.CompletedUpdate,
179
-
Version: "1.0.0",
180
-
},
181
-
},
182
-
},
183
-
},
184
-
expected: "1.0.0 is less than the current target 2.0.0 and matches the cluster's previous version, but rollbacks that change major or minor versions are not recommended",
33
+
name: "rollback",
34
+
currVersion: "1.0.1",
35
+
desiredVersion: "1.0.0",
36
+
expected: "1.0.0 is less than the current target 1.0.1, but rollbacks and downgrades are not recommended",
0 commit comments