Skip to content

Commit

Permalink
Remove conversion-data annotation usage
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Mazzotti <[email protected]>
  • Loading branch information
anmazzotti committed Jan 11, 2024
1 parent f5bccb7 commit 1e24f66
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions controlplane/api/v1beta1/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
unsafe "unsafe"

"k8s.io/apimachinery/pkg/conversion"
utilconversion "sigs.k8s.io/cluster-api/util/conversion"
ctrlconversion "sigs.k8s.io/controller-runtime/pkg/conversion"

bootstrapv1beta1 "github.com/cluster-api-provider-k3s/cluster-api-k3s/bootstrap/api/v1beta1"
Expand Down Expand Up @@ -77,11 +76,6 @@ func (in *KThreesControlPlane) ConvertTo(dstRaw ctrlconversion.Hub) error {
if err := Convert_v1beta1_KThreesControlPlane_To_v1beta2_KThreesControlPlane(in, dst, nil); err != nil {
return fmt.Errorf("converting KThreesControlPlane v1beta1 to v1beta2: %w", err)
}

restored := &cabp3v1.KThreesControlPlane{}
if ok, err := utilconversion.UnmarshalData(in, restored); err != nil || !ok {
return fmt.Errorf("add KThreesControlPlane conversion data v1beta1 to v1beta2: %w", err)
}
return nil
}

Expand All @@ -91,8 +85,5 @@ func (in *KThreesControlPlane) ConvertFrom(srcRaw ctrlconversion.Hub) error {
if err := Convert_v1beta2_KThreesControlPlane_To_v1beta1_KThreesControlPlane(src, in, nil); err != nil {
return fmt.Errorf("converting KThreesControlPlane v1beta1 from v1beta2: %w", err)
}
if err := utilconversion.MarshalData(src, in); err != nil {
return fmt.Errorf("add KThreesControlPlane conversion data v1beta1 from v1beta2: %w", err)
}
return nil
}

0 comments on commit 1e24f66

Please sign in to comment.