diff --git a/machine/v1/types_nutanixprovider.go b/machine/v1/types_nutanixprovider.go index 6eae01a21ad..1bcb28d203b 100644 --- a/machine/v1/types_nutanixprovider.go +++ b/machine/v1/types_nutanixprovider.go @@ -56,6 +56,25 @@ type NutanixMachineProviderConfig struct { // +kubebuilder:validation:Required SystemDiskSize resource.Quantity `json:"systemDiskSize"` + // bootType indicates the boot type (Legacy, UEFI or SecureBoot) the Machine's VM uses to boot. + // If this field is empty or omitted, the VM will use the default boot type "Legacy" to boot. + // "SecureBoot" depends on "UEFI" boot, i.e., enabling "SecureBoot" means that "UEFI" boot is also enabled. + // +kubebuilder:validation:Enum="";Legacy;UEFI;SecureBoot + // +optional + BootType NutanixBootType `json:"bootType"` + + // project optionally identifies a Prism project for the Machine's VM to associate with. + // +optional + Project NutanixResourceIdentifier `json:"project"` + + // categories optionally adds one or more prism categories (each with key and value) for + // the Machine's VM to associate with. All the category key and value pairs specified must + // already exist in the prism central. + // +listType=map + // +listMapKey=key + // +optional + Categories []NutanixCategory `json:"categories"` + // userDataSecret is a local reference to a secret that contains the // UserData to apply to the VM UserDataSecret *corev1.LocalObjectReference `json:"userDataSecret,omitempty"` @@ -66,6 +85,35 @@ type NutanixMachineProviderConfig struct { CredentialsSecret *corev1.LocalObjectReference `json:"credentialsSecret"` } +// NutanixCategory identifies a pair of prism category key and value +type NutanixCategory struct { + // key is the prism category key name + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=64 + // +kubebuilder:validation:Required + Key string `json:"key"` + + // value is the prism category value associated with the key + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=64 + // +kubebuilder:validation:Required + Value string `json:"value"` +} + +// NutanixBootType is an enumeration of different boot types for Nutanix VM. +type NutanixBootType string + +const ( + // NutanixLegacyBoot is the legacy BIOS boot type + NutanixLegacyBoot NutanixBootType = "Legacy" + + // NutanixUEFIBoot is the UEFI boot type + NutanixUEFIBoot NutanixBootType = "UEFI" + + // NutanixSecureBoot is the Secure boot type + NutanixSecureBoot NutanixBootType = "SecureBoot" +) + // NutanixIdentifierType is an enumeration of different resource identifier types. type NutanixIdentifierType string diff --git a/machine/v1/zz_generated.deepcopy.go b/machine/v1/zz_generated.deepcopy.go index 9cb1a1219bc..d63873943de 100644 --- a/machine/v1/zz_generated.deepcopy.go +++ b/machine/v1/zz_generated.deepcopy.go @@ -559,6 +559,22 @@ func (in *GCPFailureDomain) DeepCopy() *GCPFailureDomain { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NutanixCategory) DeepCopyInto(out *NutanixCategory) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NutanixCategory. +func (in *NutanixCategory) DeepCopy() *NutanixCategory { + if in == nil { + return nil + } + out := new(NutanixCategory) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NutanixMachineProviderConfig) DeepCopyInto(out *NutanixMachineProviderConfig) { *out = *in @@ -575,6 +591,12 @@ func (in *NutanixMachineProviderConfig) DeepCopyInto(out *NutanixMachineProvider } out.MemorySize = in.MemorySize.DeepCopy() out.SystemDiskSize = in.SystemDiskSize.DeepCopy() + in.Project.DeepCopyInto(&out.Project) + if in.Categories != nil { + in, out := &in.Categories, &out.Categories + *out = make([]NutanixCategory, len(*in)) + copy(*out, *in) + } if in.UserDataSecret != nil { in, out := &in.UserDataSecret, &out.UserDataSecret *out = new(corev1.LocalObjectReference) diff --git a/machine/v1/zz_generated.swagger_doc_generated.go b/machine/v1/zz_generated.swagger_doc_generated.go index 8bd2674bf7d..226c28d5c80 100644 --- a/machine/v1/zz_generated.swagger_doc_generated.go +++ b/machine/v1/zz_generated.swagger_doc_generated.go @@ -268,6 +268,16 @@ func (OpenShiftMachineV1Beta1MachineTemplate) SwaggerDoc() map[string]string { return map_OpenShiftMachineV1Beta1MachineTemplate } +var map_NutanixCategory = map[string]string{ + "": "NutanixCategory identifies a pair of prism category key and value", + "key": "key is the prism category key name", + "value": "value is the prism category value associated with the key", +} + +func (NutanixCategory) SwaggerDoc() map[string]string { + return map_NutanixCategory +} + var map_NutanixMachineProviderConfig = map[string]string{ "": "NutanixMachineProviderConfig is the Schema for the nutanixmachineproviderconfigs API Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).", "cluster": "cluster is to identify the cluster (the Prism Element under management of the Prism Central), in which the Machine's VM will be created. The cluster identifier (uuid or name) can be obtained from the Prism Central console or using the prism_central API.", @@ -277,6 +287,9 @@ var map_NutanixMachineProviderConfig = map[string]string{ "vcpuSockets": "vcpuSockets is the number of vCPU sockets of the VM", "memorySize": "memorySize is the memory size (in Quantity format) of the VM The minimum memorySize is 2Gi bytes", "systemDiskSize": "systemDiskSize is size (in Quantity format) of the system disk of the VM The minimum systemDiskSize is 20Gi bytes", + "bootType": "bootType indicates the boot type (Legacy, UEFI or SecureBoot) the Machine's VM uses to boot. If this field is empty or omitted, the VM will use the default boot type \"Legacy\" to boot. \"SecureBoot\" depends on \"UEFI\" boot, i.e., enabling \"SecureBoot\" means that \"UEFI\" boot is also enabled.", + "project": "project optionally identifies a Prism project for the Machine's VM to associate with.", + "categories": "categories optionally adds one or more prism categories (each with key and value) for the Machine's VM to associate with. All the category key and value pairs specified must already exist in the prism central.", "userDataSecret": "userDataSecret is a local reference to a secret that contains the UserData to apply to the VM", "credentialsSecret": "credentialsSecret is a local reference to a secret that contains the credentials data to access Nutanix PC client", } diff --git a/openapi/generated_openapi/zz_generated.openapi.go b/openapi/generated_openapi/zz_generated.openapi.go index ed3de2db4c8..dca5259c978 100644 --- a/openapi/generated_openapi/zz_generated.openapi.go +++ b/openapi/generated_openapi/zz_generated.openapi.go @@ -582,6 +582,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/openshift/api/machine/v1.DataDiskProperties": schema_openshift_api_machine_v1_DataDiskProperties(ref), "github.com/openshift/api/machine/v1.FailureDomains": schema_openshift_api_machine_v1_FailureDomains(ref), "github.com/openshift/api/machine/v1.GCPFailureDomain": schema_openshift_api_machine_v1_GCPFailureDomain(ref), + "github.com/openshift/api/machine/v1.NutanixCategory": schema_openshift_api_machine_v1_NutanixCategory(ref), "github.com/openshift/api/machine/v1.NutanixMachineProviderConfig": schema_openshift_api_machine_v1_NutanixMachineProviderConfig(ref), "github.com/openshift/api/machine/v1.NutanixMachineProviderStatus": schema_openshift_api_machine_v1_NutanixMachineProviderStatus(ref), "github.com/openshift/api/machine/v1.NutanixResourceIdentifier": schema_openshift_api_machine_v1_NutanixResourceIdentifier(ref), @@ -28903,6 +28904,36 @@ func schema_openshift_api_machine_v1_GCPFailureDomain(ref common.ReferenceCallba } } +func schema_openshift_api_machine_v1_NutanixCategory(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NutanixCategory identifies a pair of prism category key and value", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "key": { + SchemaProps: spec.SchemaProps{ + Description: "key is the prism category key name", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "value": { + SchemaProps: spec.SchemaProps{ + Description: "value is the prism category value associated with the key", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"key", "value"}, + }, + }, + } +} + func schema_openshift_api_machine_v1_NutanixMachineProviderConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -28988,6 +29019,43 @@ func schema_openshift_api_machine_v1_NutanixMachineProviderConfig(ref common.Ref Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, + "bootType": { + SchemaProps: spec.SchemaProps{ + Description: "bootType indicates the boot type (Legacy, UEFI or SecureBoot) the Machine's VM uses to boot. If this field is empty or omitted, the VM will use the default boot type \"Legacy\" to boot. \"SecureBoot\" depends on \"UEFI\" boot, i.e., enabling \"SecureBoot\" means that \"UEFI\" boot is also enabled.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "project": { + SchemaProps: spec.SchemaProps{ + Description: "project optionally identifies a Prism project for the Machine's VM to associate with.", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/machine/v1.NutanixResourceIdentifier"), + }, + }, + "categories": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "key", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "categories optionally adds one or more prism categories (each with key and value) for the Machine's VM to associate with. All the category key and value pairs specified must already exist in the prism central.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/machine/v1.NutanixCategory"), + }, + }, + }, + }, + }, "userDataSecret": { SchemaProps: spec.SchemaProps{ Description: "userDataSecret is a local reference to a secret that contains the UserData to apply to the VM", @@ -29005,7 +29073,7 @@ func schema_openshift_api_machine_v1_NutanixMachineProviderConfig(ref common.Ref }, }, Dependencies: []string{ - "github.com/openshift/api/machine/v1.NutanixResourceIdentifier", "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/api/resource.Quantity", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + "github.com/openshift/api/machine/v1.NutanixCategory", "github.com/openshift/api/machine/v1.NutanixResourceIdentifier", "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/api/resource.Quantity", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } diff --git a/openapi/openapi.json b/openapi/openapi.json index d950024ca16..358b3a9b343 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -16756,6 +16756,26 @@ } } }, + "com.github.openshift.api.machine.v1.NutanixCategory": { + "description": "NutanixCategory identifies a pair of prism category key and value", + "type": "object", + "required": [ + "key", + "value" + ], + "properties": { + "key": { + "description": "key is the prism category key name", + "type": "string", + "default": "" + }, + "value": { + "description": "value is the prism category value associated with the key", + "type": "string", + "default": "" + } + } + }, "com.github.openshift.api.machine.v1.NutanixMachineProviderConfig": { "description": "NutanixMachineProviderConfig is the Schema for the nutanixmachineproviderconfigs API Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).", "type": "object", @@ -16774,6 +16794,23 @@ "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, + "bootType": { + "description": "bootType indicates the boot type (Legacy, UEFI or SecureBoot) the Machine's VM uses to boot. If this field is empty or omitted, the VM will use the default boot type \"Legacy\" to boot. \"SecureBoot\" depends on \"UEFI\" boot, i.e., enabling \"SecureBoot\" means that \"UEFI\" boot is also enabled.", + "type": "string", + "default": "" + }, + "categories": { + "description": "categories optionally adds one or more prism categories (each with key and value) for the Machine's VM to associate with. All the category key and value pairs specified must already exist in the prism central.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.machine.v1.NutanixCategory" + }, + "x-kubernetes-list-map-keys": [ + "key" + ], + "x-kubernetes-list-type": "map" + }, "cluster": { "description": "cluster is to identify the cluster (the Prism Element under management of the Prism Central), in which the Machine's VM will be created. The cluster identifier (uuid or name) can be obtained from the Prism Central console or using the prism_central API.", "default": {}, @@ -16801,6 +16838,11 @@ "default": {}, "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" }, + "project": { + "description": "project optionally identifies a Prism project for the Machine's VM to associate with.", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.machine.v1.NutanixResourceIdentifier" + }, "subnets": { "description": "subnets holds a list of identifiers (one or more) of the cluster's network subnets for the Machine's VM to connect to. The subnet identifiers (uuid or name) can be obtained from the Prism Central console or using the prism_central API.", "type": "array",