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

move subnetID reconcilation for AWSEndpointServices #988

Merged

Conversation

sjenning
Copy link
Contributor

@sjenning sjenning commented Feb 8, 2022

What this PR does / why we need it:
#951 accidentally worked due to the NodePool being updated after the creation of the AWSEndpointServices, however, reconciliation of .spec.subnetIDs on AWSEndpointServices currently happens on a controller that doesn't watch AWSEndpointServices.

This moves the reconciliation of subnetIDs to the AWSEndpointServiceReconciler and adds a NodePool watch to that controller.

The mapping of NodePools <-> AWSEndpointServices is a little fragile. I'm open to suggestions.

Which issue(s) this PR fixes (optional, use fixes #<issue_number>(, fixes #<issue_number>, ...) format, where issue_number might be a GitHub issue, or a Jira story:
Fixes #

Checklist

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 8, 2022
return []reconcile.Request{}
}

// This is a pretty fragile but without a client or context with which to list the
Copy link
Contributor

Choose a reason for hiding this comment

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

An alternate would be to use a client and list the endpointservices here, the main drawback is that we can't handle errors

Copy link
Contributor Author

@sjenning sjenning Feb 8, 2022

Choose a reason for hiding this comment

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

Yeah, I thought of this but we still don't avoid a fragile mapping in that the HCP namespace has to be assumed from the nodepool Namespace and the node pool clusterName. All in all, it added complexity and was still fragile.

Copy link
Member

Choose a reason for hiding this comment

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

I thought of this but we still don't avoid a fragile mapping in that the HCP namespace has to be assumed from the nodepool Namespace and the node pool clusterName

Could fetch HC from nodePool.spec.clusterName.
Then HCP_namespace(HC) is a stronger contract.
Then list endpoints.
?

That said I think I lean towards the simplicity of current approach.
It'd be good though to document this 2 dependents aws endpoints controllers at some point may be here https://hypershift-docs.netlify.app/reference/controller-architecture/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds like this is acceptable for now

hypershift-operator/controllers/platform/aws/controller.go Outdated Show resolved Hide resolved
@sjenning
Copy link
Contributor Author

sjenning commented Feb 8, 2022

/retest

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 8, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 8, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alvaroaleman, sjenning

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:
  • OWNERS [alvaroaleman,sjenning]

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

@openshift-bot
Copy link

/retest-required

Please review the full test history for this PR and help us cut down flakes.

4 similar comments
@openshift-bot
Copy link

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 9, 2022

@sjenning: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/capi-provider-agent-sanity 5153d38 link false /test capi-provider-agent-sanity

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-merge-robot openshift-merge-robot merged commit 84cddca into openshift:main Feb 9, 2022
@sjenning sjenning deleted the move-subnetid-reconcile branch February 11, 2022 03:59
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. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants