You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps did you take and what happened:
[A clear and concise description of what the bug is.]
this is the gatekeeper pod info, as shown belown, the pod has restart 6 times
cls-dyp4pnhh-gatekeeper-75995db9bc-q2gkq 2/2 Running 6 57d
when I head for the gatekeepr log, they are:
C:\Users\Administrator>k logs -ncls-dyp4pnhh cls-dyp4pnhh-gatekeeper-75995db9bc-q2gkq -cgatekeeper-controller -p
2024/03/28 16:57:04 maxprocs: Updating GOMAXPROCS=1: using minimum allowed GOMAXPROCS
[controller-runtime] log.SetLogger(...) was never called, logs will not be displayed:
goroutine 1 [running, locked to thread]:
runtime/debug.Stack()
/usr/local/go/src/runtime/debug/stack.go:24 +0x5e
sigs.k8s.io/controller-runtime/pkg/log.eventuallyFulfillRoot()
/go/src/github.com/open-policy-agent/gatekeeper/vendor/sigs.k8s.io/controller-runtime/pkg/log/log.go:59 +0xcd
sigs.k8s.io/controller-runtime/pkg/log.(*delegatingLogSink).WithName(0xc0001dbe80, {0x24f8def, 0x13})
/go/src/github.com/open-policy-agent/gatekeeper/vendor/sigs.k8s.io/controller-runtime/pkg/log/deleg.go:147 +0x45
github.com/go-logr/logr.Logger.WithName({{0x2ad47f0, 0xc0001dbe80}, 0x0}, {0x24f8def?, 0x3fb3760?})
/go/src/github.com/open-policy-agent/gatekeeper/vendor/github.com/go-logr/logr/logr.go:336 +0x3d
github.com/open-policy-agent/gatekeeper/v3/pkg/metrics/exporters/opencensus.init()
/go/src/github.com/open-policy-agent/gatekeeper/pkg/metrics/exporters/opencensus/opencensus.go:16 +0x34
I0328 16:59:17.894234 1 regorewriter.go:212] checking {template}
as we can see, the log contains error: " log.SetLogger(...) was never called, logs will not be displayed"
the pod args setting:
args:
--port=8443
--v=5
--logtostderr
--operation=webhook
--disable-cert-rotation=true
--enable-external-data=true
--disable-opa-builtin={http.send}
--tls-min-version=1.0
--external-data-provider-response-cache-ttl=0
What did you expect to happen:
I wish when pod restart, the logs show clear reason, especially the "log.SetLogger(...) was" won't happen again.
Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]
I read the source code, In Main function, ctrl.SetLogger has set the logger. so I don't know why this error happens.
logger := crzap.New(opts...)
ctrl.SetLogger(logger)
klog.SetLogger(logger)
Environment:
Linux
Gatekeeper version: 3.14
Kubernetes version: (use kubectl version): 1.18
The text was updated successfully, but these errors were encountered:
What steps did you take and what happened:
[A clear and concise description of what the bug is.]
this is the gatekeeper pod info, as shown belown, the pod has restart 6 times
cls-dyp4pnhh-gatekeeper-75995db9bc-q2gkq 2/2 Running 6 57d
when I head for the gatekeepr log, they are:
C:\Users\Administrator>k logs -ncls-dyp4pnhh cls-dyp4pnhh-gatekeeper-75995db9bc-q2gkq -cgatekeeper-controller -p
2024/03/28 16:57:04 maxprocs: Updating GOMAXPROCS=1: using minimum allowed GOMAXPROCS
[controller-runtime] log.SetLogger(...) was never called, logs will not be displayed:
goroutine 1 [running, locked to thread]:
runtime/debug.Stack()
/usr/local/go/src/runtime/debug/stack.go:24 +0x5e
sigs.k8s.io/controller-runtime/pkg/log.eventuallyFulfillRoot()
/go/src/github.com/open-policy-agent/gatekeeper/vendor/sigs.k8s.io/controller-runtime/pkg/log/log.go:59 +0xcd
sigs.k8s.io/controller-runtime/pkg/log.(*delegatingLogSink).WithName(0xc0001dbe80, {0x24f8def, 0x13})
/go/src/github.com/open-policy-agent/gatekeeper/vendor/sigs.k8s.io/controller-runtime/pkg/log/deleg.go:147 +0x45
github.com/go-logr/logr.Logger.WithName({{0x2ad47f0, 0xc0001dbe80}, 0x0}, {0x24f8def?, 0x3fb3760?})
/go/src/github.com/open-policy-agent/gatekeeper/vendor/github.com/go-logr/logr/logr.go:336 +0x3d
github.com/open-policy-agent/gatekeeper/v3/pkg/metrics/exporters/opencensus.init()
/go/src/github.com/open-policy-agent/gatekeeper/pkg/metrics/exporters/opencensus/opencensus.go:16 +0x34
I0328 16:59:17.894234 1 regorewriter.go:212] checking {template}
as we can see, the log contains error: " log.SetLogger(...) was never called, logs will not be displayed"
the pod args setting:
What did you expect to happen:
I wish when pod restart, the logs show clear reason, especially the "log.SetLogger(...) was" won't happen again.
Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]
I read the source code, In Main function, ctrl.SetLogger has set the logger. so I don't know why this error happens.
logger := crzap.New(opts...)
ctrl.SetLogger(logger)
klog.SetLogger(logger)
Environment:
Linux
kubectl version
): 1.18The text was updated successfully, but these errors were encountered: