Skip to content

Commit

Permalink
update required fields for AlibabaCloudMachineProviderConfig
Browse files Browse the repository at this point in the history
This change makes the `VpcID`, `SecurityGroups`, `VSwitch`, and
`ResourceGroups` fields required byu removing the `+optional` and
`omitempty` annotations. This change is being made to reflect the best
practices when deploying OpenShift on Alibaba Cloud.

When deploying on OpenShift, only the VPC mode is allowed. This means
that the user must specify a VPC ID or the instance creation will fail.
When creating instances in VPC mode, the user must specify a vSwitch or
the operation will fail.
  • Loading branch information
elmiko committed Jan 14, 2022
1 parent 3af5513 commit 6598a1f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions machine/v1/types_alibabaprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ type AlibabaCloudMachineProviderConfig struct {
InstanceType string `json:"instanceType"`

// The ID of the vpc
// +optional
VpcID string `json:"vpcId,omitempty"`
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"`
Expand All @@ -109,7 +108,7 @@ type AlibabaCloudMachineProviderConfig struct {

// 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 return for a tag search, all the groups are associated with the instance up to the
// 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
Expand All @@ -128,7 +127,7 @@ type AlibabaCloudMachineProviderConfig struct {
// 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,omitempty"`
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
Expand All @@ -138,8 +137,7 @@ type AlibabaCloudMachineProviderConfig struct {
// 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.
// +optional
ResourceGroup AlibabaResourceReference `json:"resourceGroup,omitempty"`
ResourceGroup AlibabaResourceReference `json:"resourceGroup"`

// Tenancy specifies whether to create the instance on a dedicated host.
// Valid values:
Expand Down

0 comments on commit 6598a1f

Please sign in to comment.