-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CAFV-130] Upgrade API to v1beta2 (#374)
* creation of v1beta2 files and conversions for v1beta1 * fix errors in manual conversions * generate crds * fix typos in comments for v1alpha4 conversion files * refactor controllers to use v1beta2 * fix incorrect storageversion on v1beta1 objects * update example cluster manifest * update conversion funcs * marshal and unmarshall pointer * fixing issues introduced by additional api change occuring in the middle of an api upgrade * remove dependent targets from vendor target * fix missing marshal
- Loading branch information
Showing
52 changed files
with
3,176 additions
and
642 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.idea/* | ||
bin/* | ||
out/* | ||
tools/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
// +groupName=infrastructure.cluster.x-k8s.io | ||
// +k8s:conversion-gen=github.com/vmware/cluster-api-provider-cloud-director/api/v1beta1 | ||
// +k8s:conversion-gen=github.com/vmware/cluster-api-provider-cloud-director/api/v1beta2 | ||
package v1alpha4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,44 @@ | ||
package v1alpha4 | ||
|
||
import ( | ||
//"github.com/vmware/cluster-api-provider-cloud-director/api/v1beta1" | ||
"github.com/vmware/cluster-api-provider-cloud-director/api/v1beta1" | ||
"github.com/vmware/cluster-api-provider-cloud-director/api/v1beta2" | ||
utilconversion "sigs.k8s.io/cluster-api/util/conversion" | ||
"sigs.k8s.io/controller-runtime/pkg/conversion" | ||
) | ||
|
||
// ConvertTo converts this (v1alpha4)VCDCluster to the Hub version (v1beta1). | ||
// ConvertTo converts this (v1alpha4) VCDMachineTemplate to the Hub version (v1beta2). | ||
func (src *VCDMachineTemplate) ConvertTo(dstRaw conversion.Hub) error { | ||
dst := dstRaw.(*v1beta1.VCDMachineTemplate) | ||
dst := dstRaw.(*v1beta2.VCDMachineTemplate) | ||
if err := Convert_v1alpha4_VCDMachineTemplate_To_v1beta2_VCDMachineTemplate(src, dst, nil); err != nil { | ||
return err | ||
} | ||
|
||
if err := Convert_v1alpha4_VCDMachineTemplate_To_v1beta1_VCDMachineTemplate(src, dst, nil); err != nil { | ||
restored := &v1beta2.VCDMachineTemplate{} | ||
if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { | ||
return err | ||
} | ||
|
||
return nil | ||
} | ||
|
||
// ConvertFrom converts from the Hub version (v1beta1) to this version (v1alpha4). | ||
// ConvertFrom converts from the Hub version (v1beta2) to this version (v1alpha4). | ||
func (dst *VCDMachineTemplate) ConvertFrom(srcRaw conversion.Hub) error { | ||
src := srcRaw.(*v1beta1.VCDMachineTemplate) | ||
if err := Convert_v1beta1_VCDMachineTemplate_To_v1alpha4_VCDMachineTemplate(src, dst, nil); err != nil { | ||
src := srcRaw.(*v1beta2.VCDMachineTemplate) | ||
if err := Convert_v1beta2_VCDMachineTemplate_To_v1alpha4_VCDMachineTemplate(src, dst, nil); err != nil { | ||
return err | ||
} | ||
// add annotation "cluster.x-k8s.io/conversion-data" and return | ||
return utilconversion.MarshalData(src, dst) | ||
} | ||
|
||
// ConvertTo converts this VCDClusterList to the Hub version (v1beta1). | ||
// ConvertTo converts this VCDMachineTemplateList to the Hub version (v1beta2). | ||
func (src *VCDMachineTemplateList) ConvertTo(dstRaw conversion.Hub) error { | ||
dst := dstRaw.(*v1beta1.VCDMachineTemplateList) | ||
return Convert_v1alpha4_VCDMachineTemplateList_To_v1beta1_VCDMachineTemplateList(src, dst, nil) | ||
dst := dstRaw.(*v1beta2.VCDMachineTemplateList) | ||
return Convert_v1alpha4_VCDMachineTemplateList_To_v1beta2_VCDMachineTemplateList(src, dst, nil) | ||
} | ||
|
||
// ConvertFrom converts from the Hub version (v1beta1) to this version (v1alpha4). | ||
// ConvertFrom converts from the Hub version (v1beta2) to this version (v1alpha4). | ||
func (dst *VCDMachineTemplateList) ConvertFrom(srcRaw conversion.Hub) error { | ||
src := srcRaw.(*v1beta1.VCDMachineTemplateList) | ||
return Convert_v1beta1_VCDMachineTemplateList_To_v1alpha4_VCDMachineTemplateList(src, dst, nil) | ||
src := srcRaw.(*v1beta2.VCDMachineTemplateList) | ||
return Convert_v1beta2_VCDMachineTemplateList_To_v1alpha4_VCDMachineTemplateList(src, dst, nil) | ||
} |
Oops, something went wrong.