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

✨ Implements AfterControlPlaneInitialized, AfterControlPlaneUpgrade and AfterClusterUpgrade hooks #6629

Conversation

ykakarap
Copy link
Contributor

@ykakarap ykakarap commented Jun 13, 2022

What this PR does / why we need it:

This PR implements the following hooks:

  • AfterControlPlaneInitialized
  • AfterControlPlaneUpgrade
  • AfterClusterUpgrade

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Part of #6546

Important Links:

/area runtime-sdk

@k8s-ci-robot k8s-ci-robot added area/runtime-sdk Issues or PRs related to Runtime SDK cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 13, 2022
@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jun 13, 2022
@ykakarap
Copy link
Contributor Author

This PR covers the needed implementation for the 4 hooks.

This PR needs clean up before it is ready for review.

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.

First round of review.

Please rebase to main ASAP. Just to make sure it works with SSA

internal/runtime/client/fake/fake_client.go Outdated Show resolved Hide resolved
internal/runtime/client/fake/fake_client.go Outdated Show resolved Hide resolved
internal/runtime/client/fake/fake_client.go Outdated Show resolved Hide resolved
internal/hooks/util.go Outdated Show resolved Hide resolved
internal/hooks/util.go Outdated Show resolved Hide resolved
internal/hooks/util.go Outdated Show resolved Hide resolved
internal/controllers/topology/cluster/desired_state.go Outdated Show resolved Hide resolved
internal/controllers/topology/cluster/reconcile_state.go Outdated Show resolved Hide resolved
internal/controllers/topology/cluster/reconcile_state.go Outdated Show resolved Hide resolved
@enxebre
Copy link
Member

enxebre commented Jun 13, 2022

@ykakarap do we have a proposal PR, or a PR extending existing proposal or at minimum an issue where we can flesh out an overall plan? e.g outline all the hooks we plan to implement and why/how are they meant to be useful? We'll also want to include docs for the hooks available to extension implementers.

@fabriziopandini
Copy link
Member

Adding a couple of links with the proposals & the tracking issue requested by Alberto (@ykakarap, it could be useful to add those links in the in the PR description):

The tracking issues have tasks for docs as well

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 13, 2022
@ykakarap ykakarap force-pushed the runtime-sdk_lifecycle-hooks_tracking-hooks branch from 91711cd to 09f728b Compare June 14, 2022 02:02
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 14, 2022
@ykakarap ykakarap changed the title ✨ [WIP] Implements AfterControlPlaneInitialized, AfterControlPlaneUpgrade, AfterClusterUpgrade and BeforeClusterDelete hooks ✨ Implements AfterControlPlaneInitialized, AfterControlPlaneUpgrade, AfterClusterUpgrade and BeforeClusterDelete hooks Jun 14, 2022
@ykakarap ykakarap changed the title ✨ Implements AfterControlPlaneInitialized, AfterControlPlaneUpgrade, AfterClusterUpgrade and BeforeClusterDelete hooks ✨ Implements AfterControlPlaneInitialized, AfterControlPlaneUpgrade and AfterClusterUpgrade hooks Jun 14, 2022
@sbueringer sbueringer force-pushed the runtime-sdk_lifecycle-hooks_tracking-hooks branch from 09f728b to 4c55b03 Compare June 14, 2022 05:13
@sbueringer
Copy link
Member

@ykakarap fyi. I rebased onto main to drop the Before hooks commit to make the differ simpler

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.

I skipped the topology/cluster package for now

exp/runtime/hooks/api/v1alpha1/common_types.go Outdated Show resolved Hide resolved
internal/hooks/tracking_test.go Outdated Show resolved Hide resolved
internal/controllers/topology/cluster/desired_state.go Outdated Show resolved Hide resolved
internal/controllers/topology/cluster/reconcile_state.go Outdated Show resolved Hide resolved
exp/runtime/hooks/api/v1alpha1/common_types.go Outdated Show resolved Hide resolved
internal/hooks/tracking.go Outdated Show resolved Hide resolved
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.

Great work!
Mostly nits about improving comments

internal/controllers/topology/cluster/desired_state.go Outdated Show resolved Hide resolved
internal/controllers/topology/cluster/desired_state.go Outdated Show resolved Hide resolved
internal/hooks/tracking.go Outdated Show resolved Hide resolved
internal/hooks/tracking.go Outdated Show resolved Hide resolved
internal/hooks/tracking.go Outdated Show resolved Hide resolved
internal/hooks/tracking.go Outdated Show resolved Hide resolved
internal/hooks/tracking.go Outdated Show resolved Hide resolved
internal/hooks/tracking.go Outdated Show resolved Hide resolved
internal/controllers/topology/cluster/reconcile_state.go Outdated Show resolved Hide resolved
internal/controllers/topology/cluster/desired_state.go Outdated Show resolved Hide resolved
@sbueringer
Copy link
Member

Only nits from my side. Really great work @ykakarap !

Copy link
Contributor

@killianmuldoon killianmuldoon left a comment

Choose a reason for hiding this comment

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

Awesome!

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 16, 2022
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.

Great work!
/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini

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 Jun 16, 2022
@k8s-ci-robot k8s-ci-robot merged commit 8d7f010 into kubernetes-sigs:main Jun 16, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.2 milestone Jun 16, 2022
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. area/runtime-sdk Issues or PRs related to Runtime SDK 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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants