Skip to content

Commit

Permalink
fix missing ToFieldPath in conversion
Browse files Browse the repository at this point in the history
Signed-off-by: lsviben <[email protected]>
(cherry picked from commit 15a1199)
  • Loading branch information
lsviben authored and github-actions[bot] committed Jan 29, 2024
1 parent d1fa685 commit c426a17
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apis/object/v1alpha1/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func (src *Object) ConvertTo(dstRaw conversion.Hub) error { // nolint:golint //
FieldPath: r.PatchesFrom.FieldPath,
}
}
ref.ToFieldPath = r.ToFieldPath
references = append(references, ref)
}

Expand Down Expand Up @@ -148,6 +149,7 @@ func (dst *Object) ConvertFrom(srcRaw conversion.Hub) error { // nolint:golint,
FieldPath: r.PatchesFrom.FieldPath,
}
}
ref.ToFieldPath = r.ToFieldPath
references = append(references, ref)
}

Expand Down
4 changes: 4 additions & 0 deletions apis/object/v1alpha1/conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ func TestConvertTo(t *testing.T) {
},
FieldPath: pointer.String("data.password"),
},
ToFieldPath: pointer.String("data"),
},
},
Readiness: v1alpha1.Readiness{Policy: v1alpha1.ReadinessPolicySuccessfulCreate},
Expand Down Expand Up @@ -133,6 +134,7 @@ func TestConvertTo(t *testing.T) {
},
FieldPath: pointer.String("data.password"),
},
ToFieldPath: pointer.String("data"),
},
},
Readiness: v1alpha2.Readiness{Policy: v1alpha2.ReadinessPolicySuccessfulCreate},
Expand Down Expand Up @@ -333,6 +335,7 @@ func TestConvertFrom(t *testing.T) {
},
FieldPath: pointer.String("data.password"),
},
ToFieldPath: pointer.String("data"),
},
},
Readiness: v1alpha2.Readiness{Policy: v1alpha2.ReadinessPolicySuccessfulCreate},
Expand Down Expand Up @@ -378,6 +381,7 @@ func TestConvertFrom(t *testing.T) {
},
FieldPath: pointer.String("data.password"),
},
ToFieldPath: pointer.String("data"),
},
},
Readiness: v1alpha1.Readiness{Policy: v1alpha1.ReadinessPolicySuccessfulCreate},
Expand Down

0 comments on commit c426a17

Please sign in to comment.