stolostron / multicluster-global-hub

the main repository for the multicluster global hub
Apache License 2.0
21 stars 32 forks source link

:sparkles: Switch zap log for global hub operator #1235

Closed yanmxa closed 1 week ago

yanmxa commented 1 week ago

Summary

The log data

2024-11-21T01:08:46.276Z        INFO    utils/utils.go:26       Go OS/Arch: linux/amd64
2024-11-21T01:08:46.276Z        INFO    utils/utils.go:27       Go Version: go1.22.5
2024-11-21T01:08:46.276Z        INFO    utils/utils.go:28       Git Commit: 944c4e82
2024-11-21T01:08:46.297Z        INFO    cmd/main.go:110 registering webhooks to the webhook server
2024-11-21T01:08:46.297Z        INFO    controller-runtime.webhook      webhook/server.go:183   Registering webhook     {"path": "/mutating"}
2024-11-21T01:08:46.297Z        INFO    cmd/main.go:115 starting manager
2024-11-21T01:08:46.297Z        INFO    controller-runtime.metrics      server/server.go:208    Starting metrics server
2024-11-21T01:08:46.297Z        INFO    manager/server.go:83    starting server {"name": "health probe", "addr": "[::]:8081"}
2024-11-21T01:08:46.297Z        INFO    controller-runtime.metrics      server/server.go:247    Serving metrics server  {"bindAddress": ":8080", "secure": false}
2024-11-21T01:08:46.297Z        INFO    controller-runtime.webhook      webhook/server.go:191   Starting webhook server
I1121 01:08:46.297970       1 leaderelection.go:254] attempting to acquire leader lease multicluster-global-hub/multicluster-global-hub-operator-lock...
2024-11-21T01:08:46.298Z        INFO    controller-runtime.certwatcher  certwatcher/certwatcher.go:161  Updated current TLS certificate
2024-11-21T01:08:46.298Z        INFO    controller-runtime.webhook      webhook/server.go:242   Serving webhook server  {"host": "", "port": 9443}
2024-11-21T01:08:46.298Z        INFO    controller-runtime.certwatcher  certwatcher/certwatcher.go:115  Starting certificate watcher

Related issue(s)

Fixes # https://issues.redhat.com/browse/ACM-13421

Reference: https://github.com/stolostron/multicluster-global-hub/issues/1178

Tests

sonarcloud[bot] commented 1 week ago

Quality Gate Failed Quality Gate failed

Failed conditions
43.1% Coverage on New Code (required β‰₯ 70%)

See analysis details on SonarQube Cloud

yanmxa commented 1 week ago

/override ci/prow/sonarcloud

openshift-ci[bot] commented 1 week ago

@yanmxa: Overrode contexts on behalf of yanmxa: ci/prow/sonarcloud

In response to [this](https://github.com/stolostron/multicluster-global-hub/pull/1235#issuecomment-2488003920): >/override ci/prow/sonarcloud Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
openshift-ci[bot] commented 1 week ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: clyang82, yanmxa

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: - ~~[OWNERS](https://github.com/stolostron/multicluster-global-hub/blob/main/OWNERS)~~ [clyang82,yanmxa] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
ldpliu commented 1 week ago

Could we set the log level using annotation in mgh?

yanmxa commented 1 week ago

@ldpliu No, The log level is adjusted by the config map: https://github.com/stolostron/multicluster-global-hub/blob/main/doc/troubleshooting.md#change-the-mutlicluster-global-hub-log-level-at-runtime

The reason why we don't use the annotation for the CR is the operator log level can't be modified by it

yanmxa commented 1 week ago

/test images