Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

added blank import to ensure correct workqueue metric registration #1388

Merged
merged 1 commit into from Mar 30, 2021
Merged

Conversation

cebernardi
Copy link
Contributor

@cebernardi cebernardi commented Mar 29, 2021

What this PR does / why we need it:
we're facing (as described here: #1386 and #1372) a racing condition on workqueue metrics registration, between

  • k8s.io/component-base/metrics/prometheus/workqueue
  • sigs.k8s.io/controller-runtime/pkg/metrics

what we want is sigs.k8s.io/controller-runtime/pkg/metrics to get registered first, but both of:

  • cmd/controller-manager/main.go
  • cmd/hyperfed/main.go

have a dependency from k8s.io/apiserver/pkg/server, that is bringing k8s.io/component-base/metrics/prometheus/workqueue into the picture (and it gets initialized before sigs.k8s.io/controller-runtime/pkg/metrics

this PR (#1386) solved the issue for the controller-manager executable produced with make build, but it doesn't solve it for the single hyperfed executable produced with make container as the compilation entrypoint is different (cmd/controller-manager/main.go vs cmd/hyperfed/main.go)

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

Special notes for your reviewer:

I'm not sure if worth it to uniform the output between make container and make build, so that we produce the same executable (hyperfed) on both targets.. please let me know your thoughts

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 29, 2021
@k8s-ci-robot k8s-ci-robot requested review from makkes and xunpan March 29, 2021 14:50
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Mar 29, 2021
@hectorj2f
Copy link
Contributor

/approve

@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 29, 2021
Copy link
Contributor

@mars1024 mars1024 left a comment

Choose a reason for hiding this comment

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

/lgtm, thanks!

Copy link
Contributor

@makkes makkes 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 Indicates that a PR is ready to be merged. label Mar 30, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cebernardi, hectorj2f, makkes, mars1024

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 merged commit 4dbd63b into kubernetes-retired:master Mar 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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 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.

5 participants