diff --git a/api/v1beta1/types.go b/api/v1beta1/types.go index 36a7c8f2..90c866d3 100644 --- a/api/v1beta1/types.go +++ b/api/v1beta1/types.go @@ -187,9 +187,22 @@ type InstanceSourceViaImageConfig struct { // * `30`-`120`: Represents the Ultra High Performance option. // For volumes with the auto-tuned performance feature enabled, this is set to the default (minimum) VPUs/GB. BootVolumeVpusPerGB *int64 `json:"bootVolumeVpusPerGB,omitempty"` + + // ImageLookup defines the image lookup parameters for the node image. + ImageLookup *ImageLookup `json:"imageLookup,omitempty"` } -// LaunchInstanceAvailabilityConfigDetailsRecoveryActionEnum Enum with underlying type: string +// ImageLookup defines the image lookup parameters for the node image. +type ImageLookup struct { + // OperatingSystem defines operating system of the image. + // +optional + OperatingSystem *string `json:"operatingSystem,omitempty"` + + // OperatingSystemVersion defines operating system version of the image. + OperatingSystemVersion *string `json:"operatingSystemVersion,omitempty"` +} + +// PlatformConfigTypeEnum Enum with underlying type: string type PlatformConfigTypeEnum string // Set of constants representing the allowable values for LaunchInstanceAvailabilityConfigDetailsRecoveryActionEnum diff --git a/api/v1beta1/zz_generated.conversion.go b/api/v1beta1/zz_generated.conversion.go index 7c6b2869..4e5d91e0 100644 --- a/api/v1beta1/zz_generated.conversion.go +++ b/api/v1beta1/zz_generated.conversion.go @@ -125,6 +125,16 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*ImageLookup)(nil), (*v1beta2.ImageLookup)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ImageLookup_To_v1beta2_ImageLookup(a.(*ImageLookup), b.(*v1beta2.ImageLookup), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.ImageLookup)(nil), (*ImageLookup)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_ImageLookup_To_v1beta1_ImageLookup(a.(*v1beta2.ImageLookup), b.(*ImageLookup), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*IngressSecurityRule)(nil), (*v1beta2.IngressSecurityRule)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_IngressSecurityRule_To_v1beta2_IngressSecurityRule(a.(*IngressSecurityRule), b.(*v1beta2.IngressSecurityRule), scope) }); err != nil { @@ -895,6 +905,28 @@ func Convert_v1beta2_IcmpOptions_To_v1beta1_IcmpOptions(in *v1beta2.IcmpOptions, return autoConvert_v1beta2_IcmpOptions_To_v1beta1_IcmpOptions(in, out, s) } +func autoConvert_v1beta1_ImageLookup_To_v1beta2_ImageLookup(in *ImageLookup, out *v1beta2.ImageLookup, s conversion.Scope) error { + out.OperatingSystem = (*string)(unsafe.Pointer(in.OperatingSystem)) + out.OperatingSystemVersion = (*string)(unsafe.Pointer(in.OperatingSystemVersion)) + return nil +} + +// Convert_v1beta1_ImageLookup_To_v1beta2_ImageLookup is an autogenerated conversion function. +func Convert_v1beta1_ImageLookup_To_v1beta2_ImageLookup(in *ImageLookup, out *v1beta2.ImageLookup, s conversion.Scope) error { + return autoConvert_v1beta1_ImageLookup_To_v1beta2_ImageLookup(in, out, s) +} + +func autoConvert_v1beta2_ImageLookup_To_v1beta1_ImageLookup(in *v1beta2.ImageLookup, out *ImageLookup, s conversion.Scope) error { + out.OperatingSystem = (*string)(unsafe.Pointer(in.OperatingSystem)) + out.OperatingSystemVersion = (*string)(unsafe.Pointer(in.OperatingSystemVersion)) + return nil +} + +// Convert_v1beta2_ImageLookup_To_v1beta1_ImageLookup is an autogenerated conversion function. +func Convert_v1beta2_ImageLookup_To_v1beta1_ImageLookup(in *v1beta2.ImageLookup, out *ImageLookup, s conversion.Scope) error { + return autoConvert_v1beta2_ImageLookup_To_v1beta1_ImageLookup(in, out, s) +} + func autoConvert_v1beta1_IngressSecurityRule_To_v1beta2_IngressSecurityRule(in *IngressSecurityRule, out *v1beta2.IngressSecurityRule, s conversion.Scope) error { out.Protocol = (*string)(unsafe.Pointer(in.Protocol)) out.Source = (*string)(unsafe.Pointer(in.Source)) @@ -994,6 +1026,7 @@ func Convert_v1beta2_InstanceOptions_To_v1beta1_InstanceOptions(in *v1beta2.Inst func autoConvert_v1beta1_InstanceSourceViaImageConfig_To_v1beta2_InstanceSourceViaImageConfig(in *InstanceSourceViaImageConfig, out *v1beta2.InstanceSourceViaImageConfig, s conversion.Scope) error { out.KmsKeyId = (*string)(unsafe.Pointer(in.KmsKeyId)) out.BootVolumeVpusPerGB = (*int64)(unsafe.Pointer(in.BootVolumeVpusPerGB)) + out.ImageLookup = (*v1beta2.ImageLookup)(unsafe.Pointer(in.ImageLookup)) return nil } @@ -1005,6 +1038,7 @@ func Convert_v1beta1_InstanceSourceViaImageConfig_To_v1beta2_InstanceSourceViaIm func autoConvert_v1beta2_InstanceSourceViaImageConfig_To_v1beta1_InstanceSourceViaImageConfig(in *v1beta2.InstanceSourceViaImageConfig, out *InstanceSourceViaImageConfig, s conversion.Scope) error { out.KmsKeyId = (*string)(unsafe.Pointer(in.KmsKeyId)) out.BootVolumeVpusPerGB = (*int64)(unsafe.Pointer(in.BootVolumeVpusPerGB)) + out.ImageLookup = (*ImageLookup)(unsafe.Pointer(in.ImageLookup)) return nil } diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go index 8f0aea45..652f1265 100644 --- a/api/v1beta1/zz_generated.deepcopy.go +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -385,6 +385,31 @@ func (in *IcmpOptions) DeepCopy() *IcmpOptions { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImageLookup) DeepCopyInto(out *ImageLookup) { + *out = *in + if in.OperatingSystem != nil { + in, out := &in.OperatingSystem, &out.OperatingSystem + *out = new(string) + **out = **in + } + if in.OperatingSystemVersion != nil { + in, out := &in.OperatingSystemVersion, &out.OperatingSystemVersion + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageLookup. +func (in *ImageLookup) DeepCopy() *ImageLookup { + if in == nil { + return nil + } + out := new(ImageLookup) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IngressSecurityRule) DeepCopyInto(out *IngressSecurityRule) { *out = *in @@ -509,6 +534,11 @@ func (in *InstanceSourceViaImageConfig) DeepCopyInto(out *InstanceSourceViaImage *out = new(int64) **out = **in } + if in.ImageLookup != nil { + in, out := &in.ImageLookup, &out.ImageLookup + *out = new(ImageLookup) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceSourceViaImageConfig. diff --git a/api/v1beta2/types.go b/api/v1beta2/types.go index 5544f530..aa77044d 100644 --- a/api/v1beta2/types.go +++ b/api/v1beta2/types.go @@ -180,9 +180,22 @@ type InstanceSourceViaImageConfig struct { // * `30`-`120`: Represents the Ultra High Performance option. // For volumes with the auto-tuned performance feature enabled, this is set to the default (minimum) VPUs/GB. BootVolumeVpusPerGB *int64 `json:"bootVolumeVpusPerGB,omitempty"` + + // ImageLookup defines the image lookup parameters for the node image. + ImageLookup *ImageLookup `json:"imageLookup,omitempty"` } -// LaunchInstanceAvailabilityConfigDetailsRecoveryActionEnum Enum with underlying type: string +// ImageLookup defines the image lookup parameters for the node image. +type ImageLookup struct { + // OperatingSystem defines operating system of the image. + // +optional + OperatingSystem *string `json:"operatingSystem,omitempty"` + + // OperatingSystemVersion defines operating system version of the image. + OperatingSystemVersion *string `json:"operatingSystemVersion,omitempty"` +} + +// PlatformConfigTypeEnum Enum with underlying type: string type PlatformConfigTypeEnum string // Set of constants representing the allowable values for LaunchInstanceAvailabilityConfigDetailsRecoveryActionEnum diff --git a/api/v1beta2/zz_generated.deepcopy.go b/api/v1beta2/zz_generated.deepcopy.go index 25e07349..32539b02 100644 --- a/api/v1beta2/zz_generated.deepcopy.go +++ b/api/v1beta2/zz_generated.deepcopy.go @@ -435,6 +435,31 @@ func (in *IcmpOptions) DeepCopy() *IcmpOptions { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImageLookup) DeepCopyInto(out *ImageLookup) { + *out = *in + if in.OperatingSystem != nil { + in, out := &in.OperatingSystem, &out.OperatingSystem + *out = new(string) + **out = **in + } + if in.OperatingSystemVersion != nil { + in, out := &in.OperatingSystemVersion, &out.OperatingSystemVersion + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageLookup. +func (in *ImageLookup) DeepCopy() *ImageLookup { + if in == nil { + return nil + } + out := new(ImageLookup) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IngressSecurityRule) DeepCopyInto(out *IngressSecurityRule) { *out = *in @@ -554,6 +579,11 @@ func (in *InstanceSourceViaImageConfig) DeepCopyInto(out *InstanceSourceViaImage *out = new(int64) **out = **in } + if in.ImageLookup != nil { + in, out := &in.ImageLookup, &out.ImageLookup + *out = new(ImageLookup) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceSourceViaImageConfig. diff --git a/cloud/scope/machine.go b/cloud/scope/machine.go index a43ea0a0..8d4533f5 100644 --- a/cloud/scope/machine.go +++ b/cloud/scope/machine.go @@ -159,8 +159,32 @@ func (m *MachineScope) GetOrCreateMachine(ctx context.Context) (*core.Instance, shapeConfig.BaselineOcpuUtilization = value } } + imageId := m.OCIMachine.Spec.ImageId + if imageId == "" { + if m.OCIMachine.Spec.InstanceSourceViaImageDetails != nil && + m.OCIMachine.Spec.InstanceSourceViaImageDetails.ImageLookup != nil { + lookupSpec := m.OCIMachine.Spec.InstanceSourceViaImageDetails.ImageLookup + response, err := m.ComputeClient.ListImages(ctx, core.ListImagesRequest{ + CompartmentId: common.String(m.getCompartmentId()), + OperatingSystem: lookupSpec.OperatingSystem, + OperatingSystemVersion: lookupSpec.OperatingSystemVersion, + Shape: common.String(m.OCIMachine.Spec.Shape), + Limit: common.Int(1), + SortBy: core.ListImagesSortByTimecreated, + }) + if err != nil { + return nil, err + } + if len(response.Items) == 0 { + return nil, errors.New(fmt.Sprintf("could not lookup image from lookup parameters")) + } + imageId = *response.Items[0].Id + } else { + return nil, errors.New(fmt.Sprintf("image id and image lookup not provided")) + } + } sourceDetails := core.InstanceSourceViaImageDetails{ - ImageId: common.String(m.OCIMachine.Spec.ImageId), + ImageId: common.String(imageId), } if m.OCIMachine.Spec.BootVolumeSizeInGBs != "" { bootVolumeSizeInGBsString := m.OCIMachine.Spec.BootVolumeSizeInGBs diff --git a/cloud/scope/machine_test.go b/cloud/scope/machine_test.go index a53477f1..cf47e7f9 100644 --- a/cloud/scope/machine_test.go +++ b/cloud/scope/machine_test.go @@ -218,9 +218,10 @@ func TestInstanceReconciliation(t *testing.T) { matchError: errors.New(fmt.Sprintf("bootVolumeSizeInGBs provided %s is not a valid floating point", "invalid")), testSpecificSetup: func(machineScope *MachineScope, computeClient *mock_compute.MockComputeClient) { + setupAllParams(ms) ms.OCIMachine.Spec.BootVolumeSizeInGBs = "invalid" computeClient.EXPECT().ListInstances(gomock.Any(), gomock.Eq(core.ListInstancesRequest{ - DisplayName: common.String("test"), + DisplayName: common.String("name"), CompartmentId: common.String("test"), })).Return(core.ListInstancesResponse{}, nil) }, @@ -231,6 +232,7 @@ func TestInstanceReconciliation(t *testing.T) { matchError: errors.New(fmt.Sprintf("bootVolumeSizeInGBs provided %s is not a valid floating point", "invalid")), testSpecificSetup: func(machineScope *MachineScope, computeClient *mock_compute.MockComputeClient) { + setupAllParams(ms) ms.OCIMachine.Spec.InstanceId = nil ms.OCIMachine.Name = "test" ms.OCIMachine.Spec.BootVolumeSizeInGBs = "invalid" @@ -246,9 +248,10 @@ func TestInstanceReconciliation(t *testing.T) { errorSubStringMatch: true, matchError: errors.New("invalid failure domain parameter, must be a valid integer"), testSpecificSetup: func(machineScope *MachineScope, computeClient *mock_compute.MockComputeClient) { + setupAllParams(ms) ms.Machine.Spec.FailureDomain = common.String("invalid") computeClient.EXPECT().ListInstances(gomock.Any(), gomock.Eq(core.ListInstancesRequest{ - DisplayName: common.String("test"), + DisplayName: common.String("name"), CompartmentId: common.String("test"), })).Return(core.ListInstancesResponse{}, nil) }, @@ -258,9 +261,10 @@ func TestInstanceReconciliation(t *testing.T) { errorExpected: true, matchError: errors.New("failure domain should be a value between 1 and 3"), testSpecificSetup: func(machineScope *MachineScope, computeClient *mock_compute.MockComputeClient) { + setupAllParams(ms) ms.Machine.Spec.FailureDomain = common.String("4") computeClient.EXPECT().ListInstances(gomock.Any(), gomock.Eq(core.ListInstancesRequest{ - DisplayName: common.String("test"), + DisplayName: common.String("name"), CompartmentId: common.String("test"), })).Return(core.ListInstancesResponse{}, nil) }, @@ -381,6 +385,92 @@ func TestInstanceReconciliation(t *testing.T) { OpcRetryToken: ociutil.GetOPCRetryToken("machineuid")})).Return(core.LaunchInstanceResponse{}, nil) }, }, + { + name: "image lookup", + errorExpected: false, + testSpecificSetup: func(machineScope *MachineScope, computeClient *mock_compute.MockComputeClient) { + setupAllParams(ms) + ms.OCIMachine.Spec.ImageId = "" + ms.OCIMachine.Spec.CapacityReservationId = common.String("cap-id") + ms.OCIMachine.Spec.DedicatedVmHostId = common.String("dedicated-host-id") + ms.OCIMachine.Spec.NetworkDetails.HostnameLabel = common.String("hostname-label") + ms.OCIMachine.Spec.NetworkDetails.SkipSourceDestCheck = common.Bool(true) + ms.OCIMachine.Spec.NetworkDetails.AssignPrivateDnsRecord = common.Bool(true) + ms.OCIMachine.Spec.NetworkDetails.DisplayName = common.String("display-name") + ms.OCIMachine.Spec.InstanceSourceViaImageDetails = &infrastructurev1beta2.InstanceSourceViaImageConfig{ + KmsKeyId: common.String("kms-key-id"), + BootVolumeVpusPerGB: common.Int64(32), + ImageLookup: &infrastructurev1beta2.ImageLookup{ + OperatingSystem: common.String("Oracle Linux"), + OperatingSystemVersion: common.String("8"), + }, + } + computeClient.EXPECT().ListInstances(gomock.Any(), gomock.Eq(core.ListInstancesRequest{ + DisplayName: common.String("name"), + CompartmentId: common.String("test"), + })).Return(core.ListInstancesResponse{}, nil) + + computeClient.EXPECT().ListImages(gomock.Any(), gomock.Eq(core.ListImagesRequest{ + CompartmentId: common.String("test"), + OperatingSystem: common.String("Oracle Linux"), + OperatingSystemVersion: common.String("8"), + Limit: common.Int(1), + Shape: common.String("shape"), + SortBy: core.ListImagesSortByTimecreated, + })).Return(core.ListImagesResponse{ + Items: []core.Image{ + { + Id: common.String("test-lookup-image"), + }, + }, + }, nil) + + launchDetails := core.LaunchInstanceDetails{DisplayName: common.String("name"), + CapacityReservationId: common.String("cap-id"), + DedicatedVmHostId: common.String("dedicated-host-id"), + SourceDetails: core.InstanceSourceViaImageDetails{ + ImageId: common.String("test-lookup-image"), + BootVolumeSizeInGBs: common.Int64(120), + KmsKeyId: common.String("kms-key-id"), + BootVolumeVpusPerGB: common.Int64(32), + }, + CreateVnicDetails: &core.CreateVnicDetails{ + SubnetId: common.String("nodesubnet"), + AssignPublicIp: common.Bool(false), + DefinedTags: map[string]map[string]interface{}{}, + FreeformTags: map[string]string{ + ociutil.CreatedBy: ociutil.OCIClusterAPIProvider, + ociutil.ClusterResourceIdentifier: "resource_uid", + }, + NsgIds: make([]string, 0), + HostnameLabel: common.String("hostname-label"), + SkipSourceDestCheck: common.Bool(true), + AssignPrivateDnsRecord: common.Bool(true), + DisplayName: common.String("display-name"), + }, + Metadata: map[string]string{ + "user_data": base64.StdEncoding.EncodeToString([]byte("test")), + }, + Shape: common.String("shape"), + ShapeConfig: &core.LaunchInstanceShapeConfigDetails{ + Ocpus: common.Float32(2), + MemoryInGBs: common.Float32(100), + BaselineOcpuUtilization: core.LaunchInstanceShapeConfigDetailsBaselineOcpuUtilization8, + }, + AvailabilityDomain: common.String("ad2"), + CompartmentId: common.String("test"), + IsPvEncryptionInTransitEnabled: common.Bool(true), + DefinedTags: map[string]map[string]interface{}{}, + FreeformTags: map[string]string{ + ociutil.CreatedBy: ociutil.OCIClusterAPIProvider, + ociutil.ClusterResourceIdentifier: "resource_uid", + }, + } + computeClient.EXPECT().LaunchInstance(gomock.Any(), gomock.Eq(core.LaunchInstanceRequest{ + LaunchInstanceDetails: launchDetails, + OpcRetryToken: ociutil.GetOPCRetryToken("machineuid")})).Return(core.LaunchInstanceResponse{}, nil) + }, + }, { name: "shape config is empty", errorExpected: false, diff --git a/cloud/scope/subnet_reconciler.go b/cloud/scope/subnet_reconciler.go index 83a8cbbc..683f1f75 100644 --- a/cloud/scope/subnet_reconciler.go +++ b/cloud/scope/subnet_reconciler.go @@ -49,6 +49,7 @@ func (s *ClusterScope) ReconcileSubnet(ctx context.Context) error { s.Logger.Info("Created the security list", "ocid", seclistId) desiredSubnet.SecurityList.ID = seclistId } else { + desiredSubnet.SecurityList.ID = securityList.Id if s.IsSecurityListEqual(*securityList, *desiredSubnet.SecurityList) { s.Logger.Info("No Reconciliation Required for Security List", "securitylist", securityList.Id) } else { diff --git a/cloud/services/compute/client.go b/cloud/services/compute/client.go index 58fda158..e907f453 100644 --- a/cloud/services/compute/client.go +++ b/cloud/services/compute/client.go @@ -29,4 +29,5 @@ type ComputeClient interface { ListInstances(ctx context.Context, request core.ListInstancesRequest) (response core.ListInstancesResponse, err error) AttachVnic(ctx context.Context, request core.AttachVnicRequest) (response core.AttachVnicResponse, err error) ListVnicAttachments(ctx context.Context, request core.ListVnicAttachmentsRequest) (response core.ListVnicAttachmentsResponse, err error) + ListImages(ctx context.Context, request core.ListImagesRequest) (response core.ListImagesResponse, err error) } diff --git a/cloud/services/compute/mock_compute/client_mock.go b/cloud/services/compute/mock_compute/client_mock.go index 56ad89df..9a329c5e 100644 --- a/cloud/services/compute/mock_compute/client_mock.go +++ b/cloud/services/compute/mock_compute/client_mock.go @@ -12,18 +12,18 @@ import ( core "github.com/oracle/oci-go-sdk/v65/core" ) -// MockComputeClient is a mock_computemanagement of ComputeClient interface. +// MockComputeClient is a mock of ComputeClient interface. type MockComputeClient struct { ctrl *gomock.Controller recorder *MockComputeClientMockRecorder } -// MockComputeClientMockRecorder is the mock_computemanagement recorder for MockComputeClient. +// MockComputeClientMockRecorder is the mock recorder for MockComputeClient. type MockComputeClientMockRecorder struct { mock *MockComputeClient } -// NewMockComputeClient creates a new mock_computemanagement instance. +// NewMockComputeClient creates a new mock instance. func NewMockComputeClient(ctrl *gomock.Controller) *MockComputeClient { mock := &MockComputeClient{ctrl: ctrl} mock.recorder = &MockComputeClientMockRecorder{mock} @@ -80,6 +80,21 @@ func (mr *MockComputeClientMockRecorder) LaunchInstance(ctx, request interface{} return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LaunchInstance", reflect.TypeOf((*MockComputeClient)(nil).LaunchInstance), ctx, request) } +// ListImages mocks base method. +func (m *MockComputeClient) ListImages(ctx context.Context, request core.ListImagesRequest) (core.ListImagesResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListImages", ctx, request) + ret0, _ := ret[0].(core.ListImagesResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListImages indicates an expected call of ListImages. +func (mr *MockComputeClientMockRecorder) ListImages(ctx, request interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListImages", reflect.TypeOf((*MockComputeClient)(nil).ListImages), ctx, request) +} + // ListInstances mocks base method. func (m *MockComputeClient) ListInstances(ctx context.Context, request core.ListInstancesRequest) (core.ListInstancesResponse, error) { m.ctrl.T.Helper() diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachines.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachines.yaml index 0ae23184..f4de960e 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachines.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachines.yaml @@ -188,6 +188,19 @@ spec: default (minimum) VPUs/GB.' format: int64 type: integer + imageLookup: + description: ImageLookup defines the image lookup parameters for + the node image. + properties: + operatingSystem: + description: OperatingSystem defines operating system of + the image. + type: string + operatingSystemVersion: + description: OperatingSystemVersion defines operating system + version of the image. + type: string + type: object kmsKeyId: description: KmsKeyId defines the OCID of the Key Management key to assign as the master encryption key for the boot volume. @@ -949,6 +962,19 @@ spec: default (minimum) VPUs/GB.' format: int64 type: integer + imageLookup: + description: ImageLookup defines the image lookup parameters for + the node image. + properties: + operatingSystem: + description: OperatingSystem defines operating system of + the image. + type: string + operatingSystemVersion: + description: OperatingSystemVersion defines operating system + version of the image. + type: string + type: object kmsKeyId: description: KmsKeyId defines the OCID of the Key Management key to assign as the master encryption key for the boot volume. diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachinetemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachinetemplates.yaml index 0a542241..0412bcae 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachinetemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachinetemplates.yaml @@ -206,6 +206,19 @@ spec: VPUs/GB.' format: int64 type: integer + imageLookup: + description: ImageLookup defines the image lookup parameters + for the node image. + properties: + operatingSystem: + description: OperatingSystem defines operating system of + the image. + type: string + operatingSystemVersion: + description: OperatingSystemVersion defines operating + system version of the image. + type: string + type: object kmsKeyId: description: KmsKeyId defines the OCID of the Key Management key to assign as the master encryption key for the boot @@ -946,6 +959,19 @@ spec: VPUs/GB.' format: int64 type: integer + imageLookup: + description: ImageLookup defines the image lookup parameters + for the node image. + properties: + operatingSystem: + description: OperatingSystem defines operating system of + the image. + type: string + operatingSystemVersion: + description: OperatingSystemVersion defines operating + system version of the image. + type: string + type: object kmsKeyId: description: KmsKeyId defines the OCID of the Key Management key to assign as the master encryption key for the boot diff --git a/exp/api/v1beta1/zz_generated.conversion.go b/exp/api/v1beta1/zz_generated.conversion.go index 314cfa85..060a497b 100644 --- a/exp/api/v1beta1/zz_generated.conversion.go +++ b/exp/api/v1beta1/zz_generated.conversion.go @@ -616,13 +616,13 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } - if err := s.AddConversionFunc((*v1beta2.OCIManagedMachinePoolSpec)(nil), (*OCIManagedMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_OCIManagedMachinePoolSpec_To_v1beta1_OCIManagedMachinePoolSpec(a.(*v1beta2.OCIManagedMachinePoolSpec), b.(*OCIManagedMachinePoolSpec), scope) + if err := s.AddConversionFunc((*v1beta2.OCIManagedControlPlaneStatus)(nil), (*OCIManagedControlPlaneStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_OCIManagedControlPlaneStatus_To_v1beta1_OCIManagedControlPlaneStatus(a.(*v1beta2.OCIManagedControlPlaneStatus), b.(*OCIManagedControlPlaneStatus), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*v1beta2.OCIManagedControlPlaneStatus)(nil), (*OCIManagedControlPlaneStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_OCIManagedControlPlaneStatus_To_v1beta1_OCIManagedControlPlaneStatus(a.(*v1beta2.OCIManagedControlPlaneStatus), b.(*OCIManagedControlPlaneStatus), scope) + if err := s.AddConversionFunc((*v1beta2.OCIManagedMachinePoolSpec)(nil), (*OCIManagedMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_OCIManagedMachinePoolSpec_To_v1beta1_OCIManagedMachinePoolSpec(a.(*v1beta2.OCIManagedMachinePoolSpec), b.(*OCIManagedMachinePoolSpec), scope) }); err != nil { return err }