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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃尡 ClusterCacheTracker: drop unused Log field #6318

Merged
merged 1 commit into from Mar 28, 2022

Conversation

sbueringer
Copy link
Member

@sbueringer sbueringer commented Mar 21, 2022

Signed-off-by: Stefan B眉ringer buringerst@vmware.com

What this PR does / why we need it:
As we are always using the logger from context we don't have to set the Log field anymore, so let's drop it.

Note: before this PR the fields was written a few times, but never read.

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 #

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 21, 2022
@enxebre
Copy link
Member

enxebre commented Mar 21, 2022

lgtm, technically incompatible change?

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.

We should deprecate the field in the struct for a release before removing, right? We can remove the use of the field through the code though.

@fabriziopandini
Copy link
Member

fabriziopandini commented Mar 21, 2022

Note: we can do breaking changes in golang between minors, it is just a matter to document them (only API types and CLI have different guarantees)

@killianmuldoon
Copy link
Contributor

Given that this type is likely to be set outside the codebase I think deprecation and removal at the next version update would be better for consumers, even if outright removal is allowed.

@sbueringer
Copy link
Member Author

Yup looks like based on our guidelines I have to deprecate it in a minor release first: https://github.com/kubernetes-sigs/cluster-api/blob/88b5a8edc855775a2545b61d30b1470c6b21f26d/CONTRIBUTING.md#codebase-and-go-modules

I'll change the PR to still drop all usages but only deprecate the field in the struct.

Signed-off-by: Stefan B眉ringer buringerst@vmware.com
@@ -44,6 +45,7 @@ type ClusterCacheReconciler struct {

func (r *ClusterCacheReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error {
err := ctrl.NewControllerManagedBy(mgr).
Named("remote/clustercache").
Copy link
Member Author

Choose a reason for hiding this comment

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

@fabriziopandini I set the name here.

This will lead to a "controller": "remote/clustercache" k/v pair.

Before this PR the logs from this controller had "controller": "cluster" (same as the cluster controller).

Note: This info is based on controller-runtime main. The current v0.11 release will only use the name as prefix for messages ("controller/cluster: <msg>").

@fabriziopandini
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 22, 2022
@enxebre
Copy link
Member

enxebre commented Mar 28, 2022

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: enxebre

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 Mar 28, 2022
@k8s-ci-robot k8s-ci-robot merged commit d61b7b9 into kubernetes-sigs:main Mar 28, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.2 milestone Mar 28, 2022
@sbueringer sbueringer deleted the pr-drop-unused-logger branch March 28, 2022 18:11
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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants