Skip to content
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

Add instanceprincipal clusteridentity support #315

Conversation

shyamradhakrishnan
Copy link
Contributor

What this PR does / why we need it:

Add InstancePrincipal support to ClusterIdentity.

Just as an add on, some other cloud provider are also moving away from env variable based identity to use Cluster Identity. So this will help us to be on par.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #314

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Aug 7, 2023
@shyamradhakrishnan
Copy link
Contributor Author

unit test

GOBIN=/home/ubuntu/go/src/github.com/oracle/cluster-api-provider-oci/hack/tools/bin ./scripts/go_install.sh sigs.k8s.io/controller-runtime/tools/setup-envtest setup-envtest v0.0.0-20230131074648-f5014c077fc3
kube-builder assets: /home/ubuntu/.local/share/kubebuilder-envtest/k8s/1.24.2-linux-amd64
KUBEBUILDER_ASSETS="/home/ubuntu/.local/share/kubebuilder-envtest/k8s/1.24.2-linux-amd64" go test -coverprofile=coverage.out ./...
?   	github.com/oracle/cluster-api-provider-oci	[no test files]
ok  	github.com/oracle/cluster-api-provider-oci/api/v1beta1	58.251s	coverage: 23.7% of statements
ok  	github.com/oracle/cluster-api-provider-oci/api/v1beta2	0.094s	coverage: 15.7% of statements
?   	github.com/oracle/cluster-api-provider-oci/cloud/config	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/cloud/metrics	[no test files]
ok  	github.com/oracle/cluster-api-provider-oci/cloud/ociutil	0.004s	coverage: 19.6% of statements
ok  	github.com/oracle/cluster-api-provider-oci/cloud/scope	241.063s	coverage: 75.0% of statements
?   	github.com/oracle/cluster-api-provider-oci/cloud/scope/mocks	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/cloud/services/base	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/cloud/services/base/mock_base	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/cloud/services/compute	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/cloud/services/compute/mock_compute	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/cloud/services/computemanagement	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/cloud/services/computemanagement/mock_computemanagement	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/cloud/services/containerengine	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/cloud/services/containerengine/mock_containerengine	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/cloud/services/identity	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/cloud/services/identity/mock_identity	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/cloud/services/loadbalancer	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/cloud/services/loadbalancer/mock_lb	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/cloud/services/networkloadbalancer	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/cloud/services/networkloadbalancer/mock_nlb	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/cloud/services/vcn	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/cloud/services/vcn/mock_vcn	[no test files]
ok  	github.com/oracle/cluster-api-provider-oci/cloud/util	0.139s	coverage: 73.4% of statements
ok  	github.com/oracle/cluster-api-provider-oci/controllers	27.030s	coverage: 60.3% of statements
ok  	github.com/oracle/cluster-api-provider-oci/exp/api/v1beta1	14.292s	coverage: 15.2% of statements
ok  	github.com/oracle/cluster-api-provider-oci/exp/api/v1beta2	0.016s	coverage: 4.8% of statements
ok  	github.com/oracle/cluster-api-provider-oci/exp/controllers	0.435s	coverage: 58.4% of statements
?   	github.com/oracle/cluster-api-provider-oci/feature	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/version	[no test files]

@shyamradhakrishnan
Copy link
Contributor Author

e2e tests

Ran 7 of 28 Specs in 3681.027 seconds
SUCCESS! -- 7 Passed | 0 Failed | 0 Pending | 21 Skipped

Copy link
Member

@joekr joekr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super small change.

Does this change mean we now need to run our e2e tests within OCI and not on local machines or (in the future) prow? Since the managed virtual test uses instance principal?

api/v1beta2/ociclusteridentity_types.go Outdated Show resolved Hide resolved
@shyamradhakrishnan shyamradhakrishnan merged commit e7f3ec8 into oracle:main Aug 8, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for Instance Principals in Cluster Identity
2 participants