Skip to content

Commit 346d74e

Browse files
Rename v1beta2 test types
1 parent 9a55766 commit 346d74e

File tree

6 files changed

+48
-48
lines changed

6 files changed

+48
-48
lines changed

util/conditions/v1beta2/getter_test.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func TestGet(t *testing.T) {
7878
LastTransitionTime: now,
7979
},
8080
},
81-
V1Beta2: &builder.Phase1ObjStatusV1Beta2{
81+
V1Beta2: &builder.Phase1ObjV1Beta2Status{
8282
Conditions: []metav1.Condition{
8383
{
8484
Type: "barCondition",
@@ -112,7 +112,7 @@ func TestGet(t *testing.T) {
112112
foo := &builder.Phase2Obj{
113113
Status: builder.Phase2ObjStatus{
114114
Conditions: nil,
115-
Deprecated: &builder.Phase2ObjStatusDeprecated{
115+
Deprecated: &builder.Phase2ObjDeprecatedStatus{
116116
V1Beta1: &builder.Phase2ObjStatusDeprecatedV1Beta1{
117117
Conditions: clusterv1.Conditions{
118118
{
@@ -135,7 +135,7 @@ func TestGet(t *testing.T) {
135135
foo := &builder.Phase2Obj{
136136
Status: builder.Phase2ObjStatus{
137137
Conditions: []metav1.Condition{},
138-
Deprecated: &builder.Phase2ObjStatusDeprecated{
138+
Deprecated: &builder.Phase2ObjDeprecatedStatus{
139139
V1Beta1: &builder.Phase2ObjStatusDeprecatedV1Beta1{
140140
Conditions: clusterv1.Conditions{
141141
{
@@ -165,7 +165,7 @@ func TestGet(t *testing.T) {
165165
Reason: "fooReason",
166166
},
167167
},
168-
Deprecated: &builder.Phase2ObjStatusDeprecated{
168+
Deprecated: &builder.Phase2ObjDeprecatedStatus{
169169
V1Beta1: &builder.Phase2ObjStatusDeprecatedV1Beta1{
170170
Conditions: clusterv1.Conditions{
171171
{
@@ -321,7 +321,7 @@ func TestUnstructuredGet(t *testing.T) {
321321
LastTransitionTime: now,
322322
},
323323
},
324-
V1Beta2: &builder.Phase1ObjStatusV1Beta2{
324+
V1Beta2: &builder.Phase1ObjV1Beta2Status{
325325
Conditions: []metav1.Condition{
326326
{
327327
Type: "barCondition",
@@ -359,7 +359,7 @@ func TestUnstructuredGet(t *testing.T) {
359359
foo := &builder.Phase2Obj{
360360
Status: builder.Phase2ObjStatus{
361361
Conditions: nil,
362-
Deprecated: &builder.Phase2ObjStatusDeprecated{
362+
Deprecated: &builder.Phase2ObjDeprecatedStatus{
363363
V1Beta1: &builder.Phase2ObjStatusDeprecatedV1Beta1{
364364
Conditions: clusterv1.Conditions{
365365
{
@@ -386,7 +386,7 @@ func TestUnstructuredGet(t *testing.T) {
386386
foo := &builder.Phase2Obj{
387387
Status: builder.Phase2ObjStatus{
388388
Conditions: []metav1.Condition{},
389-
Deprecated: &builder.Phase2ObjStatusDeprecated{
389+
Deprecated: &builder.Phase2ObjDeprecatedStatus{
390390
V1Beta1: &builder.Phase2ObjStatusDeprecatedV1Beta1{
391391
Conditions: clusterv1.Conditions{
392392
{
@@ -420,7 +420,7 @@ func TestUnstructuredGet(t *testing.T) {
420420
Reason: "fooReason",
421421
},
422422
},
423-
Deprecated: &builder.Phase2ObjStatusDeprecated{
423+
Deprecated: &builder.Phase2ObjDeprecatedStatus{
424424
V1Beta1: &builder.Phase2ObjStatusDeprecatedV1Beta1{
425425
Conditions: clusterv1.Conditions{
426426
{

util/conditions/v1beta2/setter_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func TestSet(t *testing.T) {
6767
LastTransitionTime: now,
6868
},
6969
},
70-
V1Beta2: &builder.Phase1ObjStatusV1Beta2{
70+
V1Beta2: &builder.Phase1ObjV1Beta2Status{
7171
Conditions: []metav1.Condition{
7272
{
7373
Type: "barCondition",
@@ -100,7 +100,7 @@ func TestSet(t *testing.T) {
100100
LastTransitionTime: now,
101101
},
102102
},
103-
Deprecated: &builder.Phase2ObjStatusDeprecated{
103+
Deprecated: &builder.Phase2ObjDeprecatedStatus{
104104
V1Beta1: &builder.Phase2ObjStatusDeprecatedV1Beta1{
105105
Conditions: clusterv1.Conditions{
106106
{

util/patch/patch_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1784,7 +1784,7 @@ func TestPatchHelperForV1beta2Transition(t *testing.T) {
17841784
g.Expect(patcher.Patch(ctx, obj)).NotTo(Succeed())
17851785

17861786
t.Log("Validating the object has not been updated")
1787-
g.Eventually(func() *builder.Phase1ObjStatusV1Beta2 {
1787+
g.Eventually(func() *builder.Phase1ObjV1Beta2Status {
17881788
objAfter := obj.DeepCopy()
17891789
if err := env.Get(ctx, key, objAfter); err != nil {
17901790
return nil

util/patch/utils_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ func TestIdentifyConditionsFieldsPath(t *testing.T) {
262262
}{
263263
{obj: &builder.Phase1Obj{}},
264264
{obj: &builder.Phase1Obj{Status: builder.Phase1ObjStatus{V1Beta2: nil}}},
265-
{obj: &builder.Phase1Obj{Status: builder.Phase1ObjStatus{V1Beta2: &builder.Phase1ObjStatusV1Beta2{Conditions: nil}}}},
265+
{obj: &builder.Phase1Obj{Status: builder.Phase1ObjStatus{V1Beta2: &builder.Phase1ObjV1Beta2Status{Conditions: nil}}}},
266266
}
267267
for _, tt := range tests {
268268
metav1ConditionsFields, clusterv1ConditionsFields, err := identifyConditionsFieldsPath(tt.obj)
@@ -279,8 +279,8 @@ func TestIdentifyConditionsFieldsPath(t *testing.T) {
279279
}{
280280
{obj: &builder.Phase2Obj{}},
281281
{obj: &builder.Phase2Obj{Status: builder.Phase2ObjStatus{Deprecated: nil}}},
282-
{obj: &builder.Phase2Obj{Status: builder.Phase2ObjStatus{Deprecated: &builder.Phase2ObjStatusDeprecated{V1Beta1: nil}}}},
283-
{obj: &builder.Phase2Obj{Status: builder.Phase2ObjStatus{Deprecated: &builder.Phase2ObjStatusDeprecated{V1Beta1: &builder.Phase2ObjStatusDeprecatedV1Beta1{Conditions: nil}}}}},
282+
{obj: &builder.Phase2Obj{Status: builder.Phase2ObjStatus{Deprecated: &builder.Phase2ObjDeprecatedStatus{V1Beta1: nil}}}},
283+
{obj: &builder.Phase2Obj{Status: builder.Phase2ObjStatus{Deprecated: &builder.Phase2ObjDeprecatedStatus{V1Beta1: &builder.Phase2ObjStatusDeprecatedV1Beta1{Conditions: nil}}}}},
284284
}
285285
for _, tt := range tests {
286286
metav1ConditionsFields, clusterv1ConditionsFields, err := identifyConditionsFieldsPath(tt.obj)

util/test/builder/v1beta2_transition.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,11 @@ type Phase1ObjStatus struct {
129129
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
130130

131131
// +optional
132-
V1Beta2 *Phase1ObjStatusV1Beta2 `json:"v1beta2,omitempty"`
132+
V1Beta2 *Phase1ObjV1Beta2Status `json:"v1beta2,omitempty"`
133133
}
134134

135-
// Phase1ObjStatusV1Beta2 defines the status.V1Beta2 of a Phase1Obj.
136-
type Phase1ObjStatusV1Beta2 struct {
135+
// Phase1ObjV1Beta2Status defines the status.V1Beta2 of a Phase1Obj.
136+
type Phase1ObjV1Beta2Status struct {
137137

138138
// +optional
139139
// +listType=map
@@ -163,7 +163,7 @@ func (o *Phase1Obj) GetV1Beta2Conditions() []metav1.Condition {
163163
// SetV1Beta2Conditions sets conditions for an API object.
164164
func (o *Phase1Obj) SetV1Beta2Conditions(conditions []metav1.Condition) {
165165
if o.Status.V1Beta2 == nil {
166-
o.Status.V1Beta2 = &Phase1ObjStatusV1Beta2{}
166+
o.Status.V1Beta2 = &Phase1ObjV1Beta2Status{}
167167
}
168168
o.Status.V1Beta2.Conditions = conditions
169169
}
@@ -206,11 +206,11 @@ type Phase2ObjStatus struct {
206206
Conditions []metav1.Condition `json:"conditions,omitempty"`
207207

208208
// +optional
209-
Deprecated *Phase2ObjStatusDeprecated `json:"deprecated,omitempty"`
209+
Deprecated *Phase2ObjDeprecatedStatus `json:"deprecated,omitempty"`
210210
}
211211

212-
// Phase2ObjStatusDeprecated defines the status.Deprecated of a Phase2Obj.
213-
type Phase2ObjStatusDeprecated struct {
212+
// Phase2ObjDeprecatedStatus defines the status.Deprecated of a Phase2Obj.
213+
type Phase2ObjDeprecatedStatus struct {
214214

215215
// +optional
216216
V1Beta1 *Phase2ObjStatusDeprecatedV1Beta1 `json:"v1beta1,omitempty"`
@@ -234,7 +234,7 @@ func (o *Phase2Obj) GetConditions() clusterv1.Conditions {
234234
// SetConditions sets the conditions on this object.
235235
func (o *Phase2Obj) SetConditions(conditions clusterv1.Conditions) {
236236
if o.Status.Deprecated == nil {
237-
o.Status.Deprecated = &Phase2ObjStatusDeprecated{V1Beta1: &Phase2ObjStatusDeprecatedV1Beta1{}}
237+
o.Status.Deprecated = &Phase2ObjDeprecatedStatus{V1Beta1: &Phase2ObjStatusDeprecatedV1Beta1{}}
238238
}
239239
if o.Status.Deprecated.V1Beta1 == nil {
240240
o.Status.Deprecated.V1Beta1 = &Phase2ObjStatusDeprecatedV1Beta1{}

util/test/builder/zz_generated.deepcopy.go

+26-26
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)