Skip to content

Add support for cluster id #310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
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
5 changes: 5 additions & 0 deletions api/v1beta1/ocimachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ type OCIMachineSpec struct {
// Shape of the instance.
Shape string `json:"shape,omitempty"`

// ComputeClusterId refers to OCID of the compute cluster that the instance will be created in.
// Please refer https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/compute-clusters.htm for more details
ComputeClusterId *string `json:"computeClusterId,omitempty"`

// IpxeScript is the custom iPXE script that will run when the instance boots.
IpxeScript *string `json:"ipxeScript,omitempty"`

// CapacityReservationId defines the OCID of the compute capacity reservation this instance is launched under.
Expand Down
2 changes: 2 additions & 0 deletions api/v1beta1/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions api/v1beta2/ocimachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ type OCIMachineSpec struct {
// Shape of the instance.
Shape string `json:"shape,omitempty"`

// ComputeClusterId refers to OCID of the compute cluster that the instance will be created in.
// Please refer https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/compute-clusters.htm for more details
ComputeClusterId *string `json:"computeClusterId,omitempty"`

// IpxeScript is the custom iPXE script that will run when the instance boots.
IpxeScript *string `json:"ipxeScript,omitempty"`

// CapacityReservationId defines the OCID of the compute capacity reservation this instance is launched under.
Expand Down
5 changes: 5 additions & 0 deletions api/v1beta2/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 cloud/scope/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ func (m *MachineScope) GetOrCreateMachine(ctx context.Context) (*core.Instance,
AssignPrivateDnsRecord: m.OCIMachine.Spec.NetworkDetails.AssignPrivateDnsRecord,
DisplayName: m.OCIMachine.Spec.NetworkDetails.DisplayName,
},
ComputeClusterId: m.OCIMachine.Spec.ComputeClusterId,
Metadata: metadata,
Shape: common.String(m.OCIMachine.Spec.Shape),
AvailabilityDomain: common.String(availabilityDomain),
Expand Down
2 changes: 2 additions & 0 deletions cloud/scope/machine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ func TestInstanceReconciliation(t *testing.T) {
testSpecificSetup: func(machineScope *MachineScope, computeClient *mock_compute.MockComputeClient) {
setupAllParams(ms)
ms.OCIMachine.Spec.CapacityReservationId = common.String("cap-id")
ms.OCIMachine.Spec.ComputeClusterId = common.String("cluster-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)
Expand All @@ -342,6 +343,7 @@ func TestInstanceReconciliation(t *testing.T) {
launchDetails := core.LaunchInstanceDetails{DisplayName: common.String("name"),
CapacityReservationId: common.String("cap-id"),
DedicatedVmHostId: common.String("dedicated-host-id"),
ComputeClusterId: common.String("cluster-id"),
SourceDetails: core.InstanceSourceViaImageDetails{
ImageId: common.String("image"),
BootVolumeSizeInGBs: common.Int64(120),
Expand Down
14 changes: 14 additions & 0 deletions config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ spec:
compartmentId:
description: Compartment to launch the instance in.
type: string
computeClusterId:
description: ComputeClusterId refers to OCID of the compute cluster
that the instance will be created in. Please refer https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/compute-clusters.htm
for more details
type: string
dedicatedVmHostId:
description: DedicatedVmHostId defines the OCID of the dedicated VM
host.
Expand Down Expand Up @@ -194,6 +199,8 @@ spec:
type: string
type: object
ipxeScript:
description: IpxeScript is the custom iPXE script that will run when
the instance boots.
type: string
isPvEncryptionInTransitEnabled:
description: Is in transit encryption of volumes required.
Expand Down Expand Up @@ -899,6 +906,11 @@ spec:
compartmentId:
description: Compartment to launch the instance in.
type: string
computeClusterId:
description: ComputeClusterId refers to OCID of the compute cluster
that the instance will be created in. Please refer https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/compute-clusters.htm
for more details
type: string
dedicatedVmHostId:
description: DedicatedVmHostId defines the OCID of the dedicated VM
host.
Expand Down Expand Up @@ -955,6 +967,8 @@ spec:
type: string
type: object
ipxeScript:
description: IpxeScript is the custom iPXE script that will run when
the instance boots.
type: string
isPvEncryptionInTransitEnabled:
description: Is in transit encryption of volumes required.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ spec:
compartmentId:
description: Compartment to launch the instance in.
type: string
computeClusterId:
description: ComputeClusterId refers to OCID of the compute
cluster that the instance will be created in. Please refer
https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/compute-clusters.htm
for more details
type: string
dedicatedVmHostId:
description: DedicatedVmHostId defines the OCID of the dedicated
VM host.
Expand Down Expand Up @@ -213,6 +219,8 @@ spec:
type: string
type: object
ipxeScript:
description: IpxeScript is the custom iPXE script that will
run when the instance boots.
type: string
isPvEncryptionInTransitEnabled:
description: Is in transit encryption of volumes required.
Expand Down Expand Up @@ -893,6 +901,12 @@ spec:
compartmentId:
description: Compartment to launch the instance in.
type: string
computeClusterId:
description: ComputeClusterId refers to OCID of the compute
cluster that the instance will be created in. Please refer
https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/compute-clusters.htm
for more details
type: string
dedicatedVmHostId:
description: DedicatedVmHostId defines the OCID of the dedicated
VM host.
Expand Down Expand Up @@ -953,6 +967,8 @@ spec:
type: string
type: object
ipxeScript:
description: IpxeScript is the custom iPXE script that will
run when the instance boots.
type: string
isPvEncryptionInTransitEnabled:
description: Is in transit encryption of volumes required.
Expand Down
1 change: 0 additions & 1 deletion docs/src/managed/managedcluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ CAPI and CAPOCI components using clusterctl][install-cluster-api].

```bash
export EXP_MACHINE_POOL=true
export EXP_OKE=true
```

### OCI Security Policies
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/google/gofuzz v1.2.0
github.com/onsi/ginkgo/v2 v2.11.0
github.com/onsi/gomega v1.27.8
github.com/oracle/oci-go-sdk/v65 v65.40.1
github.com/oracle/oci-go-sdk/v65 v65.45.0
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.16.0
github.com/spf13/pflag v1.0.5
Expand Down
9 changes: 5 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,8 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM=
github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
github.com/oracle/oci-go-sdk/v65 v65.40.1 h1:nukjC4GfrpOxOEoGvqg8y31/11VtaeSnejF7icyMKJg=
github.com/oracle/oci-go-sdk/v65 v65.40.1/go.mod h1:MXMLMzHnnd9wlpgadPkdlkZ9YrwQmCOmbX5kjVEJodw=
github.com/oracle/oci-go-sdk/v65 v65.45.0 h1:EpCst/iZma9s8eYS0QJ9qsTmGxX5GPehYGN1jwGIteU=
github.com/oracle/oci-go-sdk/v65 v65.45.0/go.mod h1:IBEV9l1qBzUpo7zgGaRUhbB05BVfcDGYRFBCPlTcPp0=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
Expand Down Expand Up @@ -459,8 +459,9 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8=
github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
Expand Down Expand Up @@ -663,7 +664,7 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
Expand Down