File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
cmd/clustersynchro-manager/app Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,13 @@ func NewClusterSynchroManagerCommand(ctx context.Context) *cobra.Command {
62
62
return err
63
63
}
64
64
65
+ defer func () {
66
+ err := config .StorageFactory .Shutdown ()
67
+ if err != nil {
68
+ klog .ErrorS (err , "Failed to shutdown storage factory" )
69
+ }
70
+ }()
71
+
65
72
if err := Run (ctx , config ); err != nil {
66
73
return err
67
74
}
@@ -91,14 +98,6 @@ func Run(ctx context.Context, c *config.Config) error {
91
98
metricsserver .Run (c .MetricsServerConfig )
92
99
}()
93
100
94
- go func () {
95
- <- ctx .Done ()
96
- err := c .StorageFactory .Shutdown ()
97
- if err != nil {
98
- klog .ErrorS (err , "Failed to shutdown storage factory" )
99
- }
100
- }()
101
-
102
101
if c .KubeMetricsServerConfig != nil {
103
102
go func () {
104
103
kubestatemetrics .RunServer (* c .KubeMetricsServerConfig , synchromanager )
You can’t perform that action at this time.
0 commit comments