Skip to content

Conversation

aojea
Copy link
Member

@aojea aojea commented Jul 31, 2025

The defaultservicecidr controller runs as an apiserver PostStartHook hence can not block the startup.
The logic of the controller was copied from the common boilerplate and was assuming the controller blocked on start, hence defering the shutdown of the eventbroadcaster.

Only shutdown the eventbroadcaster when the context is done.

/kind bug

bugfix: the default serviceCIDR controller was not logging events because the event broadcaster was shutdown during its initialization.

Fixes: #133306

The defaultservicecidr controller runs as an apiserver PostStartHook
hence can not block the startup.
The logic of the controller was copied from the common boilerplate and
was assuming the controller blocked on start, hence defering the
shutdown of the eventbroadcaster.

Only shutdown the eventbroadcaster when the context is done.

Change-Id: I70426d5550afe3b12ab5ea68746238dd96f7db52
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jul 31, 2025
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Jul 31, 2025
@aojea
Copy link
Member Author

aojea commented Jul 31, 2025

/assign @danwinship

@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/network Categorizes an issue or PR as relevant to SIG Network. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jul 31, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aojea

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 Jul 31, 2025
go func() {
<-ctx.Done()
klog.Infof("Shutting down %s", controllerName)
c.eventBroadcaster.Shutdown()
Copy link
Contributor

Choose a reason for hiding this comment

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

someone ought to context-ify EventBroadcaster...

@danwinship
Copy link
Contributor

/lgtm
(though it doesn't actually log "shutting down" at all any more, at least in the e2e-gce logs)

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

LGTM label has been added.

Git tree hash: cad7b6a09401eff1ce090d42e95144ec7ad4e138

@seans3
Copy link
Contributor

seans3 commented Aug 5, 2025

/remove-sig api-machinery

@k8s-ci-robot k8s-ci-robot removed the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Aug 5, 2025
@k8s-ci-robot k8s-ci-robot merged commit 52f45c8 into kubernetes:master Aug 28, 2025
13 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.35 milestone Aug 28, 2025
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. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/network Categorizes an issue or PR as relevant to SIG Network. 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.

default_servicecidr_controller logs that it's shutting down at startup
4 participants