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

✨ Add discoverVariables runtime hook to ClusterClass reconcile loop #8006

Merged

Conversation

killianmuldoon
Copy link
Contributor

Add the discoverVariables call to the External patch definition in the ClusterClass and add an implementation of the call in the ClusterClass reconciler.

Part of #7985

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 26, 2023
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jan 26, 2023
@killianmuldoon killianmuldoon changed the title ✨ Add discoverVariables runtime hook to ClusterClass reconcile loop ✨ [WIP] Add discoverVariables runtime hook to ClusterClass reconcile loop Jan 26, 2023
@killianmuldoon killianmuldoon mentioned this pull request Jan 26, 2023
34 tasks
@killianmuldoon killianmuldoon force-pushed the pr-exvars-cc-call-hook branch 2 times, most recently from c9bc8c1 to f74f5d7 Compare January 26, 2023 17:56
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 27, 2023
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 30, 2023
@killianmuldoon
Copy link
Contributor Author

/retest

@killianmuldoon killianmuldoon force-pushed the pr-exvars-cc-call-hook branch 2 times, most recently from 1c6094b to 151a4d8 Compare February 1, 2023 11:20
@killianmuldoon killianmuldoon changed the title ✨ [WIP] Add discoverVariables runtime hook to ClusterClass reconcile loop ✨ Add discoverVariables runtime hook to ClusterClass reconcile loop Feb 1, 2023
@killianmuldoon
Copy link
Contributor Author

@sbueringer this is ready for review when you get a chance

Copy link
Member

@sbueringer sbueringer left a comment

Choose a reason for hiding this comment

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

Just nits

@killianmuldoon killianmuldoon force-pushed the pr-exvars-cc-call-hook branch 4 times, most recently from 29e0cad to 074c9a7 Compare February 2, 2023 17:55
@killianmuldoon
Copy link
Contributor Author

/retest

Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

Overall lgtm at a first pass, but In this PR or in a follow-up PR we should consider how to surface problems with a condition on ClusterClass for:

  • errors while calling extensions
  • conflicts

@killianmuldoon killianmuldoon force-pushed the pr-exvars-cc-call-hook branch 5 times, most recently from 79a2f76 to 879c60f Compare February 3, 2023 11:48
@sbueringer
Copy link
Member

/lgtm

/assign @fabriziopandini

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

LGTM label has been added.

Git tree hash: 6775fb012d966995b36392c133b55d1ade307501

Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

one last nit + a follow up

reconcileConditions(clusterClass, outdatedRefs)

return ctrl.Result{}, nil
}

func (r *Reconciler) reconcileVariables(ctx context.Context, clusterClass *clusterv1.ClusterClass) error {
Copy link
Member

Choose a reason for hiding this comment

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

Note: when we implement support for more than one variable definition with the same name we need a unit test for this function alone, eventually injecting something that replace the actual runtime call for test pourposes.

Another option will be to split the call to runtime extension from computing status (before we call all runtime extensions storing results in some temporary struct, then we compute status processing all the results), so we can actually unit test compute status in isolation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a note linking here to the umbrella issue.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 7, 2023
@sbueringer
Copy link
Member

/retest

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Feb 8, 2023

@killianmuldoon: 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
pull-cluster-api-apidiff-main 15291d0 link false /test pull-cluster-api-apidiff-main

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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.

@sbueringer
Copy link
Member

/lgtm
/approve

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

LGTM label has been added.

Git tree hash: 3b98b64a6b6760549a5ccf1428c9aaf8eefd0e3f

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbueringer

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 Feb 8, 2023
@k8s-ci-robot k8s-ci-robot merged commit cb410f7 into kubernetes-sigs:main Feb 8, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.4 milestone Feb 8, 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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants