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

Set a Binding's owner reference, but not a controller reference #256

Merged
merged 4 commits into from
Aug 5, 2021

Conversation

JohnStarich
Copy link
Member

@JohnStarich JohnStarich commented Aug 4, 2021

Bindings currently have owner references set to their Service counterpart. However, they use controller: true today – which causes problems when orchestrated by other operators.

Bindings don't need controller: true since they weren't created by the operator, they were created by some other entity (e.g. CrossPlane operator or manually).
The controller owner reference really only belongs on Secrets it creates for a Binding object, since those are entirely managed by the controller. Further reading: Owners and dependents, ControllerRef proposal

To preserve backward compatibility, the owner reference remains but is no longer set as a "controller reference."

Fixes #222, fixes #254
Closes #255

@codecov
Copy link

codecov bot commented Aug 4, 2021

Codecov Report

Merging #256 (dc3a9a2) into master (da684b6) will increase coverage by 0.25%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #256      +/-   ##
==========================================
+ Coverage   92.07%   92.32%   +0.25%     
==========================================
  Files           6        6              
  Lines         757      821      +64     
==========================================
+ Hits          697      758      +61     
- Misses         39       41       +2     
- Partials       21       22       +1     
Impacted Files Coverage Δ
controllers/binding_controller.go 86.82% <100.00%> (+0.49%) ⬆️
controllers/manager_setup.go 96.29% <100.00%> (-1.67%) ⬇️
controllers/token_controller.go 100.00% <0.00%> (ø)
controllers/service_controller.go 97.91% <0.00%> (+0.17%) ⬆️
controllers/secret.go 89.28% <0.00%> (+1.28%) ⬆️
controllers/configmap.go 84.21% <0.00%> (+1.85%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update da684b6...dc3a9a2. Read the comment docs.

@JohnStarich JohnStarich marked this pull request as ready for review August 5, 2021 02:26
Copy link
Contributor

@DevTroyer DevTroyer left a comment

Choose a reason for hiding this comment

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

LGTM, one small comment.

@@ -76,10 +76,11 @@ type BindingReconciler struct {
GetCFServiceKeyCredentials cfservice.KeyGetter
GetServiceName resource.ServiceNameGetter
GetServiceRoleCRN iam.ServiceRolesGetter
SetControllerReference ControllerReferenceSetter
SetControllerReference OwnerReferenceSetter
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this still needed here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep! We still have controller references set on the Binding's generated secrets 👍

@DevTroyer DevTroyer merged commit 18de538 into master Aug 5, 2021
@DevTroyer DevTroyer deleted the bugfix/dual-controller-references branch August 5, 2021 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants