Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 1 addition & 3 deletions apix/v1alpha2/inferencepool_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ func convertStatusToV1(src *InferencePoolStatus) (*v1.InferencePoolStatus, error
}
for _, p := range src.Parents {
ps := v1.ParentStatus{
ParentRef: toV1ParentRef(p.GatewayRef),
Conditions: make([]metav1.Condition, 0, len(p.Conditions)),
ParentRef: toV1ParentRef(p.GatewayRef),
}
for _, c := range p.Conditions {
cc := c
Expand Down Expand Up @@ -133,7 +132,6 @@ func convertStatusFromV1(src *v1.InferencePoolStatus) (*InferencePoolStatus, err
for _, p := range src.Parents {
ps := PoolStatus{
GatewayRef: fromV1ParentRef(p.ParentRef),
Conditions: make([]metav1.Condition, 0, len(p.Conditions)),
}
for _, c := range p.Conditions {
cc := c
Expand Down
36 changes: 2 additions & 34 deletions apix/v1alpha2/inferencepool_conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func TestInferencePoolConvertTo(t *testing.T) {
wantErr: false,
},
{
name: "conversion from v1alpha2 to v1 with empty extensionRef",
name: "conversion from v1alpha2 to v1 with empty extensionRef and empty status condition",
src: &InferencePool{
TypeMeta: metav1.TypeMeta{
Kind: "InferencePool",
Expand All @@ -147,14 +147,6 @@ func TestInferencePoolConvertTo(t *testing.T) {
Parents: []PoolStatus{
{
GatewayRef: ParentGatewayReference{Name: "my-gateway"},
Conditions: []metav1.Condition{
{
Type: string(InferencePoolConditionAccepted),
Status: metav1.ConditionTrue,
Reason: string(InferencePoolReasonAccepted),
LastTransitionTime: timestamp,
},
},
},
},
},
Expand All @@ -180,14 +172,6 @@ func TestInferencePoolConvertTo(t *testing.T) {
Parents: []v1.ParentStatus{
{
ParentRef: v1.ParentReference{Name: "my-gateway"},
Conditions: []metav1.Condition{
{
Type: string(v1.InferencePoolConditionAccepted),
Status: metav1.ConditionTrue,
Reason: string(v1.InferencePoolReasonAccepted),
LastTransitionTime: timestamp,
},
},
},
},
},
Expand Down Expand Up @@ -300,7 +284,7 @@ func TestInferencePoolConvertFrom(t *testing.T) {
wantErr: false,
},
{
name: "conversion from v1 to v1alpha2 with empty extensionRef",
name: "conversion from v1 to v1alpha2 with empty extensionRef and empty status condition",
src: &v1.InferencePool{
TypeMeta: metav1.TypeMeta{
Kind: "InferencePool",
Expand All @@ -322,14 +306,6 @@ func TestInferencePoolConvertFrom(t *testing.T) {
Parents: []v1.ParentStatus{
{
ParentRef: v1.ParentReference{Name: "my-gateway"},
Conditions: []metav1.Condition{
{
Type: string(v1.InferencePoolConditionAccepted),
Status: metav1.ConditionTrue,
Reason: string(v1.InferencePoolReasonAccepted),
LastTransitionTime: timestamp,
},
},
},
},
},
Expand All @@ -353,14 +329,6 @@ func TestInferencePoolConvertFrom(t *testing.T) {
Parents: []PoolStatus{
{
GatewayRef: ParentGatewayReference{Name: "my-gateway"},
Conditions: []metav1.Condition{
{
Type: string(InferencePoolConditionAccepted),
Status: metav1.ConditionTrue,
Reason: string(InferencePoolReasonAccepted),
LastTransitionTime: timestamp,
},
},
},
},
},
Expand Down