Skip to content

Commit bb5aea3

Browse files
Add support for cluster id (#310)
* Add support for compute cluster id
1 parent 0cbecd1 commit bb5aea3

12 files changed

+61
-6
lines changed

api/v1beta1/ocimachine_types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ type OCIMachineSpec struct {
4848
// Shape of the instance.
4949
Shape string `json:"shape,omitempty"`
5050

51+
// ComputeClusterId refers to OCID of the compute cluster that the instance will be created in.
52+
// Please refer https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/compute-clusters.htm for more details
53+
ComputeClusterId *string `json:"computeClusterId,omitempty"`
54+
55+
// IpxeScript is the custom iPXE script that will run when the instance boots.
5156
IpxeScript *string `json:"ipxeScript,omitempty"`
5257

5358
// CapacityReservationId defines the OCID of the compute capacity reservation this instance is launched under.

api/v1beta1/zz_generated.conversion.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1beta2/ocimachine_types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ type OCIMachineSpec struct {
4848
// Shape of the instance.
4949
Shape string `json:"shape,omitempty"`
5050

51+
// ComputeClusterId refers to OCID of the compute cluster that the instance will be created in.
52+
// Please refer https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/compute-clusters.htm for more details
53+
ComputeClusterId *string `json:"computeClusterId,omitempty"`
54+
55+
// IpxeScript is the custom iPXE script that will run when the instance boots.
5156
IpxeScript *string `json:"ipxeScript,omitempty"`
5257

5358
// CapacityReservationId defines the OCID of the compute capacity reservation this instance is launched under.

api/v1beta2/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cloud/scope/machine.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ func (m *MachineScope) GetOrCreateMachine(ctx context.Context) (*core.Instance,
245245
AssignPrivateDnsRecord: m.OCIMachine.Spec.NetworkDetails.AssignPrivateDnsRecord,
246246
DisplayName: m.OCIMachine.Spec.NetworkDetails.DisplayName,
247247
},
248+
ComputeClusterId: m.OCIMachine.Spec.ComputeClusterId,
248249
Metadata: metadata,
249250
Shape: common.String(m.OCIMachine.Spec.Shape),
250251
AvailabilityDomain: common.String(availabilityDomain),

cloud/scope/machine_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ func TestInstanceReconciliation(t *testing.T) {
325325
testSpecificSetup: func(machineScope *MachineScope, computeClient *mock_compute.MockComputeClient) {
326326
setupAllParams(ms)
327327
ms.OCIMachine.Spec.CapacityReservationId = common.String("cap-id")
328+
ms.OCIMachine.Spec.ComputeClusterId = common.String("cluster-id")
328329
ms.OCIMachine.Spec.DedicatedVmHostId = common.String("dedicated-host-id")
329330
ms.OCIMachine.Spec.NetworkDetails.HostnameLabel = common.String("hostname-label")
330331
ms.OCIMachine.Spec.NetworkDetails.SkipSourceDestCheck = common.Bool(true)
@@ -342,6 +343,7 @@ func TestInstanceReconciliation(t *testing.T) {
342343
launchDetails := core.LaunchInstanceDetails{DisplayName: common.String("name"),
343344
CapacityReservationId: common.String("cap-id"),
344345
DedicatedVmHostId: common.String("dedicated-host-id"),
346+
ComputeClusterId: common.String("cluster-id"),
345347
SourceDetails: core.InstanceSourceViaImageDetails{
346348
ImageId: common.String("image"),
347349
BootVolumeSizeInGBs: common.Int64(120),

config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachines.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ spec:
138138
compartmentId:
139139
description: Compartment to launch the instance in.
140140
type: string
141+
computeClusterId:
142+
description: ComputeClusterId refers to OCID of the compute cluster
143+
that the instance will be created in. Please refer https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/compute-clusters.htm
144+
for more details
145+
type: string
141146
dedicatedVmHostId:
142147
description: DedicatedVmHostId defines the OCID of the dedicated VM
143148
host.
@@ -194,6 +199,8 @@ spec:
194199
type: string
195200
type: object
196201
ipxeScript:
202+
description: IpxeScript is the custom iPXE script that will run when
203+
the instance boots.
197204
type: string
198205
isPvEncryptionInTransitEnabled:
199206
description: Is in transit encryption of volumes required.
@@ -899,6 +906,11 @@ spec:
899906
compartmentId:
900907
description: Compartment to launch the instance in.
901908
type: string
909+
computeClusterId:
910+
description: ComputeClusterId refers to OCID of the compute cluster
911+
that the instance will be created in. Please refer https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/compute-clusters.htm
912+
for more details
913+
type: string
902914
dedicatedVmHostId:
903915
description: DedicatedVmHostId defines the OCID of the dedicated VM
904916
host.
@@ -955,6 +967,8 @@ spec:
955967
type: string
956968
type: object
957969
ipxeScript:
970+
description: IpxeScript is the custom iPXE script that will run when
971+
the instance boots.
958972
type: string
959973
isPvEncryptionInTransitEnabled:
960974
description: Is in transit encryption of volumes required.

config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachinetemplates.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ spec:
153153
compartmentId:
154154
description: Compartment to launch the instance in.
155155
type: string
156+
computeClusterId:
157+
description: ComputeClusterId refers to OCID of the compute
158+
cluster that the instance will be created in. Please refer
159+
https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/compute-clusters.htm
160+
for more details
161+
type: string
156162
dedicatedVmHostId:
157163
description: DedicatedVmHostId defines the OCID of the dedicated
158164
VM host.
@@ -213,6 +219,8 @@ spec:
213219
type: string
214220
type: object
215221
ipxeScript:
222+
description: IpxeScript is the custom iPXE script that will
223+
run when the instance boots.
216224
type: string
217225
isPvEncryptionInTransitEnabled:
218226
description: Is in transit encryption of volumes required.
@@ -893,6 +901,12 @@ spec:
893901
compartmentId:
894902
description: Compartment to launch the instance in.
895903
type: string
904+
computeClusterId:
905+
description: ComputeClusterId refers to OCID of the compute
906+
cluster that the instance will be created in. Please refer
907+
https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/compute-clusters.htm
908+
for more details
909+
type: string
896910
dedicatedVmHostId:
897911
description: DedicatedVmHostId defines the OCID of the dedicated
898912
VM host.
@@ -953,6 +967,8 @@ spec:
953967
type: string
954968
type: object
955969
ipxeScript:
970+
description: IpxeScript is the custom iPXE script that will
971+
run when the instance boots.
956972
type: string
957973
isPvEncryptionInTransitEnabled:
958974
description: Is in transit encryption of volumes required.

docs/src/managed/managedcluster.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ CAPI and CAPOCI components using clusterctl][install-cluster-api].
4444

4545
```bash
4646
export EXP_MACHINE_POOL=true
47-
export EXP_OKE=true
4847
```
4948

5049
### OCI Security Policies

0 commit comments

Comments
 (0)