Skip to content

Conversation

Danil-Grigorev
Copy link
Member

What this PR does / why we need it:

Healthcheck implementation expects deployment availability and an ownership reference pointing to the owner resource, to mark the provider as ready. However if the provider manifest is owned by some other resource, the second ownership reference appears on the deployment too, which is unexpected.

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

- Prevent applied manifes from duplicating owner references from the
  provider object.
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 11, 2023
@Fedosin
Copy link
Contributor

Fedosin commented Dec 11, 2023

Hey! Probably we need to fix this issue here: https://github.com/kubernetes-sigs/cluster-api-operator/blob/main/internal/controller/healthcheck/healthcheck_controller.go#L71-L76

Probably it's okay to have multiple owners for deployments, but there should be only one Provider owner. So, if we have just one owner, we need to add a check that this owner is a Prover CR. Otherwise we have to iterate over the owners and find the Provider one (or return an error if nothing found)

@Danil-Grigorev
Copy link
Member Author

Hey! Probably we need to fix this issue here: https://github.com/kubernetes-sigs/cluster-api-operator/blob/main/internal/controller/healthcheck/healthcheck_controller.go#L71-L76

Probably it's okay to have multiple owners for deployments, but there should be only one Provider owner. So, if we have just one owner, we need to add a check that this owner is a Prover CR. Otherwise we have to iterate over the owners and find the Provider one (or return an error if nothing found)

I tried to refactor the reconciler which will fix this issue. Here is a separate PR for that: #354

@Fedosin
Copy link
Contributor

Fedosin commented Dec 13, 2023

/retest

Copy link
Contributor

@Fedosin Fedosin left a comment

Choose a reason for hiding this comment

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

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Fedosin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 13, 2023
@Fedosin
Copy link
Contributor

Fedosin commented Dec 13, 2023

/retest

@Fedosin
Copy link
Contributor

Fedosin commented Dec 13, 2023

The patch is good, thanks for fixing the bug!

Copy link
Contributor

@Fedosin Fedosin left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 13, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: ac84d968ffbb0634713121d2b994f01a0288d0ad

@k8s-ci-robot k8s-ci-robot merged commit 5669f73 into kubernetes-sigs:main Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CoreProvider never becomes ready

3 participants