diff --git a/go.mod b/go.mod index 3feea776fd2..3ed43bef282 100644 --- a/go.mod +++ b/go.mod @@ -51,10 +51,9 @@ require ( github.com/metal3-io/baremetal-operator/pkg/hardwareutils v0.0.0 github.com/mitchellh/cli v1.1.2 github.com/openshift-metal3/terraform-provider-ironic v0.2.7 - github.com/openshift/api v0.0.0-20211210181228-6e0b1eb97188 + github.com/openshift/api v0.0.0-20220124143425-d74727069f6f github.com/openshift/client-go v0.0.0-20211025111749-96ca2abfc56c github.com/openshift/cloud-credential-operator v0.0.0-20200316201045-d10080b52c9e - github.com/openshift/cluster-api-provider-alibaba v0.0.0-20211123142315-d16daa4e6349 github.com/openshift/cluster-api-provider-baremetal v0.0.0-20210924143856-c2d3ece4da38 github.com/openshift/cluster-api-provider-ibmcloud v0.0.0-20211008100740-4d7907adbd6b github.com/openshift/cluster-api-provider-libvirt v0.2.1-0.20191219173431-2336783d4603 diff --git a/go.sum b/go.sum index 630eeac0506..7dcf1f2aa0d 100644 --- a/go.sum +++ b/go.sum @@ -236,7 +236,6 @@ github.com/alibabacloud-go/tea-utils v1.3.9/go.mod h1:EI/o33aBfj3hETm4RLiAxF/ThQ github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190329064014-6e358769c32a/go.mod h1:T9M45xf79ahXVelWoOBmH0y4aC1t5kXO5BxwyakgIGA= github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190412020505-60e2075261b6/go.mod h1:T9M45xf79ahXVelWoOBmH0y4aC1t5kXO5BxwyakgIGA= github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190620160927-9418d7b0cd0f/go.mod h1:myCDvQSzCW+wB1WAlocEru4wMGJxy+vlxHdhegi1CDQ= -github.com/aliyun/alibaba-cloud-sdk-go v1.61.1153/go.mod h1:pUKYbK5JQ+1Dfxk80P0qxGqe5dkxDoabbZS7zOcouyA= github.com/aliyun/alibaba-cloud-sdk-go v1.61.1154 h1:+6PluSvddiDm8YF4E5LRs8kiXtC1BKCujLi4WrA4Srw= github.com/aliyun/alibaba-cloud-sdk-go v1.61.1154/go.mod h1:pUKYbK5JQ+1Dfxk80P0qxGqe5dkxDoabbZS7zOcouyA= github.com/aliyun/aliyun-datahub-sdk-go v0.1.5 h1:c2TFcJ5PjkqkHr2use7Av2wHB8jVgoKxX1gmLDsysR4= @@ -1519,8 +1518,8 @@ github.com/openshift/api v0.0.0-20210816181336-8ff39b776da3/go.mod h1:x81TFA31x1 github.com/openshift/api v0.0.0-20211025104849-a11323ccb6ea/go.mod h1:RsQCVJu4qhUawxxDP7pGlwU3IA4F01wYm3qKEu29Su8= github.com/openshift/api v0.0.0-20211108165917-be1be0e89115/go.mod h1:RsQCVJu4qhUawxxDP7pGlwU3IA4F01wYm3qKEu29Su8= github.com/openshift/api v0.0.0-20211209135129-c58d9f695577/go.mod h1:DoslCwtqUpr3d/gsbq4ZlkaMEdYqKxuypsDjorcHhME= -github.com/openshift/api v0.0.0-20211210181228-6e0b1eb97188 h1:Z9UVScJKlWgNTvFzjkbZlEX3UzptTki2RwzaLaLjnFA= -github.com/openshift/api v0.0.0-20211210181228-6e0b1eb97188/go.mod h1:DoslCwtqUpr3d/gsbq4ZlkaMEdYqKxuypsDjorcHhME= +github.com/openshift/api v0.0.0-20220124143425-d74727069f6f h1:iOTv1WudhVm2UsoST+L+ZrA5A9w57h9vmQsdlBuqG6g= +github.com/openshift/api v0.0.0-20220124143425-d74727069f6f/go.mod h1:F/eU6jgr6Q2VhMu1mSpMmygxAELd7+BUxs3NHZ25jV4= github.com/openshift/baremetal-operator v0.0.0-20211201170610-92ffa60c683d h1:4KkYItiWENIs2bV6lKOcIMdWUnZJA+GWT9Us7z0P1UA= github.com/openshift/baremetal-operator v0.0.0-20211201170610-92ffa60c683d/go.mod h1:p32F1DBUxfgd0JjM4rCuhJomFJokEoWR1Z/LZNL2LM8= github.com/openshift/baremetal-operator/apis v0.0.0-20211201170610-92ffa60c683d h1:DHGXCvXWsPExutf3tgQYD4TVDSAOviLXO7Vnc42oXhw= @@ -1533,6 +1532,7 @@ github.com/openshift/build-machinery-go v0.0.0-20200819073603-48aa266c95f7/go.mo github.com/openshift/build-machinery-go v0.0.0-20200917070002-f171684f77ab/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE= github.com/openshift/build-machinery-go v0.0.0-20210209125900-0da259a2c359/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE= github.com/openshift/build-machinery-go v0.0.0-20210712174854-1bb7fd1518d3/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE= +github.com/openshift/build-machinery-go v0.0.0-20211213093930-7e33a7eb4ce3/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE= github.com/openshift/client-go v0.0.0-20211209144617-7385dd6338e3 h1:SG1aqwleU6bGD0X4mhkTNupjVnByMYYuW4XbnCPavQU= github.com/openshift/client-go v0.0.0-20211209144617-7385dd6338e3/go.mod h1:cwhyki5lqBmrT0m8Im+9I7PGFaraOzcYPtEz93RcsGY= github.com/openshift/cloud-credential-operator v0.0.0-20200316201045-d10080b52c9e h1:2gyl9UVyjHSWzdS56KUXxQwIhENbq2x2olqoMQSA/C8= @@ -1540,8 +1540,6 @@ github.com/openshift/cloud-credential-operator v0.0.0-20200316201045-d10080b52c9 github.com/openshift/cluster-api v0.0.0-20190805113604-f8de78af80fc h1:6Nf3TaiooyEZNk+3ZHonNOujT+HacuSj9cxyeGTc/zg= github.com/openshift/cluster-api v0.0.0-20190805113604-f8de78af80fc/go.mod h1:mNsD1dsD4T57kV4/C6zTHke/Ro166xgnyyRZqkamiEU= github.com/openshift/cluster-api-actuator-pkg v0.0.0-20190614215203-42228d06a2ca/go.mod h1:KNPaA64x3Ok7z538kvS2acwC5fEwvPfF0RdTx2geQEE= -github.com/openshift/cluster-api-provider-alibaba v0.0.0-20211123142315-d16daa4e6349 h1:xBbz4HEyLoofwK9r5KUyOuoOsadqjcydibtb+aPzY0A= -github.com/openshift/cluster-api-provider-alibaba v0.0.0-20211123142315-d16daa4e6349/go.mod h1:vJHKJg2+CEt1wmawpkFrg1IRlgyeaaGtzz76IM/z2os= github.com/openshift/cluster-api-provider-aws v0.2.1-0.20210121023454-5ffc5f422a80 h1:fFHoy/1QCLUcfo/NceEM8jGY2Tafl1BmyLa7tReN328= github.com/openshift/cluster-api-provider-aws v0.2.1-0.20210121023454-5ffc5f422a80/go.mod h1:JV7aXj/LZ8B4MwIQdhGxpTO2PCG8+7UKFd6FaOZCSzA= github.com/openshift/cluster-api-provider-azure v0.1.0-alpha.3.0.20210626224711-5d94c794092f/go.mod h1:GR+ocB8I+Z7JTSBdO+DMu/diBfH66lRlRpnc1KWysUM= @@ -1583,7 +1581,6 @@ github.com/openshift/machine-api-operator v0.2.1-0.20201002104344-6abfb5440597/g github.com/openshift/machine-api-operator v0.2.1-0.20210104142355-8e6ae0acdfcf/go.mod h1:U5eAHChde1XvtQy3s1Zcr7ll4X7heb0SzYpaiAwxmQc= github.com/openshift/machine-api-operator v0.2.1-0.20210504014029-a132ec00f7dd/go.mod h1:DFZBMPtC2TYZH5NE9+2JQIpbZAnruqc9F26QmbOm9pw= github.com/openshift/machine-api-operator v0.2.1-0.20210820103535-d50698c302f5/go.mod h1:ko7xmso6c25h9UL6Ai0I5l+6OgyVf+ebinAYXnwlGNg= -github.com/openshift/machine-api-operator v0.2.1-0.20211102083422-ee77ca7b9fd1/go.mod h1:8kWuB/zhnlBsNOyD1yz0epINZX5IodG3Z4iDwQrYKx0= github.com/openshift/machine-api-operator v0.2.1-0.20211111133920-c8bba3e64310/go.mod h1:8kWuB/zhnlBsNOyD1yz0epINZX5IodG3Z4iDwQrYKx0= github.com/openshift/machine-config-operator v0.0.1-0.20201009041932-4fe8559913b8 h1:C4gCipkWTDp0B9jb0wZdLgB+HWC7EzVVwQOeNaKnTRA= github.com/openshift/machine-config-operator v0.0.1-0.20201009041932-4fe8559913b8/go.mod h1:fjKreLaKEeUKsyIkT4wlzIQwUVJ2ZKDUh3CI73ckYIY= diff --git a/pkg/asset/cluster/tfvars.go b/pkg/asset/cluster/tfvars.go index 418c4050e3d..0e9cdd05b6d 100644 --- a/pkg/asset/cluster/tfvars.go +++ b/pkg/asset/cluster/tfvars.go @@ -10,7 +10,6 @@ import ( igntypes "github.com/coreos/ignition/v2/config/v3_2/types" coreosarch "github.com/coreos/stream-metadata-go/arch" "github.com/ghodss/yaml" - alibabacloudprovider "github.com/openshift/cluster-api-provider-alibaba/pkg/apis/alibabacloudprovider/v1beta1" ibmcloudprovider "github.com/openshift/cluster-api-provider-ibmcloud/pkg/apis/ibmcloudprovider/v1beta1" libvirtprovider "github.com/openshift/cluster-api-provider-libvirt/pkg/apis/libvirtproviderconfig/v1beta1" ovirtprovider "github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider/v1beta1" @@ -19,7 +18,8 @@ import ( awsprovider "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsprovider/v1beta1" configv1 "github.com/openshift/api/config/v1" - machinev1 "github.com/openshift/api/machine/v1beta1" + machinev1 "github.com/openshift/api/machine/v1" + machinev1beta1 "github.com/openshift/api/machine/v1beta1" "github.com/openshift/installer/pkg/asset" "github.com/openshift/installer/pkg/asset/ignition" "github.com/openshift/installer/pkg/asset/ignition/bootstrap" @@ -309,17 +309,17 @@ func (t *TerraformVariables) Generate(parents asset.Parents) error { if err != nil { return err } - masterConfigs := make([]*machinev1.AzureMachineProviderSpec, len(masters)) + masterConfigs := make([]*machinev1beta1.AzureMachineProviderSpec, len(masters)) for i, m := range masters { - masterConfigs[i] = m.Spec.ProviderSpec.Value.Object.(*machinev1.AzureMachineProviderSpec) + masterConfigs[i] = m.Spec.ProviderSpec.Value.Object.(*machinev1beta1.AzureMachineProviderSpec) } workers, err := workersAsset.MachineSets() if err != nil { return err } - workerConfigs := make([]*machinev1.AzureMachineProviderSpec, len(workers)) + workerConfigs := make([]*machinev1beta1.AzureMachineProviderSpec, len(workers)) for i, w := range workers { - workerConfigs[i] = w.Spec.Template.Spec.ProviderSpec.Value.Object.(*machinev1.AzureMachineProviderSpec) + workerConfigs[i] = w.Spec.Template.Spec.ProviderSpec.Value.Object.(*machinev1beta1.AzureMachineProviderSpec) } preexistingnetwork := installConfig.Config.Azure.VirtualNetwork != "" @@ -375,17 +375,17 @@ func (t *TerraformVariables) Generate(parents asset.Parents) error { if err != nil { return err } - masterConfigs := make([]*machinev1.GCPMachineProviderSpec, len(masters)) + masterConfigs := make([]*machinev1beta1.GCPMachineProviderSpec, len(masters)) for i, m := range masters { - masterConfigs[i] = m.Spec.ProviderSpec.Value.Object.(*machinev1.GCPMachineProviderSpec) + masterConfigs[i] = m.Spec.ProviderSpec.Value.Object.(*machinev1beta1.GCPMachineProviderSpec) } workers, err := workersAsset.MachineSets() if err != nil { return err } - workerConfigs := make([]*machinev1.GCPMachineProviderSpec, len(workers)) + workerConfigs := make([]*machinev1beta1.GCPMachineProviderSpec, len(workers)) for i, w := range workers { - workerConfigs[i] = w.Spec.Template.Spec.ProviderSpec.Value.Object.(*machinev1.GCPMachineProviderSpec) + workerConfigs[i] = w.Spec.Template.Spec.ProviderSpec.Value.Object.(*machinev1beta1.GCPMachineProviderSpec) } if installConfig.Config.Publish == types.ExternalPublishingStrategy { publicZone, err := gcpconfig.GetPublicZone(ctx, installConfig.Config.GCP.ProjectID, installConfig.Config.BaseDomain) @@ -677,9 +677,9 @@ func (t *TerraformVariables) Generate(parents asset.Parents) error { if err != nil { return err } - controlPlaneConfigs := make([]*machinev1.VSphereMachineProviderSpec, len(controlPlanes)) + controlPlaneConfigs := make([]*machinev1beta1.VSphereMachineProviderSpec, len(controlPlanes)) for i, c := range controlPlanes { - controlPlaneConfigs[i] = c.Spec.ProviderSpec.Value.Object.(*machinev1.VSphereMachineProviderSpec) + controlPlaneConfigs[i] = c.Spec.ProviderSpec.Value.Object.(*machinev1beta1.VSphereMachineProviderSpec) } // Set this flag to use an existing folder specified in the install-config. Otherwise, create one. @@ -724,17 +724,17 @@ func (t *TerraformVariables) Generate(parents asset.Parents) error { if err != nil { return errors.Wrapf(err, "failed to get master machine info") } - masterConfigs := make([]*alibabacloudprovider.AlibabaCloudMachineProviderConfig, len(masters)) + masterConfigs := make([]*machinev1.AlibabaCloudMachineProviderConfig, len(masters)) for i, m := range masters { - masterConfigs[i] = m.Spec.ProviderSpec.Value.Object.(*alibabacloudprovider.AlibabaCloudMachineProviderConfig) + masterConfigs[i] = m.Spec.ProviderSpec.Value.Object.(*machinev1.AlibabaCloudMachineProviderConfig) } workers, err := workersAsset.MachineSets() if err != nil { return errors.Wrapf(err, "failed to get worker machine info") } - workerConfigs := make([]*alibabacloudprovider.AlibabaCloudMachineProviderConfig, len(workers)) + workerConfigs := make([]*machinev1.AlibabaCloudMachineProviderConfig, len(workers)) for i, w := range workers { - workerConfigs[i] = w.Spec.Template.Spec.ProviderSpec.Value.Object.(*alibabacloudprovider.AlibabaCloudMachineProviderConfig) + workerConfigs[i] = w.Spec.Template.Spec.ProviderSpec.Value.Object.(*machinev1.AlibabaCloudMachineProviderConfig) } natGatewayZones, err := client.ListEnhanhcedNatGatewayAvailableZones() diff --git a/pkg/asset/machines/alibabacloud/machines.go b/pkg/asset/machines/alibabacloud/machines.go index ded71f073a4..4e1719ca7d9 100644 --- a/pkg/asset/machines/alibabacloud/machines.go +++ b/pkg/asset/machines/alibabacloud/machines.go @@ -4,8 +4,9 @@ package alibabacloud import ( "fmt" - machineapi "github.com/openshift/api/machine/v1beta1" - alibabacloudprovider "github.com/openshift/cluster-api-provider-alibaba/pkg/apis/alibabacloudprovider/v1beta1" + machinev1 "github.com/openshift/api/machine/v1" + machinev1beta1 "github.com/openshift/api/machine/v1beta1" + "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -17,7 +18,7 @@ import ( ) // Machines returns a list of machines for a machinepool. -func Machines(clusterID string, config *types.InstallConfig, pool *types.MachinePool, role, userDataSecret string, resourceTags map[string]string, vswitchMaps map[string]string) ([]machineapi.Machine, error) { +func Machines(clusterID string, config *types.InstallConfig, pool *types.MachinePool, role, userDataSecret string, resourceTags map[string]string, vswitchMaps map[string]string) ([]machinev1beta1.Machine, error) { if configPlatform := config.Platform.Name(); configPlatform != alibabacloud.Name { return nil, fmt.Errorf("non-AlibabaCloud configuration: %q", configPlatform) } @@ -33,7 +34,7 @@ func Machines(clusterID string, config *types.InstallConfig, pool *types.Machine total = *pool.Replicas } - var machines []machineapi.Machine + var machines []machinev1beta1.Machine for idx := int64(0); idx < total; idx++ { zoneID := azs[int(idx)%len(azs)] vswitchID := vswitchMaps[zoneID] @@ -41,7 +42,7 @@ func Machines(clusterID string, config *types.InstallConfig, pool *types.Machine if err != nil { return nil, errors.Wrap(err, "failed to create provider") } - machine := machineapi.Machine{ + machine := machinev1beta1.Machine{ TypeMeta: metav1.TypeMeta{ APIVersion: "machine.openshift.io/v1beta1", Kind: "Machine", @@ -55,8 +56,8 @@ func Machines(clusterID string, config *types.InstallConfig, pool *types.Machine "machine.openshift.io/cluster-api-machine-type": role, }, }, - Spec: machineapi.MachineSpec{ - ProviderSpec: machineapi.ProviderSpec{ + Spec: machinev1beta1.MachineSpec{ + ProviderSpec: machinev1beta1.ProviderSpec{ Value: &runtime.RawExtension{Object: provider}, }, }, @@ -75,32 +76,33 @@ func provider(clusterID string, userDataSecret string, resourceTags map[string]string, vswitchID string, -) (*alibabacloudprovider.AlibabaCloudMachineProviderConfig, error) { +) (*machinev1.AlibabaCloudMachineProviderConfig, error) { tags, err := tagsFromResourceTags(clusterID, resourceTags) if err != nil { return nil, errors.Wrap(err, "failed to create alibabacloudprovider.Tag from Tags") } - sgResourceRef := []alibabacloudprovider.AlibabaResourceReference{ + sgTags := append(tags, machinev1.Tag{ + Key: "Name", + Value: fmt.Sprintf("%s-sg-%s", clusterID, role), + }) + sgResourceRef := []machinev1.AlibabaResourceReference{ { - Tags: append(tags, alibabacloudprovider.Tag{ - Key: "Name", - Value: fmt.Sprintf("%s-sg-%s", clusterID, role), - }), + Type: machinev1.AlibabaResourceReferenceTypeTags, + Tags: &sgTags, }, } - config := &alibabacloudprovider.AlibabaCloudMachineProviderConfig{ + config := &machinev1.AlibabaCloudMachineProviderConfig{ TypeMeta: metav1.TypeMeta{ - APIVersion: "alibabacloudmachineproviderconfig.openshift.io/v1beta1", + APIVersion: "machine.openshift.io/v1", Kind: "AlibabaCloudMachineProviderConfig", }, ImageID: mpool.ImageID, InstanceType: mpool.InstanceType, - SystemDisk: alibabacloudprovider.SystemDiskProperties{ + SystemDisk: machinev1.SystemDiskProperties{ Category: string(mpool.SystemDiskCategory), - Size: mpool.SystemDiskSize, + Size: int64(mpool.SystemDiskSize), }, RegionID: platform.Region, - ResourceGroupID: platform.ResourceGroupID, ZoneID: zoneID, UserDataSecret: &corev1.LocalObjectReference{Name: userDataSecret}, CredentialsSecret: &corev1.LocalObjectReference{Name: "alibabacloud-credentials"}, @@ -108,18 +110,40 @@ func provider(clusterID string, RAMRoleName: fmt.Sprintf("%s-role-%s", clusterID, role), SecurityGroups: sgResourceRef, } - config.VSwitch = alibabacloudprovider.AlibabaResourceReference{ - ID: vswitchID, - Tags: append(tags, alibabacloudprovider.Tag{ + + if platform.ResourceGroupID != "" { + config.ResourceGroup = machinev1.AlibabaResourceReference{ + Type: machinev1.AlibabaResourceReferenceTypeID, + ID: &platform.ResourceGroupID, + } + } else { + rgname := platform.ClusterResourceGroupName(clusterID) + config.ResourceGroup = machinev1.AlibabaResourceReference{ + Type: machinev1.AlibabaResourceReferenceTypeName, + Name: &rgname, + } + } + + if vswitchID != "" { + config.VSwitch = machinev1.AlibabaResourceReference{ + Type: machinev1.AlibabaResourceReferenceTypeID, + ID: &vswitchID, + } + } else { + vstags := append(tags, machinev1.Tag{ Key: "Name", Value: fmt.Sprintf("%s-vswitch-%s", clusterID, zoneID), - }), + }) + config.VSwitch = machinev1.AlibabaResourceReference{ + Type: machinev1.AlibabaResourceReferenceTypeTags, + Tags: &vstags, + } } return config, nil } -func tagsFromResourceTags(clusterID string, resourceTags map[string]string) ([]alibabacloudprovider.Tag, error) { - tags := []alibabacloudprovider.Tag{ +func tagsFromResourceTags(clusterID string, resourceTags map[string]string) ([]machinev1.Tag, error) { + tags := []machinev1.Tag{ {Key: fmt.Sprintf("kubernetes.io/cluster/%s", clusterID), Value: "owned"}, {Key: "GISV", Value: "ocp"}, {Key: "sigs.k8s.io/cloud-provider-alibaba/origin", Value: "ocp"}, @@ -132,7 +156,7 @@ func tagsFromResourceTags(clusterID string, resourceTags map[string]string) ([]a if forbiddenTags.Has(k) { return nil, fmt.Errorf("user tags may not clobber %s", k) } - tags = append(tags, alibabacloudprovider.Tag{Key: k, Value: v}) + tags = append(tags, machinev1.Tag{Key: k, Value: v}) } return tags, nil } diff --git a/pkg/asset/machines/alibabacloud/machinesets.go b/pkg/asset/machines/alibabacloud/machinesets.go index fec33977b53..ac807d0f13b 100644 --- a/pkg/asset/machines/alibabacloud/machinesets.go +++ b/pkg/asset/machines/alibabacloud/machinesets.go @@ -8,13 +8,13 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - machineapi "github.com/openshift/api/machine/v1beta1" + machinev1beta1 "github.com/openshift/api/machine/v1beta1" "github.com/openshift/installer/pkg/types" "github.com/openshift/installer/pkg/types/alibabacloud" ) // MachineSets returns a list of machinesets for a machinepool. -func MachineSets(clusterID string, config *types.InstallConfig, pool *types.MachinePool, role, userDataSecret string, resourceTags map[string]string, vswitchMaps map[string]string) ([]*machineapi.MachineSet, error) { +func MachineSets(clusterID string, config *types.InstallConfig, pool *types.MachinePool, role, userDataSecret string, resourceTags map[string]string, vswitchMaps map[string]string) ([]*machinev1beta1.MachineSet, error) { if configPlatform := config.Platform.Name(); configPlatform != alibabacloud.Name { return nil, fmt.Errorf("non-AlibabaCloud configuration: %q", configPlatform) } @@ -30,7 +30,7 @@ func MachineSets(clusterID string, config *types.InstallConfig, pool *types.Mach total = *pool.Replicas } numOfAZs := int64(len(azs)) - var machinesets []*machineapi.MachineSet + var machinesets []*machinev1beta1.MachineSet for idx, az := range azs { replicas := int32(total / numOfAZs) if int64(idx) < total%numOfAZs { @@ -46,7 +46,7 @@ func MachineSets(clusterID string, config *types.InstallConfig, pool *types.Mach return nil, errors.Wrap(err, "failed to create provider") } name := fmt.Sprintf("%s-%s-%s", clusterID, pool.Name, strings.TrimPrefix(az, fmt.Sprintf("%s-", platform.Region))) - mset := &machineapi.MachineSet{ + mset := &machinev1beta1.MachineSet{ TypeMeta: metav1.TypeMeta{ APIVersion: "machine.openshift.io/v1beta1", Kind: "MachineSet", @@ -58,7 +58,7 @@ func MachineSets(clusterID string, config *types.InstallConfig, pool *types.Mach "machine.openshift.io/cluster-api-cluster": clusterID, }, }, - Spec: machineapi.MachineSetSpec{ + Spec: machinev1beta1.MachineSetSpec{ Replicas: &replicas, Selector: metav1.LabelSelector{ MatchLabels: map[string]string{ @@ -66,8 +66,8 @@ func MachineSets(clusterID string, config *types.InstallConfig, pool *types.Mach "machine.openshift.io/cluster-api-cluster": clusterID, }, }, - Template: machineapi.MachineTemplateSpec{ - ObjectMeta: machineapi.ObjectMeta{ + Template: machinev1beta1.MachineTemplateSpec{ + ObjectMeta: machinev1beta1.ObjectMeta{ Labels: map[string]string{ "machine.openshift.io/cluster-api-machineset": name, "machine.openshift.io/cluster-api-cluster": clusterID, @@ -75,8 +75,8 @@ func MachineSets(clusterID string, config *types.InstallConfig, pool *types.Mach "machine.openshift.io/cluster-api-machine-type": role, }, }, - Spec: machineapi.MachineSpec{ - ProviderSpec: machineapi.ProviderSpec{ + Spec: machinev1beta1.MachineSpec{ + ProviderSpec: machinev1beta1.ProviderSpec{ Value: &runtime.RawExtension{Object: provider}, }, }, diff --git a/pkg/asset/machines/master.go b/pkg/asset/machines/master.go index 313965f8045..dd7fa2cca63 100644 --- a/pkg/asset/machines/master.go +++ b/pkg/asset/machines/master.go @@ -9,9 +9,8 @@ import ( "github.com/ghodss/yaml" baremetalhost "github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1" - machineapi "github.com/openshift/api/machine/v1beta1" - alibabacloudapi "github.com/openshift/cluster-api-provider-alibaba/pkg/apis" - alibabacloudprovider "github.com/openshift/cluster-api-provider-alibaba/pkg/apis/alibabacloudprovider/v1beta1" + machinev1 "github.com/openshift/api/machine/v1" + machinev1beta1 "github.com/openshift/api/machine/v1beta1" baremetalapi "github.com/openshift/cluster-api-provider-baremetal/pkg/apis" baremetalprovider "github.com/openshift/cluster-api-provider-baremetal/pkg/apis/baremetal/v1alpha1" ibmcloudapi "github.com/openshift/cluster-api-provider-ibmcloud/pkg/apis" @@ -161,7 +160,7 @@ func (m *Master) Generate(dependencies asset.Parents) error { pool := *ic.ControlPlane var err error - machines := []machineapi.Machine{} + machines := []machinev1beta1.Machine{} switch ic.Platform.Name() { case alibabacloudtypes.Name: client, err := installConfig.AlibabaCloud.Client() @@ -543,35 +542,37 @@ func (m *Master) Load(f asset.FileFetcher) (found bool, err error) { } // Machines returns master Machine manifest structures. -func (m *Master) Machines() ([]machineapi.Machine, error) { +func (m *Master) Machines() ([]machinev1beta1.Machine, error) { scheme := runtime.NewScheme() - alibabacloudapi.AddToScheme(scheme) awsapi.AddToScheme(scheme) baremetalapi.AddToScheme(scheme) ibmcloudapi.AddToScheme(scheme) libvirtapi.AddToScheme(scheme) openstackapi.AddToScheme(scheme) ovirtproviderapi.AddToScheme(scheme) - scheme.AddKnownTypes(machineapi.SchemeGroupVersion, - &machineapi.VSphereMachineProviderSpec{}, - &machineapi.AzureMachineProviderSpec{}, - &machineapi.GCPMachineProviderSpec{}, + scheme.AddKnownTypes(machinev1beta1.SchemeGroupVersion, + &machinev1beta1.VSphereMachineProviderSpec{}, + &machinev1beta1.AzureMachineProviderSpec{}, + &machinev1beta1.GCPMachineProviderSpec{}, ) - machineapi.AddToScheme(scheme) + scheme.AddKnownTypes(machinev1.GroupVersion, + &machinev1.AlibabaCloudMachineProviderConfig{}, + ) + machinev1beta1.AddToScheme(scheme) decoder := serializer.NewCodecFactory(scheme).UniversalDecoder( - alibabacloudprovider.SchemeGroupVersion, + machinev1.GroupVersion, awsprovider.SchemeGroupVersion, baremetalprovider.SchemeGroupVersion, ibmcloudprovider.SchemeGroupVersion, libvirtprovider.SchemeGroupVersion, openstackprovider.SchemeGroupVersion, - machineapi.SchemeGroupVersion, + machinev1beta1.SchemeGroupVersion, ovirtprovider.SchemeGroupVersion, ) - machines := []machineapi.Machine{} + machines := []machinev1beta1.Machine{} for i, file := range m.MachineFiles { - machine := &machineapi.Machine{} + machine := &machinev1beta1.Machine{} err := yaml.Unmarshal(file.Data, &machine) if err != nil { return machines, errors.Wrapf(err, "unmarshal master %d", i) diff --git a/pkg/asset/machines/worker.go b/pkg/asset/machines/worker.go index 8cc693d68bd..22b0680750e 100644 --- a/pkg/asset/machines/worker.go +++ b/pkg/asset/machines/worker.go @@ -8,9 +8,8 @@ import ( "strings" "github.com/ghodss/yaml" - machineapi "github.com/openshift/api/machine/v1beta1" - alibabacloudapi "github.com/openshift/cluster-api-provider-alibaba/pkg/apis" - alibabacloudprovider "github.com/openshift/cluster-api-provider-alibaba/pkg/apis/alibabacloudprovider/v1beta1" + machinev1 "github.com/openshift/api/machine/v1" + machinev1beta1 "github.com/openshift/api/machine/v1beta1" baremetalapi "github.com/openshift/cluster-api-provider-baremetal/pkg/apis" baremetalprovider "github.com/openshift/cluster-api-provider-baremetal/pkg/apis/baremetal/v1alpha1" ibmcloudapi "github.com/openshift/cluster-api-provider-ibmcloud/pkg/apis" @@ -562,35 +561,37 @@ func (w *Worker) Load(f asset.FileFetcher) (found bool, err error) { } // MachineSets returns MachineSet manifest structures. -func (w *Worker) MachineSets() ([]machineapi.MachineSet, error) { +func (w *Worker) MachineSets() ([]machinev1beta1.MachineSet, error) { scheme := runtime.NewScheme() - alibabacloudapi.AddToScheme(scheme) awsapi.AddToScheme(scheme) baremetalapi.AddToScheme(scheme) ibmcloudapi.AddToScheme(scheme) libvirtapi.AddToScheme(scheme) openstackapi.AddToScheme(scheme) ovirtproviderapi.AddToScheme(scheme) - scheme.AddKnownTypes(machineapi.SchemeGroupVersion, - &machineapi.VSphereMachineProviderSpec{}, - &machineapi.AzureMachineProviderSpec{}, - &machineapi.GCPMachineProviderSpec{}, + scheme.AddKnownTypes(machinev1beta1.SchemeGroupVersion, + &machinev1beta1.VSphereMachineProviderSpec{}, + &machinev1beta1.AzureMachineProviderSpec{}, + &machinev1beta1.GCPMachineProviderSpec{}, ) - machineapi.AddToScheme(scheme) + scheme.AddKnownTypes(machinev1.GroupVersion, + &machinev1.AlibabaCloudMachineProviderConfig{}, + ) + machinev1beta1.AddToScheme(scheme) decoder := serializer.NewCodecFactory(scheme).UniversalDecoder( - alibabacloudprovider.SchemeGroupVersion, awsprovider.SchemeGroupVersion, baremetalprovider.SchemeGroupVersion, ibmcloudprovider.SchemeGroupVersion, libvirtprovider.SchemeGroupVersion, openstackprovider.SchemeGroupVersion, ovirtprovider.SchemeGroupVersion, - machineapi.SchemeGroupVersion, + machinev1beta1.SchemeGroupVersion, + machinev1.GroupVersion, ) - machineSets := []machineapi.MachineSet{} + machineSets := []machinev1beta1.MachineSet{} for i, file := range w.MachineSetFiles { - machineSet := &machineapi.MachineSet{} + machineSet := &machinev1beta1.MachineSet{} err := yaml.Unmarshal(file.Data, &machineSet) if err != nil { return machineSets, errors.Wrapf(err, "unmarshal worker %d", i) diff --git a/pkg/tfvars/alibabacloud/alibabacloud.go b/pkg/tfvars/alibabacloud/alibabacloud.go index 4857e1ba8c5..9bcef811bad 100644 --- a/pkg/tfvars/alibabacloud/alibabacloud.go +++ b/pkg/tfvars/alibabacloud/alibabacloud.go @@ -4,7 +4,7 @@ import ( "encoding/json" "fmt" - alibabacloudprovider "github.com/openshift/cluster-api-provider-alibaba/pkg/apis/alibabacloudprovider/v1beta1" + machinev1 "github.com/openshift/api/machine/v1" "github.com/openshift/installer/pkg/asset/ignition/bootstrap" "github.com/openshift/installer/pkg/types" "github.com/pkg/errors" @@ -45,8 +45,8 @@ type TFVarsSources struct { ResourceGroupID string BaseDomain string NatGatewayZoneID string - MasterConfigs []*alibabacloudprovider.AlibabaCloudMachineProviderConfig - WorkerConfigs []*alibabacloudprovider.AlibabaCloudMachineProviderConfig + MasterConfigs []*machinev1.AlibabaCloudMachineProviderConfig + WorkerConfigs []*machinev1.AlibabaCloudMachineProviderConfig IgnitionBucket string IgnitionPresignedURL string Publish types.PublishingStrategy @@ -92,7 +92,7 @@ func TFVars(sources TFVarsSources) ([]byte, error) { BootstrapInstanceType: masterConfig.InstanceType, MasterInstanceType: masterConfig.InstanceType, ImageID: masterConfig.ImageID, - SystemDiskSize: masterConfig.SystemDisk.Size, + SystemDiskSize: int(masterConfig.SystemDisk.Size), SystemDiskCategory: masterConfig.SystemDisk.Category, ExtraTags: tags, IgnitionBucket: sources.IgnitionBucket, diff --git a/pkg/types/alibabacloud/platform.go b/pkg/types/alibabacloud/platform.go index 75bf8423e56..b38215a0ebf 100644 --- a/pkg/types/alibabacloud/platform.go +++ b/pkg/types/alibabacloud/platform.go @@ -1,5 +1,7 @@ package alibabacloud +import "fmt" + // Platform stores all the global configuration that all machinesets use. type Platform struct { // Region specifies the Alibaba Cloud region where the cluster will be created. @@ -42,3 +44,8 @@ type Platform struct { // +optional DefaultMachinePlatform *MachinePool `json:"defaultMachinePlatform,omitempty"` } + +// ClusterResourceGroupName returns the name of the resource group for the cluster. +func (p *Platform) ClusterResourceGroupName(clusterID string) string { + return fmt.Sprintf("%s-rg", clusterID) +} diff --git a/tmp/simple_log.log b/tmp/simple_log.log new file mode 100644 index 00000000000..e69de29bb2d diff --git a/vendor/github.com/openshift/api/config/v1/0000_10_config-operator_01_infrastructure.crd.yaml b/vendor/github.com/openshift/api/config/v1/0000_10_config-operator_01_infrastructure.crd.yaml index 60b30a86562..6be6c681292 100644 --- a/vendor/github.com/openshift/api/config/v1/0000_10_config-operator_01_infrastructure.crd.yaml +++ b/vendor/github.com/openshift/api/config/v1/0000_10_config-operator_01_infrastructure.crd.yaml @@ -210,7 +210,7 @@ spec: resourceGroupID: description: resourceGroupID is the ID of the resource group for the cluster. type: string - pattern: ^rg-[0-9A-Za-z]+$ + pattern: ^(rg-[0-9A-Za-z]+)?$ resourceTags: description: resourceTags is a list of additional tags to apply to Alibaba Cloud resources created for the cluster. type: array diff --git a/vendor/github.com/openshift/api/config/v1/types_feature.go b/vendor/github.com/openshift/api/config/v1/types_feature.go index 149cf8e6f60..032673069f9 100644 --- a/vendor/github.com/openshift/api/config/v1/types_feature.go +++ b/vendor/github.com/openshift/api/config/v1/types_feature.go @@ -121,7 +121,6 @@ var FeatureSets = map[FeatureSet]*FeatureGateEnabledDisabled{ with("CSIMigrationAzureFile"). // sig-storage, fbertina, Kubernetes feature gate with("CSIMigrationvSphere"). // sig-storage, fbertina, Kubernetes feature gate with("ExternalCloudProvider"). // sig-cloud-provider, jspeed, OCP specific - with("InsightsOperatorPullingSCA"). // insights-operator/ccx, tremes, OCP specific with("CSIDriverSharedResource"). // sig-build, adkaplan, OCP specific with("BuildCSIVolumes"). // sig-build, adkaplan, OCP specific with("NodeSwap"). // sig-node, ehashman, Kubernetes feature gate @@ -143,14 +142,16 @@ var defaultFeatures = &FeatureGateEnabledDisabled{ Enabled: []string{ "APIPriorityAndFairness", // sig-apimachinery, deads2k "RotateKubeletServerCertificate", // sig-pod, sjenning - "SupportPodPidsLimit", // sig-pod, sjenning - "NodeDisruptionExclusion", // sig-scheduling, ccoleman - "ServiceNodeExclusion", // sig-scheduling, ccoleman "DownwardAPIHugePages", // sig-node, rphillips "PodSecurity", // sig-auth, s-urbaniak }, Disabled: []string{ - "LegacyNodeRoleBehavior", // sig-scheduling, ccoleman + "CSIMigrationAWS", // sig-storage, jsafrane + "CSIMigrationOpenStack", // sig-storage, jsafrane + "CSIMigrationGCE", // sig-storage, jsafrane + "CSIMigrationAzureDisk", // sig-storage, jsafrane + "CSIMigrationAzureFile", // sig-storage, jsafrane + "CSIMigrationvSphere", // sig-storage, jsafrane }, } diff --git a/vendor/github.com/openshift/api/config/v1/types_infrastructure.go b/vendor/github.com/openshift/api/config/v1/types_infrastructure.go index 016b1a3f9c3..fe42bec8394 100644 --- a/vendor/github.com/openshift/api/config/v1/types_infrastructure.go +++ b/vendor/github.com/openshift/api/config/v1/types_infrastructure.go @@ -665,7 +665,7 @@ type AlibabaCloudPlatformStatus struct { // +required Region string `json:"region"` // resourceGroupID is the ID of the resource group for the cluster. - // +kubebuilder:validation:Pattern=`^rg-[0-9A-Za-z]+$` + // +kubebuilder:validation:Pattern=`^(rg-[0-9A-Za-z]+)?$` // +optional ResourceGroupID string `json:"resourceGroupID,omitempty"` // resourceTags is a list of additional tags to apply to Alibaba Cloud resources created for the cluster. diff --git a/vendor/github.com/openshift/api/machine/v1/common.go b/vendor/github.com/openshift/api/machine/v1/common.go new file mode 100644 index 00000000000..941d22b1cc1 --- /dev/null +++ b/vendor/github.com/openshift/api/machine/v1/common.go @@ -0,0 +1,13 @@ +package v1 + +// InstanceTenancy indicates if instance should run on shared or single-tenant hardware. +type InstanceTenancy string + +const ( + // DefaultTenancy instance runs on shared hardware + DefaultTenancy InstanceTenancy = "default" + // DedicatedTenancy instance runs on single-tenant hardware + DedicatedTenancy InstanceTenancy = "dedicated" + // HostTenancy instance runs on a Dedicated Host, which is an isolated server with configurations that you can control. + HostTenancy InstanceTenancy = "host" +) diff --git a/vendor/github.com/openshift/api/machine/v1/doc.go b/vendor/github.com/openshift/api/machine/v1/doc.go new file mode 100644 index 00000000000..7bd97c95072 --- /dev/null +++ b/vendor/github.com/openshift/api/machine/v1/doc.go @@ -0,0 +1,7 @@ +// +k8s:deepcopy-gen=package,register +// +k8s:defaulter-gen=TypeMeta +// +k8s:openapi-gen=true + +// +kubebuilder:validation:Optional +// +groupName=machine.openshift.io +package v1 diff --git a/vendor/github.com/openshift/api/machine/v1/register.go b/vendor/github.com/openshift/api/machine/v1/register.go new file mode 100644 index 00000000000..400f9efb001 --- /dev/null +++ b/vendor/github.com/openshift/api/machine/v1/register.go @@ -0,0 +1,22 @@ +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +var ( + GroupName = "machine.openshift.io" + GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} + schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + // Install is a function which adds this version to a scheme + Install = schemeBuilder.AddToScheme +) + +// Adds the list of known types to api.Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + metav1.AddToGroupVersion(scheme, GroupVersion) + + return nil +} diff --git a/vendor/github.com/openshift/api/machine/v1/types_alibabaprovider.go b/vendor/github.com/openshift/api/machine/v1/types_alibabaprovider.go new file mode 100644 index 00000000000..dc5d5b274e1 --- /dev/null +++ b/vendor/github.com/openshift/api/machine/v1/types_alibabaprovider.go @@ -0,0 +1,365 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// AlibabaDiskPerformanceLevel enum attribute to describe a disk's performance level +type AlibabaDiskPerformanceLevel string + +// AlibabaDiskCatagory enum attribute to deescribe a disk's category +type AlibabaDiskCategory string + +// AlibabaDiskEncryptionMode enum attribute to describe whether to enable or disable disk encryption +type AlibabaDiskEncryptionMode string + +// AlibabaDiskPreservationPolicy enum attribute to describe whether to preserve or delete a disk upon instance removal +type AlibabaDiskPreservationPolicy string + +// AlibabaResourceReferenceType enum attribute to identify the type of resource reference +type AlibabaResourceReferenceType string + +const ( + // DeleteWithInstance enum property to delete disk with instance deletion + DeleteWithInstance AlibabaDiskPreservationPolicy = "DeleteWithInstance" + // PreserveDisk enum property to determine disk preservation with instance deletion + PreserveDisk AlibabaDiskPreservationPolicy = "PreserveDisk" + + // AlibabaDiskEncryptionEnabled enum property to enable disk encryption + AlibabaDiskEncryptionEnabled AlibabaDiskEncryptionMode = "encrypted" + // AlibabaDiskEncryptionDisabled enum property to disable disk encryption + AlibabaDiskEncryptionDisabled AlibabaDiskEncryptionMode = "disabled" + + // AlibabaDiskPerformanceLevel0 enum property to set the level at PL0 + PL0 AlibabaDiskPerformanceLevel = "PL0" + // AlibabaDiskPerformanceLevel1 enum property to set the level at PL1 + PL1 AlibabaDiskPerformanceLevel = "PL1" + // AlibabaDiskPerformanceLevel2 enum property to set the level at PL2 + PL2 AlibabaDiskPerformanceLevel = "PL2" + // AlibabaDiskPerformanceLevel3 enum property to set the level at PL3 + PL3 AlibabaDiskPerformanceLevel = "PL3" + + // AlibabaDiskCategoryUltraDisk enum proprty to set the category of disk to ultra disk + AlibabaDiskCatagoryUltraDisk AlibabaDiskCategory = "cloud_efficiency" + // AlibabaDiskCategorySSD enum proprty to set the category of disk to standard SSD + AlibabaDiskCatagorySSD AlibabaDiskCategory = "cloud_ssd" + // AlibabaDiskCategoryESSD enum proprty to set the category of disk to ESSD + AlibabaDiskCatagoryESSD AlibabaDiskCategory = "cloud_essd" + // AlibabaDiskCategoryBasic enum proprty to set the category of disk to basic + AlibabaDiskCatagoryBasic AlibabaDiskCategory = "cloud" + + // AlibabaResourceReferenceTypeID enum property to identify an ID type resource reference + AlibabaResourceReferenceTypeID AlibabaResourceReferenceType = "ID" + // AlibabaResourceReferenceTypeName enum property to identify an Name type resource reference + AlibabaResourceReferenceTypeName AlibabaResourceReferenceType = "Name" + // AlibabaResourceReferenceTypeTags enum property to identify a tags type resource reference + AlibabaResourceReferenceTypeTags AlibabaResourceReferenceType = "Tags" +) + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// AlibabaCloudMachineProviderConfig is the Schema for the alibabacloudmachineproviderconfig API +// Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). +// +openshift:compatibility-gen:level=1 +// +k8s:openapi-gen=true +type AlibabaCloudMachineProviderConfig struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // More detail about alibabacloud ECS + // https://www.alibabacloud.com/help/doc-detail/25499.htm?spm=a2c63.l28256.b99.727.496d7453jF7Moz + + //The instance type of the instance. + InstanceType string `json:"instanceType"` + + // The ID of the vpc + VpcID string `json:"vpcId"` + + // The ID of the region in which to create the instance. You can call the DescribeRegions operation to query the most recent region list. + RegionID string `json:"regionId"` + + // The ID of the zone in which to create the instance. You can call the DescribeZones operation to query the most recent region list. + ZoneID string `json:"zoneId"` + + // The ID of the image used to create the instance. + ImageID string `json:"imageId"` + + // DataDisks holds information regarding the extra disks attached to the instance + // +optional + DataDisks []DataDiskProperties `json:"dataDisk,omitempty"` + + // SecurityGroups is a list of security group references to assign to the instance. + // A reference holds either the security group ID, the resource name, or the required tags to search. + // When more than one security group is returned for a tag search, all the groups are associated with the instance up to the + // maximum number of security groups to which an instance can belong. + // For more information, see the "Security group limits" section in Limits. + // https://www.alibabacloud.com/help/en/doc-detail/25412.htm + SecurityGroups []AlibabaResourceReference `json:"securityGroups,omitempty"` + + // Bandwidth describes the internet bandwidth strategy for the instance + // +optional + Bandwidth BandwidthProperties `json:"bandwidth,omitempty"` + + // SystemDisk holds the properties regarding the system disk for the instance + // +optional + SystemDisk SystemDiskProperties `json:"systemDisk,omitempty"` + + // VSwitch is a reference to the vswitch to use for this instance. + // A reference holds either the vSwitch ID, the resource name, or the required tags to search. + // When more than one vSwitch is returned for a tag search, only the first vSwitch returned will be used. + // This parameter is required when you create an instance of the VPC type. + // You can call the DescribeVSwitches operation to query the created vSwitches. + VSwitch AlibabaResourceReference `json:"vSwitch"` + + // RAMRoleName is the name of the instance Resource Access Management (RAM) role. This allows the instance to perform API calls as this specified RAM role. + // +optional + RAMRoleName string `json:"ramRoleName,omitempty"` + + // ResourceGroup references the resource group to which to assign the instance. + // A reference holds either the resource group ID, the resource name, or the required tags to search. + // When more than one resource group are returned for a search, an error will be produced and the Machine will not be created. + // Resource Groups do not support searching by tags. + ResourceGroup AlibabaResourceReference `json:"resourceGroup"` + + // Tenancy specifies whether to create the instance on a dedicated host. + // Valid values: + // + // default: creates the instance on a non-dedicated host. + // host: creates the instance on a dedicated host. If you do not specify the DedicatedHostID parameter, Alibaba Cloud automatically selects a dedicated host for the instance. + // Empty value means no opinion and the platform chooses the a default, which is subject to change over time. + // Currently the default is `default`. + // +optional + Tenancy InstanceTenancy `json:"tenancy,omitempty"` + + // UserDataSecret contains a local reference to a secret that contains the + // UserData to apply to the instance + // +optional + UserDataSecret *corev1.LocalObjectReference `json:"userDataSecret,omitempty"` + + // CredentialsSecret is a reference to the secret with alibabacloud credentials. Otherwise, defaults to permissions + // provided by attached RAM role where the actuator is running. + // +optional + CredentialsSecret *corev1.LocalObjectReference `json:"credentialsSecret,omitempty"` + + // Tags are the set of metadata to add to an instance. + // +optional + Tags []Tag `json:"tag,omitempty"` +} + +// ResourceTagReference is a reference to a specific AlibabaCloud resource by ID, or tags. +// Only one of ID or Tags may be specified. Specifying more than one will result in +// a validation error. +type AlibabaResourceReference struct { + // type identifies the resource reference type for this entry. + Type AlibabaResourceReferenceType `json:"type"` + + // ID of resource + // +optional + ID *string `json:"id,omitempty"` + + // Name of the resource + // +optional + Name *string `json:"name,omitempty"` + + // Tags is a set of metadata based upon ECS object tags used to identify a resource. + // For details about usage when multiple resources are found, please see the owning parent field documentation. + // +optional + Tags *[]Tag `json:"tags,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// AlibabaCloudMachineProviderConfigList contains a list of AlibabaCloudMachineProviderConfig +// Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). +// +openshift:compatibility-gen:level=1 +type AlibabaCloudMachineProviderConfigList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AlibabaCloudMachineProviderConfig `json:"items"` +} + +// AlibabaCloudMachineProviderStatus is the Schema for the alibabacloudmachineproviderconfig API +// Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). +// +openshift:compatibility-gen:level=1 +//+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type AlibabaCloudMachineProviderStatus struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // InstanceID is the instance ID of the machine created in alibabacloud + // +optional + InstanceID *string `json:"instanceId,omitempty"` + + // InstanceState is the state of the alibabacloud instance for this machine + // +optional + InstanceState *string `json:"instanceState,omitempty"` + + // Conditions is a set of conditions associated with the Machine to indicate + // errors or other status + // +optional + Conditions []metav1.Condition `json:"conditions,omitempty"` +} + +// SystemDiskProperties contains the information regarding the system disk including performance, size, name, and category +type SystemDiskProperties struct { + // Category is the category of the system disk. + // Valid values: + // cloud_essd: ESSD. When the parameter is set to this value, you can use the SystemDisk.PerformanceLevel parameter to specify the performance level of the disk. + // cloud_efficiency: ultra disk. + // cloud_ssd: standard SSD. + // cloud: basic disk. + // Empty value means no opinion and the platform chooses the a default, which is subject to change over time. + // Currently for non-I/O optimized instances of retired instance types, the default is `cloud`. + // Currently for other instances, the default is `cloud_efficiency`. + // +kubebuilder:validation:Enum="cloud_efficiency"; "cloud_ssd"; "cloud_essd"; "cloud" + // +optional + Category string `json:"category,omitempty"` + + // PerformanceLevel is the performance level of the ESSD used as the system disk. + // Valid values: + // + // PL0: A single ESSD can deliver up to 10,000 random read/write IOPS. + // PL1: A single ESSD can deliver up to 50,000 random read/write IOPS. + // PL2: A single ESSD can deliver up to 100,000 random read/write IOPS. + // PL3: A single ESSD can deliver up to 1,000,000 random read/write IOPS. + // Empty value means no opinion and the platform chooses a default, which is subject to change over time. + // Currently the default is `PL1`. + // For more information about ESSD performance levels, see ESSDs. + // +kubebuilder:validation:Enum="PL0"; "PL1"; "PL2"; "PL3" + // +optional + PerformanceLevel string `json:"performanceLevel,omitempty"` + + // Name is the name of the system disk. If the name is specified the name must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-). + // Empty value means the platform chooses a default, which is subject to change over time. + // Currently the default is `""`. + // +kubebuilder:validation:MaxLength=128 + // +optional + Name string `json:"name,omitempty"` + + // Size is the size of the system disk. Unit: GiB. Valid values: 20 to 500. + // The value must be at least 20 and greater than or equal to the size of the image. + // Empty value means the platform chooses a default, which is subject to change over time. + // Currently the default is `40` or the size of the image depending on whichever is greater. + // +optional + Size int64 `json:"size,omitempty"` +} + +// DataDisk contains the information regarding the datadisk attached to an instance +type DataDiskProperties struct { + // Name is the name of data disk N. If the name is specified the name must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-). + // + // Empty value means the platform chooses a default, which is subject to change over time. + // Currently the default is `""`. + // +optional + Name string `name:"diskName,omitempty"` + + // SnapshotID is the ID of the snapshot used to create data disk N. Valid values of N: 1 to 16. + // + // When the DataDisk.N.SnapshotID parameter is specified, the DataDisk.N.Size parameter is ignored. The data disk is created based on the size of the specified snapshot. + // Use snapshots created after July 15, 2013. Otherwise, an error is returned and your request is rejected. + // + // +optional + SnapshotID string `name:"snapshotId,omitempty"` + + // Size of the data disk N. Valid values of N: 1 to 16. Unit: GiB. Valid values: + // + // Valid values when DataDisk.N.Category is set to cloud_efficiency: 20 to 32768 + // Valid values when DataDisk.N.Category is set to cloud_ssd: 20 to 32768 + // Valid values when DataDisk.N.Category is set to cloud_essd: 20 to 32768 + // Valid values when DataDisk.N.Category is set to cloud: 5 to 2000 + // The value of this parameter must be greater than or equal to the size of the snapshot specified by the SnapshotID parameter. + // +optional + Size int64 `name:"size,omitempty"` + + // DiskEncryption specifies whether to encrypt data disk N. + // + // Empty value means the platform chooses a default, which is subject to change over time. + // Currently the default is `disabled`. + // +kubebuilder:validation:Enum="encrypted";"disabled" + // +optional + DiskEncryption AlibabaDiskEncryptionMode `name:"diskEncryption,omitempty"` + + // PerformanceLevel is the performance level of the ESSD used as as data disk N. The N value must be the same as that in DataDisk.N.Category when DataDisk.N.Category is set to cloud_essd. + // Empty value means no opinion and the platform chooses a default, which is subject to change over time. + // Currently the default is `PL1`. + // Valid values: + // + // PL0: A single ESSD can deliver up to 10,000 random read/write IOPS. + // PL1: A single ESSD can deliver up to 50,000 random read/write IOPS. + // PL2: A single ESSD can deliver up to 100,000 random read/write IOPS. + // PL3: A single ESSD can deliver up to 1,000,000 random read/write IOPS. + // For more information about ESSD performance levels, see ESSDs. + // +kubebuilder:validation:Enum="PL0"; "PL1"; "PL2"; "PL3" + // +optional + PerformanceLevel AlibabaDiskPerformanceLevel `name:"performanceLevel,omitempty"` + + // Category describes the type of data disk N. + // Valid values: + // cloud_efficiency: ultra disk + // cloud_ssd: standard SSD + // cloud_essd: ESSD + // cloud: basic disk + // Empty value means no opinion and the platform chooses the a default, which is subject to change over time. + // Currently for non-I/O optimized instances of retired instance types, the default is `cloud`. + // Currently for other instances, the default is `cloud_efficiency`. + // +kubebuilder:validation:Enum="cloud_efficiency"; "cloud_ssd"; "cloud_essd"; "cloud" + // +optional + Category AlibabaDiskCategory `name:"category,omitempty"` + + // KMSKeyID is the ID of the Key Management Service (KMS) key to be used by data disk N. + // Empty value means no opinion and the platform chooses the a default, which is subject to change over time. + // Currently the default is `""` which is interpreted as do not use KMSKey encryption. + // +optional + KMSKeyID string `name:"kmsKeyId,omitempty"` + + // DiskPreservation specifies whether to release data disk N along with the instance. + // Empty value means no opinion and the platform chooses the a default, which is subject to change over time. + // Currently the default is `DeleteWithInstance` + // +kubebuilder:validation:Enum="DeleteWithInstance";"PreserveDisk" + // +optional + DiskPreservation AlibabaDiskPreservationPolicy `name:"diskPreservation,omitempty"` +} + +// Tag The tags of ECS Instance +type Tag struct { + // Key is the name of the key pair + Key string `name:"Key"` + // Value is the value or data of the key pair + Value string `name:"value"` +} + +// Bandwidth describes the bandwidth strategy for the network of the instance +type BandwidthProperties struct { + // InternetMaxBandwidthIn is the maximum inbound public bandwidth. Unit: Mbit/s. Valid values: + // When the purchased outbound public bandwidth is less than or equal to 10 Mbit/s, the valid values of this parameter are 1 to 10. + // Currently the default is `10` when outbound bandwidth is less than or equal to 10 Mbit/s. + // When the purchased outbound public bandwidth is greater than 10, the valid values are 1 to the InternetMaxBandwidthOut value. + // Currently the default is the value used for `InternetMaxBandwidthOut` when outbound public bandwidth is greater than 10. + // +optional + InternetMaxBandwidthIn int64 `json:"internetMaxBandwidthIn,omitempty"` + + // InternetMaxBandwidthOut is the maximum outbound public bandwidth. Unit: Mbit/s. Valid values: 0 to 100. + // When a value greater than 0 is used then a public IP address is assigned to the instance. + // Empty value means no opinion and the platform chooses the a default, which is subject to change over time. + // Currently the default is `0` + // +optional + InternetMaxBandwidthOut int64 `json:"internetMaxBandwidthOut,omitempty"` +} diff --git a/vendor/github.com/openshift/cluster-api-provider-alibaba/pkg/apis/alibabacloudprovider/v1beta1/zz_generated.deepcopy.go b/vendor/github.com/openshift/api/machine/v1/zz_generated.deepcopy.go similarity index 69% rename from vendor/github.com/openshift/cluster-api-provider-alibaba/pkg/apis/alibabacloudprovider/v1beta1/zz_generated.deepcopy.go rename to vendor/github.com/openshift/api/machine/v1/zz_generated.deepcopy.go index 480938c480d..99063423907 100644 --- a/vendor/github.com/openshift/cluster-api-provider-alibaba/pkg/apis/alibabacloudprovider/v1beta1/zz_generated.deepcopy.go +++ b/vendor/github.com/openshift/api/machine/v1/zz_generated.deepcopy.go @@ -1,47 +1,16 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated -/* -Copyright 2021 The Kubernetes Authors. +// Code generated by deepcopy-gen. DO NOT EDIT. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1beta1 +package v1 import ( - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/runtime" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" ) -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AlibabaCloudMachineProviderCondition) DeepCopyInto(out *AlibabaCloudMachineProviderCondition) { - *out = *in - in.LastProbeTime.DeepCopyInto(&out.LastProbeTime) - in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlibabaCloudMachineProviderCondition. -func (in *AlibabaCloudMachineProviderCondition) DeepCopy() *AlibabaCloudMachineProviderCondition { - if in == nil { - return nil - } - out := new(AlibabaCloudMachineProviderCondition) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AlibabaCloudMachineProviderConfig) DeepCopyInto(out *AlibabaCloudMachineProviderConfig) { *out = *in @@ -50,9 +19,7 @@ func (in *AlibabaCloudMachineProviderConfig) DeepCopyInto(out *AlibabaCloudMachi if in.DataDisks != nil { in, out := &in.DataDisks, &out.DataDisks *out = make([]DataDiskProperties, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + copy(*out, *in) } if in.SecurityGroups != nil { in, out := &in.SecurityGroups, &out.SecurityGroups @@ -64,15 +31,15 @@ func (in *AlibabaCloudMachineProviderConfig) DeepCopyInto(out *AlibabaCloudMachi out.Bandwidth = in.Bandwidth out.SystemDisk = in.SystemDisk in.VSwitch.DeepCopyInto(&out.VSwitch) - out.Subscription = in.Subscription + in.ResourceGroup.DeepCopyInto(&out.ResourceGroup) if in.UserDataSecret != nil { in, out := &in.UserDataSecret, &out.UserDataSecret - *out = new(v1.LocalObjectReference) + *out = new(corev1.LocalObjectReference) **out = **in } if in.CredentialsSecret != nil { in, out := &in.CredentialsSecret, &out.CredentialsSecret - *out = new(v1.LocalObjectReference) + *out = new(corev1.LocalObjectReference) **out = **in } if in.Tags != nil { @@ -80,6 +47,7 @@ func (in *AlibabaCloudMachineProviderConfig) DeepCopyInto(out *AlibabaCloudMachi *out = make([]Tag, len(*in)) copy(*out, *in) } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlibabaCloudMachineProviderConfig. @@ -112,6 +80,7 @@ func (in *AlibabaCloudMachineProviderConfigList) DeepCopyInto(out *AlibabaCloudM (*in)[i].DeepCopyInto(&(*out)[i]) } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlibabaCloudMachineProviderConfigList. @@ -149,11 +118,12 @@ func (in *AlibabaCloudMachineProviderStatus) DeepCopyInto(out *AlibabaCloudMachi } if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions - *out = make([]AlibabaCloudMachineProviderCondition, len(*in)) + *out = make([]metav1.Condition, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlibabaCloudMachineProviderStatus. @@ -177,11 +147,26 @@ func (in *AlibabaCloudMachineProviderStatus) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AlibabaResourceReference) DeepCopyInto(out *AlibabaResourceReference) { *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } if in.Tags != nil { in, out := &in.Tags, &out.Tags - *out = make([]Tag, len(*in)) - copy(*out, *in) + *out = new([]Tag) + if **in != nil { + in, out := *in, *out + *out = make([]Tag, len(*in)) + copy(*out, *in) + } } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlibabaResourceReference. @@ -197,6 +182,7 @@ func (in *AlibabaResourceReference) DeepCopy() *AlibabaResourceReference { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *BandwidthProperties) DeepCopyInto(out *BandwidthProperties) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BandwidthProperties. @@ -212,11 +198,7 @@ func (in *BandwidthProperties) DeepCopy() *BandwidthProperties { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DataDiskProperties) DeepCopyInto(out *DataDiskProperties) { *out = *in - if in.DeleteWithInstance != nil { - in, out := &in.DeleteWithInstance, &out.DeleteWithInstance - *out = new(bool) - **out = **in - } + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataDiskProperties. @@ -229,44 +211,10 @@ func (in *DataDiskProperties) DeepCopy() *DataDiskProperties { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceTagReference) DeepCopyInto(out *ResourceTagReference) { - *out = *in - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make([]Tag, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceTagReference. -func (in *ResourceTagReference) DeepCopy() *ResourceTagReference { - if in == nil { - return nil - } - out := new(ResourceTagReference) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SubscriptionInfo) DeepCopyInto(out *SubscriptionInfo) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionInfo. -func (in *SubscriptionInfo) DeepCopy() *SubscriptionInfo { - if in == nil { - return nil - } - out := new(SubscriptionInfo) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SystemDiskProperties) DeepCopyInto(out *SystemDiskProperties) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemDiskProperties. @@ -282,6 +230,7 @@ func (in *SystemDiskProperties) DeepCopy() *SystemDiskProperties { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Tag) DeepCopyInto(out *Tag) { *out = *in + return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Tag. diff --git a/vendor/github.com/openshift/api/machine/v1beta1/0000_10_machine.crd.yaml b/vendor/github.com/openshift/api/machine/v1beta1/0000_10_machine.crd.yaml index d1ff62cd674..0b5cab53a3b 100644 --- a/vendor/github.com/openshift/api/machine/v1beta1/0000_10_machine.crd.yaml +++ b/vendor/github.com/openshift/api/machine/v1beta1/0000_10_machine.crd.yaml @@ -80,6 +80,9 @@ spec: items: description: LifecycleHook represents a single instance of a lifecycle hook type: object + required: + - name + - owner properties: name: description: Name defines a unique name for the lifcycle hook. The name should be unique and descriptive, ideally 1-3 words, in CamelCase or it may be namespaced, eg. foo.example.com/CamelCase. Names must be unique and should only be managed by a single entity. @@ -92,12 +95,18 @@ spec: type: string maxLength: 512 minLength: 3 + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map preTerminate: description: PreTerminate hooks prevent the machine from being terminated. PreTerminate hooks be actioned after the Machine has been drained. type: array items: description: LifecycleHook represents a single instance of a lifecycle hook type: object + required: + - name + - owner properties: name: description: Name defines a unique name for the lifcycle hook. The name should be unique and descriptive, ideally 1-3 words, in CamelCase or it may be namespaced, eg. foo.example.com/CamelCase. Names must be unique and should only be managed by a single entity. @@ -110,6 +119,9 @@ spec: type: string maxLength: 512 minLength: 3 + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map metadata: description: ObjectMeta will autopopulate the Node created. Use this to indicate what labels, annotations, name prefix, etc., should be used when creating the Node. type: object diff --git a/vendor/github.com/openshift/api/machine/v1beta1/0000_10_machineset.crd.yaml b/vendor/github.com/openshift/api/machine/v1beta1/0000_10_machineset.crd.yaml index 038802366a9..de27d2323f8 100644 --- a/vendor/github.com/openshift/api/machine/v1beta1/0000_10_machineset.crd.yaml +++ b/vendor/github.com/openshift/api/machine/v1beta1/0000_10_machineset.crd.yaml @@ -173,6 +173,9 @@ spec: items: description: LifecycleHook represents a single instance of a lifecycle hook type: object + required: + - name + - owner properties: name: description: Name defines a unique name for the lifcycle hook. The name should be unique and descriptive, ideally 1-3 words, in CamelCase or it may be namespaced, eg. foo.example.com/CamelCase. Names must be unique and should only be managed by a single entity. @@ -185,12 +188,18 @@ spec: type: string maxLength: 512 minLength: 3 + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map preTerminate: description: PreTerminate hooks prevent the machine from being terminated. PreTerminate hooks be actioned after the Machine has been drained. type: array items: description: LifecycleHook represents a single instance of a lifecycle hook type: object + required: + - name + - owner properties: name: description: Name defines a unique name for the lifcycle hook. The name should be unique and descriptive, ideally 1-3 words, in CamelCase or it may be namespaced, eg. foo.example.com/CamelCase. Names must be unique and should only be managed by a single entity. @@ -203,6 +212,9 @@ spec: type: string maxLength: 512 minLength: 3 + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map metadata: description: ObjectMeta will autopopulate the Node created. Use this to indicate what labels, annotations, name prefix, etc., should be used when creating the Node. type: object diff --git a/vendor/github.com/openshift/api/machine/v1beta1/types_machine.go b/vendor/github.com/openshift/api/machine/v1beta1/types_machine.go index 8d304076552..6cbc07f8938 100644 --- a/vendor/github.com/openshift/api/machine/v1beta1/types_machine.go +++ b/vendor/github.com/openshift/api/machine/v1beta1/types_machine.go @@ -204,11 +204,15 @@ type MachineSpec struct { type LifecycleHooks struct { // PreDrain hooks prevent the machine from being drained. // This also blocks further lifecycle events, such as termination. + // +listType=map + // +listMapKey=name // +optional PreDrain []LifecycleHook `json:"preDrain,omitempty"` // PreTerminate hooks prevent the machine from being terminated. // PreTerminate hooks be actioned after the Machine has been drained. + // +listType=map + // +listMapKey=name // +optional PreTerminate []LifecycleHook `json:"preTerminate,omitempty"` } @@ -222,7 +226,7 @@ type LifecycleHook struct { // +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$` // +kubebuilder:validation:MinLength:=3 // +kubebuilder:validation:MaxLength:=256 - // +required + // +kubebuilder:validation:Required Name string `json:"name"` // Owner defines the owner of the lifecycle hook. @@ -232,7 +236,7 @@ type LifecycleHook struct { // or an administrator managing the hook. // +kubebuilder:validation:MinLength:=3 // +kubebuilder:validation:MaxLength:=512 - // +required + // +kubebuilder:validation:Required Owner string `json:"owner"` } diff --git a/vendor/github.com/openshift/cluster-api-provider-alibaba/LICENSE b/vendor/github.com/openshift/cluster-api-provider-alibaba/LICENSE deleted file mode 100644 index 261eeb9e9f8..00000000000 --- a/vendor/github.com/openshift/cluster-api-provider-alibaba/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/openshift/cluster-api-provider-alibaba/pkg/apis/addtoscheme_alibabacloudprovider_v1beta1.go b/vendor/github.com/openshift/cluster-api-provider-alibaba/pkg/apis/addtoscheme_alibabacloudprovider_v1beta1.go deleted file mode 100644 index d667246c4fe..00000000000 --- a/vendor/github.com/openshift/cluster-api-provider-alibaba/pkg/apis/addtoscheme_alibabacloudprovider_v1beta1.go +++ /dev/null @@ -1,24 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package apis - -import "github.com/openshift/cluster-api-provider-alibaba/pkg/apis/alibabacloudprovider/v1beta1" - -func init() { - // Register the types with the Scheme so the components can map objects to GroupVersionKinds and back - AddToSchemes = append(AddToSchemes, v1beta1.SchemeBuilder.AddToScheme) -} diff --git a/vendor/github.com/openshift/cluster-api-provider-alibaba/pkg/apis/alibabacloudprovider/v1beta1/alibabacloudmachineproviderconfig_types.go b/vendor/github.com/openshift/cluster-api-provider-alibaba/pkg/apis/alibabacloudprovider/v1beta1/alibabacloudmachineproviderconfig_types.go deleted file mode 100644 index 106505b3333..00000000000 --- a/vendor/github.com/openshift/cluster-api-provider-alibaba/pkg/apis/alibabacloudprovider/v1beta1/alibabacloudmachineproviderconfig_types.go +++ /dev/null @@ -1,354 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// Annotation constants -const ( - // ClusterIDLabel is the label that a machineset must have to identify the - // cluster to which it belongs. - ClusterIDLabel = "machine.openshift.io/cluster-api-cluster" - // DefaultTenancy creates the instance on a non-dedicated host. - DefaultTenancy InstanceTenancy = "default" - // HostTenancy creates the instance on a dedicated host. If you do not specify the DedicatedHostID parameter, Alibaba Cloud automatically selects a dedicated host for the instance. - HostTenancy InstanceTenancy = "host" -) - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// AlibabaCloudMachineProviderConfig is the Schema for the alibabacloudmachineproviderconfig API -// +k8s:openapi-gen=true -type AlibabaCloudMachineProviderConfig struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - // More detail about alibabacloud ECS - // https://www.alibabacloud.com/help/doc-detail/25499.htm?spm=a2c63.l28256.b99.727.496d7453jF7Moz - //The instance type of the instance. - InstanceType string `json:"instanceType"` - - // The ID of th vpc - // +optional - VpcID string `json:"vpcId,omitempty"` - - // The ID of the region in which to create the instance. You can call the DescribeRegions operation to query the most recent region list. - RegionID string `json:"regionId"` - - // The ID of the zone in which to create the instance. You can call the DescribeZones operation to query the most recent region list. - ZoneID string `json:"zoneId"` - - // The ID of the image used to create the instance. - ImageID string `json:"imageId"` - - // DataDisk hold information regarding the extra data disks - DataDisks []DataDiskProperties `json:"dataDisk,omitempty"` - - // SecurityGroups is an array of references to security groups which to assign the instance. The valid values of N vary based on the - // maximum number of security groups to which an instance can belong. For more information, see the "Security group limits" section in Limits. - // https://www.alibabacloud.com/help/doc-detail/101348.htm?spm=a2c63.p38356.879954.48.78f0199aX3dfIE - SecurityGroups []AlibabaResourceReference `json:"securityGroups,omitempty"` - - //Bandwidth describes the internet bandwidth strategy for the instance - // +optional - Bandwidth BandwidthProperties `json:"bandwidth,omitempty"` - - // Information regarding the the system disk for the instance - // +optional - SystemDisk SystemDiskProperties `json:"systemDisk,omitempty"` - - // Description of the instance. The description must be 2 to 256 characters in length and cannot start with http:// or https://. - // This parameter is empty by default. - Description string `json:"description,omitempty"` - - // VSwitch is a reference to the vswitch to use for this instance - // This parameter is required when you create an instance of the VPC type. - // You can call the DescribeVSwitches operation to query the created vSwitches. - VSwitch AlibabaResourceReference `json:"vSwitch,omitempty"` - - // Subscription holds the billing information for the instance - // +optional - Subscription SubscriptionInfo `json:"subscription,omitempty"` - - // RAMRoleName is the name of the instance Resource Access Management (RAM) role. You can call the ListRoles operation provided by RAM to query the instance RAM roles that you have created. - // +optional - RAMRoleName string `json:"ramRoleName,omitempty"` - - //S pecifies whether to enable security hardening. Valid values: - // Active: enables security hardening. This value is applicable only to public images. - // Deactive: does not enable security hardening. This value is applicable to all images. - // +optional - SecurityEnhancementStrategy string `json:"securityEnhancementStrategy,omitempty"` - - // ResourceGroupID is the unique ID of the resource group to which to assign the instance. - // +optional - ResourceGroupID string `json:"resourceGroupId,omitempty"` - - // DeletionProtection is release protection property of the instance. It specifies whether you can use the ECS console or call the DeleteInstance operation to manually release the instance. Default value: false. Valid values: - // true: enables release protection. - // false: disables release protection. - // +optional - DeletionProtection bool `json:"deletionProtection,omitempty"` - - // Affinity specifies whether to associate the instance on a dedicated host with the dedicated host. Valid values: - // default: does not associate the instance with the dedicated host. When you restart an instance in the No Fees for Stopped Instances (VPC-Connected) state, the instance is automatically deployed to another dedicated host in the automatic deployment resource pool if the available resources of the original dedicated host are insufficient. - // host: associates the instance with the dedicated host. When you restart an instance in the No Fees for Stopped Instances (VPC-Connected) state, the instance still resides on the original dedicated host. If the available resources of the original dedicated host are insufficient, the instance fails to restart. - // Default value: default. - // +optional - Affinity string `json:"affinity,omitempty"` - - // Tenancy specifies whether to create the instance on a dedicated host. Valid values: - // default: creates the instance on a non-dedicated host. - // host: creates the instance on a dedicated host. If you do not specify the DedicatedHostID parameter, Alibaba Cloud automatically selects a dedicated host for the instance. - // Default value: default. - // +optional - Tenancy InstanceTenancy `json:"tenancy,omitempty"` - - // DedicatedHostID is the ID of the dedicated host on which to create the instance. - // You can call the DescribeDedicatedHosts operation to query the dedicated host list. - // When the DedicatedHostID parameter is specified, the SpotStrategy and SpotPriceLimit parameters are ignored. This is because preemptible instances cannot be created on dedicated hosts. - // +optional - DedicatedHostID string `json:"dedicatedHostId"` - - // UserDataSecret contains a local reference to a secret that contains the - // UserData to apply to the instance - // +optional - UserDataSecret *corev1.LocalObjectReference `json:"userDataSecret,omitempty"` - - // CredentialsSecret is a reference to the secret with alibabacloud credentials. Otherwise, defaults to permissions - // provided by attached RAM role where the actuator is running. - // +optional - CredentialsSecret *corev1.LocalObjectReference `json:"credentialsSecret,omitempty"` - - // Tags are the set of metadata to add to an instance. - // +optional - Tags []Tag `json:"tags,omitempty"` -} - -// ResourceTagReference is a reference to a specific AlibabaCloud resource by ID, or tags. -// Only one of ID or Tags may be specified. Specifying more than one will result in -// a validation error. -type AlibabaResourceReference struct { - // ID of resource - // +optional - ID string `json:"id,omitempty"` - - // Tags is a set of metadata based upon ECS object tags used to identify a resource - // +optional - Tags []Tag `json:"tags,omitempty"` -} - -// ResourceTagReference is a reference to a specific AlibabaCloud resource by ID, or tags. -// Only one of ID or Tags may be specified. Specifying more than one will result in -// a validation error. -type ResourceTagReference struct { - // ID of resource - // +optional - ID string `json:"id,omitempty"` - - // Tags is a set of tags used to identify a resource - // +optional - Tags []Tag `json:"tags,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// AlibabaCloudMachineProviderConfigList contains a list of AlibabaCloudMachineProviderConfig -type AlibabaCloudMachineProviderConfigList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []AlibabaCloudMachineProviderConfig `json:"items"` -} - -// InstanceTenancy Specifies whether to create the instance on a dedicated host -type InstanceTenancy string - -type SystemDiskProperties struct { - //The category of the system disk. Valid values: - //cloud_essd: ESSD. When the parameter is set to this value, you can use the SystemDisk.PerformanceLevel parameter to specify the performance level of the disk. - //cloud_efficiency: ultra disk. - //cloud_ssd: standard SSD. - //cloud: basic disk. - //For non-I/O optimized instances of retired instance types, the default value is cloud. For other instances, the default value is cloud_efficiency. - // +optional - Category string `json:"category,omitempty"` - - //The performance level of the ESSD used as the system disk. Default value: PL1. Valid values: - //PL0: A single ESSD can deliver up to 10,000 random read/write IOPS. - //PL1: A single ESSD can deliver up to 50,000 random read/write IOPS. - //PL2: A single ESSD can deliver up to 100,000 random read/write IOPS. - //PL3: A single ESSD can deliver up to 1,000,000 random read/write IOPS. - //For more information about ESSD performance levels, see ESSDs. - // +optional - PerformanceLevel string `json:"performanceLevel,omitempty"` - - //The name of the system disk. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-). - //This parameter is empty by default. - // +optional - Name string `json:"name,omitempty"` - - //The size of the system disk. Unit: GiB. Valid values: 20 to 500. - //The value must be at least 20 and greater than or equal to the size of the image. - //The default value is 40 or the size of the image, depending on whichever is greater. - // +optional - Size int `json:"size,omitempty"` - - //The description of the system disk. The description must be 2 to 256 characters in length and cannot start with http:// or https://. - //This parameter is empty by default. - // +optional - Description string `json:"description,omitempty"` -} - -// DataDisk The datadisk of Instance -type DataDiskProperties struct { - //The name of data disk N. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-). - // - //This parameter is empty by default. - // +optional - Name string `name:"name,omitempty"` - - //The ID of the snapshot used to create data disk N. Valid values of N: 1 to 16. - // - //When the DataDisk.N.SnapshotID parameter is specified, the DataDisk.N.Size parameter is ignored. The data disk is created based on the size of the specified snapshot. - //Use snapshots created after July 15, 2013. Otherwise, an error is returned and your request is rejected. - // +optional - SnapshotID string `name:"snapshotId,omitempty"` - - //The size of data disk N. Valid values of N: 1 to 16. Unit: GiB. Valid values: - // - //Valid values when DataDisk.N.Category is set to cloud_efficiency: 20 to 32768 - //Valid values when DataDisk.N.Category is set to cloud_ssd: 20 to 32768 - //Valid values when DataDisk.N.Category is set to cloud_essd: 20 to 32768 - //Valid values when DataDisk.N.Category is set to cloud: 5 to 2000 - //The value of this parameter must be greater than or equal to the size of the snapshot specified by the SnapshotID parameter. - // +optional - Size int `name:"size,omitempty"` - - //Specifies whether to encrypt data disk N. - // - //Default value: false. - // +optional - Encrypted bool `name:"encrypted,omitempty"` - - // - //The performance level of the ESSD used as data disk N. The N value must be the same as that in DataDisk.N.Category when DataDisk.N.Category is set to cloud_essd. Default value: PL1. Valid values: - // - //PL0: A single ESSD can deliver up to 10,000 random read/write IOPS. - //PL1: A single ESSD can deliver up to 50,000 random read/write IOPS. - //PL2: A single ESSD can deliver up to 100,000 random read/write IOPS. - //PL3: A single ESSD can deliver up to 1,000,000 random read/write IOPS. - //For more information about ESSD performance levels, see ESSDs. - // +optional - PerformanceLevel string `name:"performanceLevel,omitempty"` - - //TODO - //EncryptAlgorithm string `name:"EncryptAlgorithm"` - - //The description of data disk N. The description must be 2 to 256 characters in length and cannot start with http:// or https://. - // - //This parameter is empty by default. - // +optional - Description string `name:"description,omitempty"` - - //The category of data disk N. Valid values: - // - //cloud_efficiency: ultra disk - //cloud_ssd: standard SSD - //cloud_essd: ESSD - //cloud: basic disk - //For I/O optimized instances, the default value is cloud_efficiency. For non-I/O optimized instances, the default value is cloud. - // +optional - Category string `name:"category,omitempty"` - - //The ID of the Key Management Service (KMS) key to be used by data disk N. - // +optional - KMSKeyID string `name:"kmsKeyId,omitempty"` - - //The mount point of data disk N. - // +optional - Device string `name:"device,omitempty"` - - //Specifies whether to release data disk N along with the instance. - // - //Default value: true. - // +optional - DeleteWithInstance *bool `name:"deleteWithInstance,omitempty"` -} - -// Subscription information for the instance -type SubscriptionInfo struct { - //The billing method of the instance. Default value: PostPaid. Valid values: - //PrePaid: subscription. If you set this parameter to PrePaid, make sure that you have sufficient balance or credit within your account. Otherwise, an InvalidPayMethod error is returned. - //PostPaid: pay-as-you-go. - // +optional - InstanceChargeType string `json:"instanceChargeType,omitempty"` - - //The subscription period of the instance. The unit is specified by the PeriodUnit parameter. This parameter is valid and required only when InstanceChargeType is set to PrePaid. If the DedicatedHostID parameter is specified, the subscription period of the instance cannot be longer than that of the dedicated host. Valid values: - //Valid values when PeriodUnit is set to Month: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36, 48, and 60. - // +optional - Period int `json:"period,omitempty"` - - //The unit of the subscription period. Default value: Month. - //Set the value to Month. - // +optional - PeriodUnit string `json:"periodUnit,omitempty"` - - // The billing method for network usage. Default value: PayByTraffic. Valid values: - // PayByBandwidth: pay-by-bandwidth - // PayByTraffic: pay-by-traffic - // +optional - InternetChargeType string `json:"internetChargeType,omitempty"` - - //Specifies whether to enable auto-renewal for the instance. This parameter is valid only when the InstanceChargeType parameter is set to PrePaid. Default value: false. Valid values: - //true: enables automatic renewal for the instance. - //false: does not enable auto-renewal for the instance. - // +optional - AutoRenew bool `json:"autoRenew,omitempty"` - - //The auto-renewal period of the instance. This parameter is required when AutoRenew is set to true. - //If PeriodUnit is set to Month, the valid values of the AutoRenewPeriod parameter are 1, 2, 3, 6, and 12. - // +optional - AutoRenewPeriod int `json:"autoRenewPeriod,omitempty"` -} - -// Bandwidth describes the bandwidth strategy for the network of the instance -type BandwidthProperties struct { - //The maximum inbound public bandwidth. Unit: Mbit/s. Valid values: - //When the purchased outbound public bandwidth is less than or equal to 10 Mbit/s, the valid values of this parameter are 1 to 10, and the default value is 10. - //When the purchased outbound public bandwidth is greater than 10, the valid values are 1 to the InternetMaxBandwidthOut value, and the default value is the InternetMaxBandwidthOut value. - // +optional - InternetMaxBandwidthIn int `json:"internetMaxBandwidthIn,omitempty"` - - //The maximum outbound public bandwidth. Unit: Mbit/s. Valid values: 0 to 100. - //Default value: 0. - // +optional - InternetMaxBandwidthOut int `json:"internetMaxBandwidthOut,omitempty"` -} - -// Tag The tags of ECS Instance -type Tag struct { - Value string `name:"value"` - Key string `name:"key"` -} - -func init() { - SchemeBuilder.Register(&AlibabaCloudMachineProviderConfig{}, &AlibabaCloudMachineProviderConfigList{}) -} diff --git a/vendor/github.com/openshift/cluster-api-provider-alibaba/pkg/apis/alibabacloudprovider/v1beta1/alibabacloudmachineproviderstatus_types.go b/vendor/github.com/openshift/cluster-api-provider-alibaba/pkg/apis/alibabacloudprovider/v1beta1/alibabacloudmachineproviderstatus_types.go deleted file mode 100644 index 409ffd43428..00000000000 --- a/vendor/github.com/openshift/cluster-api-provider-alibaba/pkg/apis/alibabacloudprovider/v1beta1/alibabacloudmachineproviderstatus_types.go +++ /dev/null @@ -1,91 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// Valid conditions for an alibabacloud machine instance. -const ( - // MachineCreation indicates whether the machine has been created or not. If not, - // it should include a reason and message for the failure. - MachineCreation AlibabaCloudMachineProviderConditionType = "MachineCreation" -) - -// AlibabaCloudMachineProviderConditionReason is reason for the condition's last transition. -type AlibabaCloudMachineProviderConditionReason string - -const ( - // MachineCreationSucceeded indicates machine creation success. - MachineCreationSucceeded AlibabaCloudMachineProviderConditionReason = "MachineCreationSucceeded" - // MachineCreationFailed indicates machine creation failure. - MachineCreationFailed AlibabaCloudMachineProviderConditionReason = "MachineCreationFailed" -) - -// AlibabaCloudMachineProviderStatus is the Schema for the alibabacloudmachineproviderconfig API -//+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type AlibabaCloudMachineProviderStatus struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - // InstanceID is the instance ID of the machine created in alibabacloud - // +optional - InstanceID *string `json:"instanceId,omitempty"` - - // InstanceState is the state of the alibabacloud instance for this machine - // +optional - InstanceState *string `json:"instanceState,omitempty"` - - // Conditions is a set of conditions associated with the Machine to indicate - // errors or other status - // +optional - Conditions []AlibabaCloudMachineProviderCondition `json:"conditions,omitempty"` -} - -// AlibabaCloudMachineProviderConditionType is a valid value for AlibabaCloudMachineProviderCondition.Type -type AlibabaCloudMachineProviderConditionType string - -// AlibabaCloudMachineProviderCondition is a condition in a AlibabaCloudMachineProviderStatus -type AlibabaCloudMachineProviderCondition struct { - // Type is the type of the condition. - Type AlibabaCloudMachineProviderConditionType `json:"type"` - - // Status is the status of the condition. - Status corev1.ConditionStatus `json:"status"` - - // LastProbeTime is the last time we probed the condition. - // +optional - LastProbeTime metav1.Time `json:"lastProbeTime"` - - // LastTransitionTime is the last time the condition transitioned from one status to another. - // +optional - LastTransitionTime metav1.Time `json:"lastTransitionTime"` - - // Reason is a unique, one-word, CamelCase reason for the condition's last transition. - // +optional - Reason AlibabaCloudMachineProviderConditionReason `json:"reason"` - // Message is a human-readable message indicating details about last transition. - - // +optional - Message string `json:"message"` -} - -func init() { - SchemeBuilder.Register(&AlibabaCloudMachineProviderStatus{}) -} diff --git a/vendor/github.com/openshift/cluster-api-provider-alibaba/pkg/apis/alibabacloudprovider/v1beta1/doc.go b/vendor/github.com/openshift/cluster-api-provider-alibaba/pkg/apis/alibabacloudprovider/v1beta1/doc.go deleted file mode 100644 index 43a91c0ff03..00000000000 --- a/vendor/github.com/openshift/cluster-api-provider-alibaba/pkg/apis/alibabacloudprovider/v1beta1/doc.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1beta1 contains API Schema definitions for the alibabacloudmachineproviderconfig v1beta1 API group -// +k8s:openapi-gen=true -// +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=github.com/openshift/cluster-api-provider-alibaba/pkg/apis/alibabacloudmachineproviderconfig -// +k8s:defaulter-gen=TypeMeta -// +groupName=alibabacloudmachineproviderconfig.openshift.io -package v1beta1 diff --git a/vendor/github.com/openshift/cluster-api-provider-alibaba/pkg/apis/alibabacloudprovider/v1beta1/register.go b/vendor/github.com/openshift/cluster-api-provider-alibaba/pkg/apis/alibabacloudprovider/v1beta1/register.go deleted file mode 100644 index 97fdcce172d..00000000000 --- a/vendor/github.com/openshift/cluster-api-provider-alibaba/pkg/apis/alibabacloudprovider/v1beta1/register.go +++ /dev/null @@ -1,106 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1beta1 contains API Schema definitions for the alibabacloudmachineproviderconfig v1beta1 API group -// +k8s:openapi-gen=true -// +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=github.com/openshift/cluster-api-provider-alibaba/pkg/apis/alibabacloudmachineproviderconfig -// +k8s:defaulter-gen=TypeMeta -// +groupName=alibabacloudmachineproviderconfig.openshift.io -package v1beta1 - -import ( - "encoding/json" - "fmt" - - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/klog/v2" - "sigs.k8s.io/controller-runtime/pkg/scheme" - "sigs.k8s.io/yaml" -) - -var ( - // SchemeGroupVersion is group version used to register these objects - SchemeGroupVersion = schema.GroupVersion{Group: "alibabacloudmachineproviderconfig.openshift.io", Version: "v1beta1"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} -) - -// ProviderSpecFromRawExtension unmarshals a raw extension into an AlibabaCloudMachineProviderConfig type -func ProviderSpecFromRawExtension(rawExtension *runtime.RawExtension) (*AlibabaCloudMachineProviderConfig, error) { - if rawExtension == nil { - return &AlibabaCloudMachineProviderConfig{}, nil - } - - spec := new(AlibabaCloudMachineProviderConfig) - if err := yaml.Unmarshal(rawExtension.Raw, &spec); err != nil { - return nil, fmt.Errorf("error unmarshalling providerSpec: %v", err) - } - - klog.V(5).Infof("Got provider Spec from raw extension: %+v", spec) - return spec, nil -} - -// ProviderStatusFromRawExtension unmarshals a raw extension into an AlibabaCloudMachineProviderStatus type -func ProviderStatusFromRawExtension(rawExtension *runtime.RawExtension) (*AlibabaCloudMachineProviderStatus, error) { - if rawExtension == nil { - return &AlibabaCloudMachineProviderStatus{}, nil - } - - providerStatus := new(AlibabaCloudMachineProviderStatus) - if err := yaml.Unmarshal(rawExtension.Raw, providerStatus); err != nil { - return nil, fmt.Errorf("error unmarshalling providerStatus: %v", err) - } - - klog.V(5).Infof("Got provider Status from raw extension: %+v", providerStatus) - return providerStatus, nil -} - -// RawExtensionFromProviderSpec marshals the machine provider spec. -func RawExtensionFromProviderSpec(spec *AlibabaCloudMachineProviderConfig) (*runtime.RawExtension, error) { - if spec == nil { - return &runtime.RawExtension{}, nil - } - - var rawBytes []byte - var err error - if rawBytes, err = json.Marshal(spec); err != nil { - return nil, fmt.Errorf("error marshalling providerSpec: %v", err) - } - - return &runtime.RawExtension{ - Raw: rawBytes, - }, nil -} - -// RawExtensionFromProviderStatus marshals the machine provider status -func RawExtensionFromProviderStatus(status *AlibabaCloudMachineProviderStatus) (*runtime.RawExtension, error) { - if status == nil { - return &runtime.RawExtension{}, nil - } - - var rawBytes []byte - var err error - if rawBytes, err = json.Marshal(status); err != nil { - return nil, fmt.Errorf("error marshalling providerStatus: %v", err) - } - - return &runtime.RawExtension{ - Raw: rawBytes, - }, nil -} diff --git a/vendor/github.com/openshift/cluster-api-provider-alibaba/pkg/apis/apis.go b/vendor/github.com/openshift/cluster-api-provider-alibaba/pkg/apis/apis.go deleted file mode 100644 index 68cba25d2ad..00000000000 --- a/vendor/github.com/openshift/cluster-api-provider-alibaba/pkg/apis/apis.go +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Generate deepcopy for apis -//go:generate go run ../../vendor/sigs.k8s.io/controller-tools/cmd/controller-gen paths=./... object:headerFile=../../hack/boilerplate.go.txt,year=2021 - -// Package apis contains Kubernetes API groups. -package apis - -import ( - "k8s.io/apimachinery/pkg/runtime" -) - -// AddToSchemes may be used to add all resources defined in the project to a Scheme -var AddToSchemes runtime.SchemeBuilder - -// AddToScheme adds all Resources to the Scheme -func AddToScheme(s *runtime.Scheme) error { - return AddToSchemes.AddToScheme(s) -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 9e27c20be1e..221090e3c99 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1678,9 +1678,10 @@ github.com/opencontainers/image-spec/specs-go/v1 # github.com/openshift-metal3/terraform-provider-ironic v0.2.7 ## explicit; go 1.13 github.com/openshift-metal3/terraform-provider-ironic/ironic -# github.com/openshift/api v0.0.0-20211210181228-6e0b1eb97188 +# github.com/openshift/api v0.0.0-20220124143425-d74727069f6f ## explicit; go 1.16 github.com/openshift/api/config/v1 +github.com/openshift/api/machine/v1 github.com/openshift/api/machine/v1beta1 github.com/openshift/api/operator/v1 github.com/openshift/api/operator/v1alpha1 @@ -1702,10 +1703,6 @@ github.com/openshift/cloud-credential-operator/version ## explicit github.com/openshift/cluster-api/pkg/apis/machine/common github.com/openshift/cluster-api/pkg/apis/machine/v1beta1 -# github.com/openshift/cluster-api-provider-alibaba v0.0.0-20211123142315-d16daa4e6349 -## explicit; go 1.16 -github.com/openshift/cluster-api-provider-alibaba/pkg/apis -github.com/openshift/cluster-api-provider-alibaba/pkg/apis/alibabacloudprovider/v1beta1 # github.com/openshift/cluster-api-provider-baremetal v0.0.0-20210924143856-c2d3ece4da38 ## explicit; go 1.16 github.com/openshift/cluster-api-provider-baremetal/pkg/apis