@@ -3,7 +3,6 @@ package cmd
3
3
import (
4
4
"context"
5
5
"fmt"
6
- "os"
7
6
8
7
mocov1beta2 "github.com/cybozu-go/moco/api/v1beta2"
9
8
"github.com/cybozu-go/moco/pkg/constants"
@@ -51,16 +50,15 @@ func stopClustering(ctx context.Context, name string) error {
51
50
cluster .Annotations [constants .AnnClusteringStopped ] = "true"
52
51
53
52
if equality .Semantic .DeepEqual (orig , cluster ) {
54
- fmt .Fprintf ( os . Stdout , "The clustering is already stopped." )
53
+ fmt .Println ( "The clustering is already stopped." )
55
54
return nil
56
55
}
57
56
58
57
if err := kubeClient .Update (ctx , cluster ); err != nil {
59
58
return fmt .Errorf ("failed to stop clustering of MySQLCluster: %w" , err )
60
59
}
61
60
62
- fmt .Fprintf (os .Stdout , "stopped clustering of MySQLCluster %q\n " , fmt .Sprintf ("%s/%s" , namespace , name ))
63
-
61
+ fmt .Printf ("stopped clustering of MySQLCluster %q\n " , fmt .Sprintf ("%s/%s" , namespace , name ))
64
62
return nil
65
63
}
66
64
@@ -91,15 +89,14 @@ func stopReconciliation(ctx context.Context, name string) error {
91
89
cluster .Annotations [constants .AnnReconciliationStopped ] = "true"
92
90
93
91
if equality .Semantic .DeepEqual (orig , cluster ) {
94
- fmt .Fprintf ( os . Stdout , "The reconciliation is already stopped." )
92
+ fmt .Println ( "The reconciliation is already stopped." )
95
93
return nil
96
94
}
97
95
98
96
if err := kubeClient .Update (ctx , cluster ); err != nil {
99
97
return fmt .Errorf ("failed to stop reconciliation of MySQLCluster: %w" , err )
100
98
}
101
99
102
- fmt .Fprintf (os .Stdout , "stopped reconciliation of MySQLCluster %q\n " , fmt .Sprintf ("%s/%s" , namespace , name ))
103
-
100
+ fmt .Printf ("stopped reconciliation of MySQLCluster %q\n " , fmt .Sprintf ("%s/%s" , namespace , name ))
104
101
return nil
105
102
}
0 commit comments