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

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/google/gofuzz v1.2.0
99
github.com/onsi/ginkgo/v2 v2.11.0
1010
github.com/onsi/gomega v1.27.8
11-
github.com/oracle/oci-go-sdk/v65 v65.40.1
11+
github.com/oracle/oci-go-sdk/v65 v65.45.0
1212
github.com/pkg/errors v0.9.1
1313
github.com/prometheus/client_golang v1.16.0
1414
github.com/spf13/pflag v1.0.5

go.sum

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,8 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8
368368
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
369369
github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM=
370370
github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
371-
github.com/oracle/oci-go-sdk/v65 v65.40.1 h1:nukjC4GfrpOxOEoGvqg8y31/11VtaeSnejF7icyMKJg=
372-
github.com/oracle/oci-go-sdk/v65 v65.40.1/go.mod h1:MXMLMzHnnd9wlpgadPkdlkZ9YrwQmCOmbX5kjVEJodw=
371+
github.com/oracle/oci-go-sdk/v65 v65.45.0 h1:EpCst/iZma9s8eYS0QJ9qsTmGxX5GPehYGN1jwGIteU=
372+
github.com/oracle/oci-go-sdk/v65 v65.45.0/go.mod h1:IBEV9l1qBzUpo7zgGaRUhbB05BVfcDGYRFBCPlTcPp0=
373373
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
374374
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
375375
github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
@@ -459,8 +459,9 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
459459
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
460460
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
461461
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
462-
github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
463462
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
463+
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
464+
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
464465
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
465466
github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8=
466467
github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
@@ -663,7 +664,7 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc
663664
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
664665
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
665666
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
666-
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
667+
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
667668
golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
668669
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
669670
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=

0 commit comments

Comments
 (0)