Skip to content

Move remaining controller code to structured logging#933

Merged
google-prow-robot merged 3 commits intoknative:masterfrom
mdemirhan:logging
May 23, 2018
Merged

Move remaining controller code to structured logging#933
google-prow-robot merged 3 commits intoknative:masterfrom
mdemirhan:logging

Conversation

@mdemirhan
Copy link
Copy Markdown
Contributor

Change remaining controller code to use zap structured logging library instead of glog and log.

@google-prow-robot google-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 22, 2018
@mdemirhan
Copy link
Copy Markdown
Contributor Author

/assign @mattmoor

@mattmoor There was no owners file in cmd/ela-controller. I just added the OWNERS file to that location matching the one in pkg/controller. Your approval is needed one more time :)

configuration.NewController(kubeClient, elaClient, buildClient, kubeInformerFactory, elaInformerFactory, cfg, *controllerConfig),
revision.NewController(kubeClient, elaClient, kubeInformerFactory, elaInformerFactory, buildInformerFactory, cfg, &revControllerConfig),
configuration.NewController(kubeClient, elaClient, buildClient, kubeInformerFactory, elaInformerFactory, cfg, *controllerConfig, logger),
revision.NewController(kubeClient, elaClient, kubeInformerFactory, elaInformerFactory, buildInformerFactory, cfg, &revControllerConfig, logger),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does it make sense to wrap logger into revControllerConfig? Same for Configuration and Route. No ConfigurationControllerConfig nor RouteControllerConfig exist yet.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Looking at revControllerConfig, it seems like it is specifically targeted at user configuration from the config maps. Logger doesn't seem like a natural fit there. Also, adding it to the config might cause confusion within revision controller for example, because the logger is also contained in controller.Base. Let me know if this makes sense.

@yanweiguo
Copy link
Copy Markdown
Contributor

/lgtm

@google-prow-robot google-prow-robot added the lgtm Indicates that a PR is ready to be merged. label May 22, 2018
Copy link
Copy Markdown
Contributor

@grantr grantr left a comment

Choose a reason for hiding this comment

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

Thanks @mdemirhan! Let's see if I can approve with just an approving review...

if err != nil {
log.Printf("Failed to get metadata: %s", err)
panic("Failed to get metadata")
logger.Panic("Failed to get metadata", zap.Error(err))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just noting that we shouldn't be panicking here, but it's fine for this PR to carry over. I think #932 covers this.

@grantr
Copy link
Copy Markdown
Contributor

grantr commented May 22, 2018

Oh I can't actually approve this because I'm not an owner (yet).

Copy link
Copy Markdown
Member

@mattmoor mattmoor left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@google-prow-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mattmoor, mdemirhan

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

The pull request process is described 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

@google-prow-robot google-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 23, 2018
@mattmoor
Copy link
Copy Markdown
Member

/retest

@google-prow-robot google-prow-robot merged commit d8b0f4d into knative:master May 23, 2018
@mdemirhan mdemirhan deleted the logging branch May 23, 2018 05:48
mgencur referenced this pull request in openshift-knative/serving Oct 12, 2022
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. lgtm Indicates that a PR is ready to be merged. 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.

6 participants