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

Tags should not be sent in update API calls #131

Merged

Conversation

shyamradhakrishnan
Copy link
Member

What this PR does / why we need it:

Ignore sending freeform and defined tags during update of resources

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

@shyamradhakrishnan
Copy link
Member Author

e2e tests

• [SLOW TEST:922.917 seconds]
Workload cluster creation
/home/ubuntu/go/src/github.com/oracle/cluster-api-provider-oci/test/e2e/cluster_test.go:50
  ClusterClass - with 1 control-plane nodes and 1 worker nodes [PRBlocking]
  /home/ubuntu/go/src/github.com/oracle/cluster-api-provider-oci/test/e2e/cluster_test.go:471
------------------------------
STEP: Tearing down the management cluster


Ran 5 of 22 Specs in 2189.808 seconds
SUCCESS! -- 5 Passed | 0 Failed | 0 Pending | 17 Skipped


Ginkgo ran 1 suite in 37m21.620718647s
Test Suite Passed
make[1]: Leaving directory '/home/ubuntu/go/src/github.com/oracle/cluster-api-provider-oci'

@shyamradhakrishnan shyamradhakrishnan changed the title Ignore default tags during reconciliation Tags should not be sent in update API calls Aug 24, 2022
@shyamradhakrishnan
Copy link
Member Author

unit tests

/Users/shyaradh/oke/src/github.com/oracle/cluster-api-provider-oci/bin/controller-gen "crd" \
		rbac:roleName=manager-role webhook \
		paths="./api/..." \
		paths="./exp/api/..." \
		output:crd:artifacts:config=config/crd/bases
/Users/shyaradh/oke/src/github.com/oracle/cluster-api-provider-oci/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./api/..." paths="./exp/api/..."
go fmt ./...
go vet ./...
mkdir -p /Users/shyaradh/oke/src/github.com/oracle/cluster-api-provider-oci/testbin
test -f /Users/shyaradh/oke/src/github.com/oracle/cluster-api-provider-oci/testbin/setup-envtest.sh || curl -sSLo /Users/shyaradh/oke/src/github.com/oracle/cluster-api-provider-oci/testbin/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/v0.8.3/hack/setup-envtest.sh
source /Users/shyaradh/oke/src/github.com/oracle/cluster-api-provider-oci/testbin/setup-envtest.sh; fetch_envtest_tools /Users/shyaradh/oke/src/github.com/oracle/cluster-api-provider-oci/testbin; setup_envtest_env /Users/shyaradh/oke/src/github.com/oracle/cluster-api-provider-oci/testbin; go test ./... -coverprofile cover.out && go tool cover -html=cover.out -o cover.html
Using cached envtest tools from /Users/shyaradh/oke/src/github.com/oracle/cluster-api-provider-oci/testbin
setting up env vars
?   	github.com/oracle/cluster-api-provider-oci	[no test files]
ok  	github.com/oracle/cluster-api-provider-oci/api/v1beta1	0.976s	coverage: 18.7% of statements
?   	github.com/oracle/cluster-api-provider-oci/cloud/config	[no test files]
ok  	github.com/oracle/cluster-api-provider-oci/cloud/ociutil	0.535s	coverage: 25.0% of statements
ok  	github.com/oracle/cluster-api-provider-oci/cloud/scope	166.995s	coverage: 72.9% of statements
?   	github.com/oracle/cluster-api-provider-oci/cloud/scope/mocks	[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/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/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/controllers	27.018s	coverage: 71.0% of statements
?   	github.com/oracle/cluster-api-provider-oci/exp/api/v1beta1	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/exp/controllers	[no test files]
?   	github.com/oracle/cluster-api-provider-oci/feature	[no test files]

joekr
joekr previously approved these changes Aug 24, 2022
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.

While reading through this I had a question: once the cluster is created and the user manually modifies tags it won't impact the cluster unless they modify the tags related to IsResourceCreatedByClusterAPI correct?

So if they modify the ClusterResourceIdentifier we will assume the cluster has been modified and no longer try to reconcile it.

cloud/scope/vcn_reconciler.go Outdated Show resolved Hide resolved
cloud/scope/route_table_reconciler.go Show resolved Hide resolved
@shyamradhakrishnan shyamradhakrishnan merged commit 8daee8c into oracle:main Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tags should be sent during upgrade of resources
2 participants