Skip to content

Commit 3e9774c

Browse files
committed
fix(syncer): close metrics server for resource syncer
Signed-off-by: liubo02 <liubo02@pingcap.com>
1 parent ccefca4 commit 3e9774c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cmd/resource-syncer/main.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"sigs.k8s.io/controller-runtime/pkg/cache"
2727
"sigs.k8s.io/controller-runtime/pkg/healthz"
2828
"sigs.k8s.io/controller-runtime/pkg/log/zap"
29+
"sigs.k8s.io/controller-runtime/pkg/metrics/server"
2930

3031
"github.com/spf13/afero"
3132
"github.com/spf13/pflag"
@@ -104,7 +105,11 @@ func run(cfg *Config) error {
104105
}
105106
mgr, err := ctrl.NewManager(kubeconfig, ctrl.Options{
106107
HealthProbeBindAddress: cfg.ProbeAddr,
107-
Cache: cacheOpt,
108+
Metrics: server.Options{
109+
// close metrics server
110+
BindAddress: "0",
111+
},
112+
Cache: cacheOpt,
108113
})
109114
if err != nil {
110115
return fmt.Errorf("unable to new manager: %w", err)

0 commit comments

Comments
 (0)