Skip to content

Move GetLoggingConfig from cmd/broker to pkg/utils#9015

Open
Ankitsinghsisodya wants to merge 1 commit intoknative:mainfrom
Ankitsinghsisodya:refactor/move-get-logging-config
Open

Move GetLoggingConfig from cmd/broker to pkg/utils#9015
Ankitsinghsisodya wants to merge 1 commit intoknative:mainfrom
Ankitsinghsisodya:refactor/move-get-logging-config

Conversation

@Ankitsinghsisodya
Copy link
Copy Markdown

Summary

  • Move GetLoggingConfig out of package broker (cmd/broker/config.go) and into pkg/utils (pkg/utils/logging.go), where the other small cross-cutting helpers already live.
  • Update the four call sites (cmd/broker/filter, cmd/broker/ingress, cmd/jobsink, cmd/auth_proxy) to import pkg/utils instead of cmd/broker. cmd/jobsink and cmd/auth_proxy were importing cmd/broker solely for this helper.
  • Delete the now-empty cmd/broker package.

No behavior change — this is a pure code-organization refactor.

Fixes #8712

Test plan

  • go build ./...
  • go vet ./cmd/... ./pkg/utils/...
  • go test ./cmd/... ./pkg/utils/...
  • grep confirms no remaining references to cmdbroker or knative.dev/eventing/cmd/broker" anywhere in the repo

The GetLoggingConfig helper lived in package broker (cmd/broker/config.go)
even though it is generic and was being imported by non-broker commands
(jobsink, auth_proxy) just to read the logging ConfigMap. Move it into
pkg/utils alongside the other small cross-cutting helpers, update all
call sites, and delete the now-empty cmd/broker package.

Fixes knative#8712
Copilot AI review requested due to automatic review settings April 10, 2026 06:03
@knative-prow
Copy link
Copy Markdown

knative-prow bot commented Apr 10, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Ankitsinghsisodya
Once this PR has been reviewed and has the lgtm label, please assign cali0707 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details 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

@knative-prow knative-prow bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 10, 2026
@knative-prow
Copy link
Copy Markdown

knative-prow bot commented Apr 10, 2026

Hi @Ankitsinghsisodya. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

@knative-prow knative-prow bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 10, 2026
@knative-prow knative-prow bot requested review from Leo6Leo and matzew April 10, 2026 06:03
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors logging configuration access by relocating GetLoggingConfig out of the cmd/broker package and into pkg/utils, so multiple binaries can reuse it without importing a cmd/* package.

Changes:

  • Moved GetLoggingConfig into pkg/utils and updated its doc comment for clarity.
  • Updated the affected binaries (broker filter/ingress, jobsink, auth_proxy) to call utils.GetLoggingConfig.
  • Removed the now-unused knative.dev/eventing/cmd/broker import usage at the call sites.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/utils/logging.go Hosts GetLoggingConfig in pkg/utils (shared helper location).
cmd/jobsink/main.go Switches logging config lookup to utils.GetLoggingConfig.
cmd/broker/ingress/main.go Switches logging config lookup to utils.GetLoggingConfig and adds the utils import.
cmd/broker/filter/main.go Switches logging config lookup to utils.GetLoggingConfig and adds the utils import.
cmd/auth_proxy/main.go Switches logging setup to use utils.GetLoggingConfig and adds the utils import.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. 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.

Refactor GetLoggingConfig method

2 participants