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

SPLAT-1385: introduce TagIDs field to vSphere providerSpec #1697

Merged
merged 1 commit into from Jan 15, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions machine/v1beta1/types_vsphereprovider.go
Expand Up @@ -51,6 +51,12 @@ type VSphereMachineProviderSpec struct {
// This parameter will be ignored if 'LinkedClone' CloneMode is set.
// +optional
DiskGiB int32 `json:"diskGiB,omitempty"`
// tagIDs is an optional set of tags to add to an instance. Specified tagIDs
// must use URN-notation instead of display names. A maximum of 10 tag IDs may be specified.
// +kubebuilder:validation:Pattern:="^(urn):(vmomi):(InventoryServiceTag):([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}):([^:]+)$"
// +kubebuilder:example=urn:vmomi:InventoryServiceTag:5736bf56-49f5-4667-b38c-b97e09dc9578:GLOBAL
// +optional
TagIDs []string `json:"tagIDs,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

How is this handled in the upstream CAPV?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This mirrors the CAPV API.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a limit to the number of tags that can be applied?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There isn't a hard limit upstream but excessive tags could cause latency in machine reconciliation. We could impose an arbitrary maximum.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There isn't a hard limit, but there is performance hit if we allow too many tags to be reconciled and attached. For now, setting a 10 tag limit.

// Snapshot is the name of the snapshot from which the VM was cloned
// +optional
Snapshot string `json:"snapshot"`
Expand Down
5 changes: 5 additions & 0 deletions machine/v1beta1/zz_generated.deepcopy.go

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

1 change: 1 addition & 0 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.

15 changes: 15 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.

8 changes: 8 additions & 0 deletions openapi/openapi.json
Expand Up @@ -21533,6 +21533,14 @@
"type": "string",
"default": ""
},
"tagIDs": {
"description": "tagIDs is an optional set of tags to add to an instance. Specified tagIDs must use URN-notation instead of display names. A maximum of 10 tag IDs may be specified.",
"type": "array",
"items": {
"type": "string",
"default": ""
}
},
"template": {
"description": "Template is the name, inventory path, or instance UUID of the template used to clone new machines.",
"type": "string",
Expand Down