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

Fix: add nil check on Machine and Network Load Balancer #349

Merged
merged 2 commits into from
Feb 8, 2024

Conversation

tozastation
Copy link
Contributor

What this PR does / why we need it:

  • This PR is "add nil check on"
    • cloud/scope/network_load_balancer_reconciler.go
    • cloud/scope/machine.go
  • Background
    • To prevent Go from crashing when using Pointer references

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 #348

Signed-off-by: tozastation <tozastation@gmail.com>
Signed-off-by: tozastation <tozastation@gmail.com>
Copy link

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Feb 8, 2024
@shyamradhakrishnan
Copy link
Member

@tozastation please get the Oracle contribution agreement done before we can go ahead with the PR

@tozastation
Copy link
Contributor Author

@shyamradhakrishnan
Thanks for the reminder. It was just implemented and is in an under review status!

Copy link

Thank you for signing the OCA.

@oracle-contributor-agreement oracle-contributor-agreement bot added OCA Verified All contributors have signed the Oracle Contributor Agreement. and removed OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. labels Feb 8, 2024
@tozastation tozastation changed the title [WIP] Fix: add nil check on Machine and Network Load Balancer Fix: add nil check on Machine and Network Load Balancer Feb 8, 2024
@shyamradhakrishnan
Copy link
Member

Can you please attach unit test output please

@tozastation
Copy link
Contributor Author

@shyamradhakrishnan

Sorry, the Oracle contribution agreement has been approved.
I have done the expected work and committed it, so could you please review it when you have time?

@shyamradhakrishnan
Copy link
Member

@tozastation Can you please attach unit test output please, you can do via make test, and justpast the output here as a comment.

@tozastation
Copy link
Contributor Author

@shyamradhakrishnan

Sorry, this is make test result

❯ make test
fatal: No names found, cannot describe anything.
GOBIN=/Users/tozastation/ghq/github.com/tozastation/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: /Users/tozastation/Library/Application Support/io.kubebuilder.envtest/k8s/1.24.2-darwin-arm64
KUBEBUILDER_ASSETS="/Users/tozastation/Library/Application Support/io.kubebuilder.envtest/k8s/1.24.2-darwin-arm64" go test -coverprofile=coverage.out ./...
?   	github.com/oracle/cluster-api-provider-oci	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/cloud/config	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/cloud/metrics	[no test files]
?   	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/mock_computemanagement	[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/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/containerengine/mock_containerengine	[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]
?   	github.com/oracle/cluster-api-provider-oci/feature	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/version	[no test files]
ok  	github.com/oracle/cluster-api-provider-oci/api/v1beta1	24.432s	coverage: 23.7% of statements
ok  	github.com/oracle/cluster-api-provider-oci/api/v1beta2	1.477s	coverage: 15.6% of statements
ok  	github.com/oracle/cluster-api-provider-oci/cloud/ociutil	1.422s	coverage: 19.6% of statements

ok  	github.com/oracle/cluster-api-provider-oci/cloud/scope	229.213s	coverage: 75.1% of statements
ok  	github.com/oracle/cluster-api-provider-oci/cloud/util	1.094s	coverage: 61.1% of statements
ok  	github.com/oracle/cluster-api-provider-oci/controllers	28.480s	coverage: 58.7% of statements
ok  	github.com/oracle/cluster-api-provider-oci/exp/api/v1beta1	9.059s	coverage: 15.3% of statements
ok  	github.com/oracle/cluster-api-provider-oci/exp/api/v1beta2	2.194s	coverage: 4.8% of statements
ok  	github.com/oracle/cluster-api-provider-oci/exp/controllers	4.350s	coverage: 56.3% of statements
go tool cover -func=coverage.out -o coverage.txt
go tool cover -html=coverage.out -o coverage.html

@shyamradhakrishnan shyamradhakrishnan merged commit 8acfb46 into oracle:main Feb 8, 2024
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.

Crash loop backoff when creating NLB without Subnet ID
2 participants