Skip to content

Commit 29bf290

Browse files
Rename v1beta2 test types
1 parent 9a55766 commit 29bf290

File tree

8 files changed

+84
-84
lines changed

8 files changed

+84
-84
lines changed

util/conditions/v1beta2/getter_test.go

Lines changed: 14 additions & 14 deletions
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,8 +112,8 @@ func TestGet(t *testing.T) {
112112
foo := &builder.Phase2Obj{
113113
Status: builder.Phase2ObjStatus{
114114
Conditions: nil,
115-
Deprecated: &builder.Phase2ObjStatusDeprecated{
116-
V1Beta1: &builder.Phase2ObjStatusDeprecatedV1Beta1{
115+
Deprecated: &builder.Phase2ObjDeprecatedStatus{
116+
V1Beta1: &builder.Phase2ObjDeprecatedV1Beta1Status{
117117
Conditions: clusterv1.Conditions{
118118
{
119119
Type: "bazCondition",
@@ -135,8 +135,8 @@ func TestGet(t *testing.T) {
135135
foo := &builder.Phase2Obj{
136136
Status: builder.Phase2ObjStatus{
137137
Conditions: []metav1.Condition{},
138-
Deprecated: &builder.Phase2ObjStatusDeprecated{
139-
V1Beta1: &builder.Phase2ObjStatusDeprecatedV1Beta1{
138+
Deprecated: &builder.Phase2ObjDeprecatedStatus{
139+
V1Beta1: &builder.Phase2ObjDeprecatedV1Beta1Status{
140140
Conditions: clusterv1.Conditions{
141141
{
142142
Type: "bazCondition",
@@ -165,8 +165,8 @@ func TestGet(t *testing.T) {
165165
Reason: "fooReason",
166166
},
167167
},
168-
Deprecated: &builder.Phase2ObjStatusDeprecated{
169-
V1Beta1: &builder.Phase2ObjStatusDeprecatedV1Beta1{
168+
Deprecated: &builder.Phase2ObjDeprecatedStatus{
169+
V1Beta1: &builder.Phase2ObjDeprecatedV1Beta1Status{
170170
Conditions: clusterv1.Conditions{
171171
{
172172
Type: "bazCondition",
@@ -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,8 +359,8 @@ func TestUnstructuredGet(t *testing.T) {
359359
foo := &builder.Phase2Obj{
360360
Status: builder.Phase2ObjStatus{
361361
Conditions: nil,
362-
Deprecated: &builder.Phase2ObjStatusDeprecated{
363-
V1Beta1: &builder.Phase2ObjStatusDeprecatedV1Beta1{
362+
Deprecated: &builder.Phase2ObjDeprecatedStatus{
363+
V1Beta1: &builder.Phase2ObjDeprecatedV1Beta1Status{
364364
Conditions: clusterv1.Conditions{
365365
{
366366
Type: "bazCondition",
@@ -386,8 +386,8 @@ func TestUnstructuredGet(t *testing.T) {
386386
foo := &builder.Phase2Obj{
387387
Status: builder.Phase2ObjStatus{
388388
Conditions: []metav1.Condition{},
389-
Deprecated: &builder.Phase2ObjStatusDeprecated{
390-
V1Beta1: &builder.Phase2ObjStatusDeprecatedV1Beta1{
389+
Deprecated: &builder.Phase2ObjDeprecatedStatus{
390+
V1Beta1: &builder.Phase2ObjDeprecatedV1Beta1Status{
391391
Conditions: clusterv1.Conditions{
392392
{
393393
Type: "bazCondition",
@@ -420,8 +420,8 @@ func TestUnstructuredGet(t *testing.T) {
420420
Reason: "fooReason",
421421
},
422422
},
423-
Deprecated: &builder.Phase2ObjStatusDeprecated{
424-
V1Beta1: &builder.Phase2ObjStatusDeprecatedV1Beta1{
423+
Deprecated: &builder.Phase2ObjDeprecatedStatus{
424+
V1Beta1: &builder.Phase2ObjDeprecatedV1Beta1Status{
425425
Conditions: clusterv1.Conditions{
426426
{
427427
Type: "bazCondition",

util/conditions/v1beta2/setter_test.go

Lines changed: 3 additions & 3 deletions
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,8 +100,8 @@ func TestSet(t *testing.T) {
100100
LastTransitionTime: now,
101101
},
102102
},
103-
Deprecated: &builder.Phase2ObjStatusDeprecated{
104-
V1Beta1: &builder.Phase2ObjStatusDeprecatedV1Beta1{
103+
Deprecated: &builder.Phase2ObjDeprecatedStatus{
104+
V1Beta1: &builder.Phase2ObjDeprecatedV1Beta1Status{
105105
Conditions: clusterv1.Conditions{
106106
{
107107
Type: "barCondition",

util/patch/patch_test.go

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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.Phase2ObjDeprecatedV1Beta1Status{Conditions: nil}}}}},
284284
}
285285
for _, tt := range tests {
286286
metav1ConditionsFields, clusterv1ConditionsFields, err := identifyConditionsFieldsPath(tt.obj)

util/test/builder/crd/test.cluster.x-k8s.io_phase1obj.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ spec:
9797
type: object
9898
type: array
9999
v1beta2:
100-
description: Phase1ObjStatusV1Beta2 defines the status.V1Beta2 of
100+
description: Phase1ObjV1Beta2Status defines the status.V1Beta2 of
101101
a Phase1Obj.
102102
properties:
103103
conditions:

util/test/builder/crd/test.cluster.x-k8s.io_phase2obj.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ spec:
111111
- type
112112
x-kubernetes-list-type: map
113113
deprecated:
114-
description: Phase2ObjStatusDeprecated defines the status.Deprecated
114+
description: Phase2ObjDeprecatedStatus defines the status.Deprecated
115115
of a Phase2Obj.
116116
properties:
117117
v1beta1:
118-
description: Phase2ObjStatusDeprecatedV1Beta1 defines the status.Deprecated.V1Beta2
118+
description: Phase2ObjDeprecatedV1Beta1Status defines the status.Deprecated.V1Beta2
119119
of a Phase2Obj.
120120
properties:
121121
conditions:

util/test/builder/v1beta2_transition.go

Lines changed: 12 additions & 12 deletions
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,18 +206,18 @@ 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
216-
V1Beta1 *Phase2ObjStatusDeprecatedV1Beta1 `json:"v1beta1,omitempty"`
216+
V1Beta1 *Phase2ObjDeprecatedV1Beta1Status `json:"v1beta1,omitempty"`
217217
}
218218

219-
// Phase2ObjStatusDeprecatedV1Beta1 defines the status.Deprecated.V1Beta2 of a Phase2Obj.
220-
type Phase2ObjStatusDeprecatedV1Beta1 struct {
219+
// Phase2ObjDeprecatedV1Beta1Status defines the status.Deprecated.V1Beta2 of a Phase2Obj.
220+
type Phase2ObjDeprecatedV1Beta1Status struct {
221221

222222
// +optional
223223
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
@@ -234,10 +234,10 @@ 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: &Phase2ObjDeprecatedV1Beta1Status{}}
238238
}
239239
if o.Status.Deprecated.V1Beta1 == nil {
240-
o.Status.Deprecated.V1Beta1 = &Phase2ObjStatusDeprecatedV1Beta1{}
240+
o.Status.Deprecated.V1Beta1 = &Phase2ObjDeprecatedV1Beta1Status{}
241241
}
242242
o.Status.Deprecated.V1Beta1.Conditions = conditions
243243
}

util/test/builder/zz_generated.deepcopy.go

Lines changed: 48 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)