Skip to content
Open
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
20 changes: 20 additions & 0 deletions machine/v1beta1/types_gcpprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,26 @@ type GCPDisk struct {
// encryptionKey is the customer-supplied encryption key of the disk.
// +optional
EncryptionKey *GCPEncryptionKeyReference `json:"encryptionKey,omitempty"`
// licenses is a list of URLs of license resources attached to this disk.
// License URLs must match exactly either the full HTTPS URI format
// (https://www.googleapis.com/compute/v1/projects/{project}/global/licenses/{license})
// or the short self-link format (projects/{project}/global/licenses/{license}).
Comment on lines +248 to +250

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why offer both options rather than stipulating one format? The former pattern for the full URL assumes you're only using the global google APIs right? IIRC google sovereign clouds would use a different endpoint here and would not be accepted by this API, but if we went only for relatively paths, then I think that would be accepted no matter which version of GCP you're running on

// Project IDs must use lowercase letters, digits, and hyphens, begin with a letter,
// end with a lowercase letter or digit, and be 6 to 30 characters long. License
// names must be RFC1035-style lowercase names that begin with a letter, end with a
// lowercase letter or digit, contain only lowercase letters, digits, and hyphens,
// and are at most 63 characters long.
// Each license URL must be at least 1 character and must not exceed 256 characters.
// When specified, at least 1 and a maximum of 8 licenses may be provided.
// When omitted, no additional licenses are applied.
// +optional
// +listType=atomic
// +kubebuilder:validation:MinItems=1
// +kubebuilder:validation:MaxItems=8
// +kubebuilder:validation:items:MinLength=1
// +kubebuilder:validation:items:MaxLength=256
Comment thread
coderabbitai[bot] marked this conversation as resolved.
// +kubebuilder:validation:items:Pattern=`^(https://www\.googleapis\.com/compute/v1/)?projects/[a-z][a-z0-9-]{4,28}[a-z0-9]/global/licenses/[a-z]([-a-z0-9]{0,61}[a-z0-9])?$`
Licenses []string `json:"licenses,omitempty"`
}

// GCPMetadata describes metadata for GCP.
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.

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

9 changes: 9 additions & 0 deletions openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -26466,6 +26466,15 @@
"default": ""
}
},
"licenses": {
"description": "licenses is a list of URLs of license resources attached to this disk. License URLs must match exactly either the full HTTPS URI format (https://www.googleapis.com/compute/v1/projects/{project}/global/licenses/{license}) or the short self-link format (projects/{project}/global/licenses/{license}). Project IDs must use lowercase letters, digits, and hyphens, begin with a letter, end with a lowercase letter or digit, and be 6 to 30 characters long. License names must be RFC1035-style lowercase names that begin with a letter, end with a lowercase letter or digit, contain only lowercase letters, digits, and hyphens, and are at most 63 characters long. Each license URL must be at least 1 character and must not exceed 256 characters. When specified, at least 1 and a maximum of 8 licenses may be provided. When omitted, no additional licenses are applied.",
"type": "array",
"items": {
"type": "string",
"default": ""
},
"x-kubernetes-list-type": "atomic"
},
"sizeGb": {
"description": "sizeGb is the size of the disk (in GB).",
"type": "integer",
Expand Down