Skip to content

🌱 Rename v1beta2 test types #11832

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions util/conditions/v1beta2/getter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func TestGet(t *testing.T) {
LastTransitionTime: now,
},
},
V1Beta2: &builder.Phase1ObjStatusV1Beta2{
V1Beta2: &builder.Phase1ObjV1Beta2Status{
Conditions: []metav1.Condition{
{
Type: "barCondition",
Expand Down Expand Up @@ -112,8 +112,8 @@ func TestGet(t *testing.T) {
foo := &builder.Phase2Obj{
Status: builder.Phase2ObjStatus{
Conditions: nil,
Deprecated: &builder.Phase2ObjStatusDeprecated{
V1Beta1: &builder.Phase2ObjStatusDeprecatedV1Beta1{
Deprecated: &builder.Phase2ObjDeprecatedStatus{
V1Beta1: &builder.Phase2ObjDeprecatedV1Beta1Status{
Conditions: clusterv1.Conditions{
{
Type: "bazCondition",
Expand All @@ -135,8 +135,8 @@ func TestGet(t *testing.T) {
foo := &builder.Phase2Obj{
Status: builder.Phase2ObjStatus{
Conditions: []metav1.Condition{},
Deprecated: &builder.Phase2ObjStatusDeprecated{
V1Beta1: &builder.Phase2ObjStatusDeprecatedV1Beta1{
Deprecated: &builder.Phase2ObjDeprecatedStatus{
V1Beta1: &builder.Phase2ObjDeprecatedV1Beta1Status{
Conditions: clusterv1.Conditions{
{
Type: "bazCondition",
Expand Down Expand Up @@ -165,8 +165,8 @@ func TestGet(t *testing.T) {
Reason: "fooReason",
},
},
Deprecated: &builder.Phase2ObjStatusDeprecated{
V1Beta1: &builder.Phase2ObjStatusDeprecatedV1Beta1{
Deprecated: &builder.Phase2ObjDeprecatedStatus{
V1Beta1: &builder.Phase2ObjDeprecatedV1Beta1Status{
Conditions: clusterv1.Conditions{
{
Type: "bazCondition",
Expand Down Expand Up @@ -321,7 +321,7 @@ func TestUnstructuredGet(t *testing.T) {
LastTransitionTime: now,
},
},
V1Beta2: &builder.Phase1ObjStatusV1Beta2{
V1Beta2: &builder.Phase1ObjV1Beta2Status{
Conditions: []metav1.Condition{
{
Type: "barCondition",
Expand Down Expand Up @@ -359,8 +359,8 @@ func TestUnstructuredGet(t *testing.T) {
foo := &builder.Phase2Obj{
Status: builder.Phase2ObjStatus{
Conditions: nil,
Deprecated: &builder.Phase2ObjStatusDeprecated{
V1Beta1: &builder.Phase2ObjStatusDeprecatedV1Beta1{
Deprecated: &builder.Phase2ObjDeprecatedStatus{
V1Beta1: &builder.Phase2ObjDeprecatedV1Beta1Status{
Conditions: clusterv1.Conditions{
{
Type: "bazCondition",
Expand All @@ -386,8 +386,8 @@ func TestUnstructuredGet(t *testing.T) {
foo := &builder.Phase2Obj{
Status: builder.Phase2ObjStatus{
Conditions: []metav1.Condition{},
Deprecated: &builder.Phase2ObjStatusDeprecated{
V1Beta1: &builder.Phase2ObjStatusDeprecatedV1Beta1{
Deprecated: &builder.Phase2ObjDeprecatedStatus{
V1Beta1: &builder.Phase2ObjDeprecatedV1Beta1Status{
Conditions: clusterv1.Conditions{
{
Type: "bazCondition",
Expand Down Expand Up @@ -420,8 +420,8 @@ func TestUnstructuredGet(t *testing.T) {
Reason: "fooReason",
},
},
Deprecated: &builder.Phase2ObjStatusDeprecated{
V1Beta1: &builder.Phase2ObjStatusDeprecatedV1Beta1{
Deprecated: &builder.Phase2ObjDeprecatedStatus{
V1Beta1: &builder.Phase2ObjDeprecatedV1Beta1Status{
Conditions: clusterv1.Conditions{
{
Type: "bazCondition",
Expand Down
6 changes: 3 additions & 3 deletions util/conditions/v1beta2/setter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func TestSet(t *testing.T) {
LastTransitionTime: now,
},
},
V1Beta2: &builder.Phase1ObjStatusV1Beta2{
V1Beta2: &builder.Phase1ObjV1Beta2Status{
Conditions: []metav1.Condition{
{
Type: "barCondition",
Expand Down Expand Up @@ -100,8 +100,8 @@ func TestSet(t *testing.T) {
LastTransitionTime: now,
},
},
Deprecated: &builder.Phase2ObjStatusDeprecated{
V1Beta1: &builder.Phase2ObjStatusDeprecatedV1Beta1{
Deprecated: &builder.Phase2ObjDeprecatedStatus{
V1Beta1: &builder.Phase2ObjDeprecatedV1Beta1Status{
Conditions: clusterv1.Conditions{
{
Type: "barCondition",
Expand Down
2 changes: 1 addition & 1 deletion util/patch/patch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1784,7 +1784,7 @@ func TestPatchHelperForV1beta2Transition(t *testing.T) {
g.Expect(patcher.Patch(ctx, obj)).NotTo(Succeed())

t.Log("Validating the object has not been updated")
g.Eventually(func() *builder.Phase1ObjStatusV1Beta2 {
g.Eventually(func() *builder.Phase1ObjV1Beta2Status {
objAfter := obj.DeepCopy()
if err := env.Get(ctx, key, objAfter); err != nil {
return nil
Expand Down
6 changes: 3 additions & 3 deletions util/patch/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ func TestIdentifyConditionsFieldsPath(t *testing.T) {
}{
{obj: &builder.Phase1Obj{}},
{obj: &builder.Phase1Obj{Status: builder.Phase1ObjStatus{V1Beta2: nil}}},
{obj: &builder.Phase1Obj{Status: builder.Phase1ObjStatus{V1Beta2: &builder.Phase1ObjStatusV1Beta2{Conditions: nil}}}},
{obj: &builder.Phase1Obj{Status: builder.Phase1ObjStatus{V1Beta2: &builder.Phase1ObjV1Beta2Status{Conditions: nil}}}},
}
for _, tt := range tests {
metav1ConditionsFields, clusterv1ConditionsFields, err := identifyConditionsFieldsPath(tt.obj)
Expand All @@ -279,8 +279,8 @@ func TestIdentifyConditionsFieldsPath(t *testing.T) {
}{
{obj: &builder.Phase2Obj{}},
{obj: &builder.Phase2Obj{Status: builder.Phase2ObjStatus{Deprecated: nil}}},
{obj: &builder.Phase2Obj{Status: builder.Phase2ObjStatus{Deprecated: &builder.Phase2ObjStatusDeprecated{V1Beta1: nil}}}},
{obj: &builder.Phase2Obj{Status: builder.Phase2ObjStatus{Deprecated: &builder.Phase2ObjStatusDeprecated{V1Beta1: &builder.Phase2ObjStatusDeprecatedV1Beta1{Conditions: nil}}}}},
{obj: &builder.Phase2Obj{Status: builder.Phase2ObjStatus{Deprecated: &builder.Phase2ObjDeprecatedStatus{V1Beta1: nil}}}},
{obj: &builder.Phase2Obj{Status: builder.Phase2ObjStatus{Deprecated: &builder.Phase2ObjDeprecatedStatus{V1Beta1: &builder.Phase2ObjDeprecatedV1Beta1Status{Conditions: nil}}}}},
}
for _, tt := range tests {
metav1ConditionsFields, clusterv1ConditionsFields, err := identifyConditionsFieldsPath(tt.obj)
Expand Down
2 changes: 1 addition & 1 deletion util/test/builder/crd/test.cluster.x-k8s.io_phase1obj.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ spec:
type: object
type: array
v1beta2:
description: Phase1ObjStatusV1Beta2 defines the status.V1Beta2 of
description: Phase1ObjV1Beta2Status defines the status.V1Beta2 of
a Phase1Obj.
properties:
conditions:
Expand Down
4 changes: 2 additions & 2 deletions util/test/builder/crd/test.cluster.x-k8s.io_phase2obj.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ spec:
- type
x-kubernetes-list-type: map
deprecated:
description: Phase2ObjStatusDeprecated defines the status.Deprecated
description: Phase2ObjDeprecatedStatus defines the status.Deprecated
of a Phase2Obj.
properties:
v1beta1:
description: Phase2ObjStatusDeprecatedV1Beta1 defines the status.Deprecated.V1Beta2
description: Phase2ObjDeprecatedV1Beta1Status defines the status.Deprecated.V1Beta2
of a Phase2Obj.
properties:
conditions:
Expand Down
24 changes: 12 additions & 12 deletions util/test/builder/v1beta2_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ type Phase1ObjStatus struct {
Conditions clusterv1.Conditions `json:"conditions,omitempty"`

// +optional
V1Beta2 *Phase1ObjStatusV1Beta2 `json:"v1beta2,omitempty"`
V1Beta2 *Phase1ObjV1Beta2Status `json:"v1beta2,omitempty"`
}

// Phase1ObjStatusV1Beta2 defines the status.V1Beta2 of a Phase1Obj.
type Phase1ObjStatusV1Beta2 struct {
// Phase1ObjV1Beta2Status defines the status.V1Beta2 of a Phase1Obj.
type Phase1ObjV1Beta2Status struct {

// +optional
// +listType=map
Expand Down Expand Up @@ -163,7 +163,7 @@ func (o *Phase1Obj) GetV1Beta2Conditions() []metav1.Condition {
// SetV1Beta2Conditions sets conditions for an API object.
func (o *Phase1Obj) SetV1Beta2Conditions(conditions []metav1.Condition) {
if o.Status.V1Beta2 == nil {
o.Status.V1Beta2 = &Phase1ObjStatusV1Beta2{}
o.Status.V1Beta2 = &Phase1ObjV1Beta2Status{}
}
o.Status.V1Beta2.Conditions = conditions
}
Expand Down Expand Up @@ -206,18 +206,18 @@ type Phase2ObjStatus struct {
Conditions []metav1.Condition `json:"conditions,omitempty"`

// +optional
Deprecated *Phase2ObjStatusDeprecated `json:"deprecated,omitempty"`
Deprecated *Phase2ObjDeprecatedStatus `json:"deprecated,omitempty"`
}

// Phase2ObjStatusDeprecated defines the status.Deprecated of a Phase2Obj.
type Phase2ObjStatusDeprecated struct {
// Phase2ObjDeprecatedStatus defines the status.Deprecated of a Phase2Obj.
type Phase2ObjDeprecatedStatus struct {

// +optional
V1Beta1 *Phase2ObjStatusDeprecatedV1Beta1 `json:"v1beta1,omitempty"`
V1Beta1 *Phase2ObjDeprecatedV1Beta1Status `json:"v1beta1,omitempty"`
}

// Phase2ObjStatusDeprecatedV1Beta1 defines the status.Deprecated.V1Beta2 of a Phase2Obj.
type Phase2ObjStatusDeprecatedV1Beta1 struct {
// Phase2ObjDeprecatedV1Beta1Status defines the status.Deprecated.V1Beta2 of a Phase2Obj.
type Phase2ObjDeprecatedV1Beta1Status struct {

// +optional
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
Expand All @@ -234,10 +234,10 @@ func (o *Phase2Obj) GetConditions() clusterv1.Conditions {
// SetConditions sets the conditions on this object.
func (o *Phase2Obj) SetConditions(conditions clusterv1.Conditions) {
if o.Status.Deprecated == nil {
o.Status.Deprecated = &Phase2ObjStatusDeprecated{V1Beta1: &Phase2ObjStatusDeprecatedV1Beta1{}}
o.Status.Deprecated = &Phase2ObjDeprecatedStatus{V1Beta1: &Phase2ObjDeprecatedV1Beta1Status{}}
}
if o.Status.Deprecated.V1Beta1 == nil {
o.Status.Deprecated.V1Beta1 = &Phase2ObjStatusDeprecatedV1Beta1{}
o.Status.Deprecated.V1Beta1 = &Phase2ObjDeprecatedV1Beta1Status{}
}
o.Status.Deprecated.V1Beta1.Conditions = conditions
}
Expand Down
96 changes: 48 additions & 48 deletions util/test/builder/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading