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

[BUGFIX] defaulting partial ControllerConfiguration logging options #6276

Conversation

inteon
Copy link
Member

@inteon inteon commented Aug 15, 2023

The current defaulting logic for the ControllerConfiguration logging options fails in case a partial logging configuration is provided.
(it only defaults the logging options in case no logging options are provided, and does not default any of the logging option fields in case a partial configuration is provided)

Introduced in #5337, this has not been released yet.

This is how you can test the logging options:

$ cat config.yaml 
apiVersion: controller.config.cert-manager.io/v1alpha1
kind: ControllerConfiguration
logging:
  format: json
$ _bin/server/controller-linux-amd64 --config config.yaml 
{"ts":1692259054053.9272,"caller":"clientcmd/client_config.go:618","msg":"Neither --kubeconfig nor --master was specified.  Using the inClusterConfig.  This might not work.\n","v":0}
{"ts":1692259054053.972,"caller":"clientcmd/client_config.go:623","msg":"error creating inClusterConfig, falling back to default config: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined\n","v":0}
{"ts":1692259054054.059,"caller":"app/start.go:152","msg":"cert-manager: Failed to run the controller","err":"error creating rest config: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable"}

Kind

/kind bug

Release Note

NONE

@jetstack-bot jetstack-bot added kind/bug Categorizes issue or PR as related to a bug. release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. area/api Indicates a PR directly modifies the 'pkg/apis' directory area/testing Issues relating to testing approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 15, 2023
@inteon inteon added this to the 1.13 milestone Aug 15, 2023
@inteon inteon force-pushed the fix_controller_logging_options_defaulting branch 2 times, most recently from ca12c0c to 240d3fc Compare August 17, 2023 07:56
@wallrj wallrj self-requested a review August 17, 2023 08:46
Copy link
Member

@wallrj wallrj left a comment

Choose a reason for hiding this comment

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

I think I spotted a typo. Otherwise looks good to me.

It looks like you found an existing logging API struct which is now embedded into our configuration.
Have I understood correctly?
Is that same struct also embedded in the webhook configuration?

cmd/controller/app/start.go Outdated Show resolved Hide resolved
@inteon
Copy link
Member Author

inteon commented Aug 17, 2023

Is that same struct also embedded in the webhook configuration?

Not yet, I want to do that in this PR: #6243

…ere config would not be correctly defaulted in case a partial logging configuration is provided.

Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
@inteon inteon force-pushed the fix_controller_logging_options_defaulting branch from ff053e4 to e8b5b2e Compare August 17, 2023 09:19
@inteon inteon requested a review from wallrj August 17, 2023 09:19
Copy link
Member

@wallrj wallrj left a comment

Choose a reason for hiding this comment

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

Thanks Tim.

/lgtm

@jetstack-bot jetstack-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 17, 2023
@jetstack-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: inteon, wallrj

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

@jetstack-bot jetstack-bot merged commit b999862 into cert-manager:master Aug 17, 2023
6 checks passed
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/api Indicates a PR directly modifies the 'pkg/apis' directory area/testing Issues relating to testing dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants