Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CFE-1063: Add PlacementGroupPartition in AWSMachineProviderConfig #1897

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions machine/v1beta1/types_awsprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ type AWSMachineProviderConfig struct {
// When omitted, no placement group is used when creating the EC2 instance.
// +optional
PlacementGroupName string `json:"placementGroupName,omitempty"`
// placementGroupPartition is the partition number within the placement group in which to launch the instance.
// This must be an integer value between 1 and 7. It is only valid if the placement group, referred in
// `PlacementGroupName` was created with strategy set to partition.
// +kubebuilder:validation:Minimum:=1
// +kubebuilder:validation:Maximum:=7
Comment on lines +90 to +91
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JoelSpeed I was doing some dev testing, and it turns out that these kubebuilder validations are not working as expected while creating a MachineSet object. Do we need them to be added inside the webhook?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, kubebuilder validations won't ever work on this particular API, please add them to the webhook validations

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha! Then these kubebuilder validations can be removed from here I think. Created #1942 to drop them

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

openshift/machine-api-operator#1265 to add them into webhook validations

// +optional
PlacementGroupPartition int32 `json:"placementGroupPartition,omitempty"`
}

// BlockDeviceMappingSpec describes a block device mapping
Expand Down
39 changes: 20 additions & 19 deletions machine/v1beta1/zz_generated.swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions openapi/generated_openapi/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -20096,6 +20096,11 @@
"description": "PlacementGroupName specifies the name of the placement group in which to launch the instance. The placement group must already be created and may use any placement strategy. When omitted, no placement group is used when creating the EC2 instance.",
"type": "string"
},
"placementGroupPartition": {
"description": "placementGroupPartition is the partition number within the placement group in which to launch the instance. This must be an integer value between 1 and 7. It is only valid if the placement group, referred in `PlacementGroupName` was created with strategy set to partition.",
"type": "integer",
"format": "int32"
},
"publicIp": {
"description": "PublicIP specifies whether the instance should get a public IP. If not present, it should use the default of its subnet.",
"type": "boolean"
Expand Down