diff --git a/cmd/kubectl-moco/cmd/start.go b/cmd/kubectl-moco/cmd/start.go index ddbf9a81..f7426c87 100644 --- a/cmd/kubectl-moco/cmd/start.go +++ b/cmd/kubectl-moco/cmd/start.go @@ -3,7 +3,6 @@ package cmd import ( "context" "fmt" - "os" mocov1beta2 "github.com/cybozu-go/moco/api/v1beta2" "github.com/cybozu-go/moco/pkg/constants" @@ -50,7 +49,7 @@ func startClustering(ctx context.Context, name string) error { } if equality.Semantic.DeepEqual(orig, cluster) { - fmt.Fprintf(os.Stdout, "The clustering is already running.") + fmt.Println("The clustering is already running.") return nil } @@ -58,8 +57,7 @@ func startClustering(ctx context.Context, name string) error { return fmt.Errorf("failed to start clustering of MySQLCluster: %w", err) } - fmt.Fprintf(os.Stdout, "started clustering of MySQLCluster %q\n", fmt.Sprintf("%s/%s", namespace, name)) - + fmt.Printf("started clustering of MySQLCluster %q\n", fmt.Sprintf("%s/%s", namespace, name)) return nil } @@ -89,7 +87,7 @@ func startReconciliation(ctx context.Context, name string) error { } if equality.Semantic.DeepEqual(orig, cluster) { - fmt.Fprintf(os.Stdout, "The reconciliation is already running.") + fmt.Println("The reconciliation is already running.") return nil } @@ -97,7 +95,6 @@ func startReconciliation(ctx context.Context, name string) error { return fmt.Errorf("failed to start reconciliation of MySQLCluster: %w", err) } - fmt.Fprintf(os.Stdout, "started reconciliation of MySQLCluster %q\n", fmt.Sprintf("%s/%s", namespace, name)) - + fmt.Printf("started reconciliation of MySQLCluster %q\n", fmt.Sprintf("%s/%s", namespace, name)) return nil } diff --git a/cmd/kubectl-moco/cmd/stop.go b/cmd/kubectl-moco/cmd/stop.go index a1d2796c..0e45edb2 100644 --- a/cmd/kubectl-moco/cmd/stop.go +++ b/cmd/kubectl-moco/cmd/stop.go @@ -3,7 +3,6 @@ package cmd import ( "context" "fmt" - "os" mocov1beta2 "github.com/cybozu-go/moco/api/v1beta2" "github.com/cybozu-go/moco/pkg/constants" @@ -51,7 +50,7 @@ func stopClustering(ctx context.Context, name string) error { cluster.Annotations[constants.AnnClusteringStopped] = "true" if equality.Semantic.DeepEqual(orig, cluster) { - fmt.Fprintf(os.Stdout, "The clustering is already stopped.") + fmt.Println("The clustering is already stopped.") return nil } @@ -59,8 +58,7 @@ func stopClustering(ctx context.Context, name string) error { return fmt.Errorf("failed to stop clustering of MySQLCluster: %w", err) } - fmt.Fprintf(os.Stdout, "stopped clustering of MySQLCluster %q\n", fmt.Sprintf("%s/%s", namespace, name)) - + fmt.Printf("stopped clustering of MySQLCluster %q\n", fmt.Sprintf("%s/%s", namespace, name)) return nil } @@ -91,7 +89,7 @@ func stopReconciliation(ctx context.Context, name string) error { cluster.Annotations[constants.AnnReconciliationStopped] = "true" if equality.Semantic.DeepEqual(orig, cluster) { - fmt.Fprintf(os.Stdout, "The reconciliation is already stopped.") + fmt.Println("The reconciliation is already stopped.") return nil } @@ -99,7 +97,6 @@ func stopReconciliation(ctx context.Context, name string) error { return fmt.Errorf("failed to stop reconciliation of MySQLCluster: %w", err) } - fmt.Fprintf(os.Stdout, "stopped reconciliation of MySQLCluster %q\n", fmt.Sprintf("%s/%s", namespace, name)) - + fmt.Printf("stopped reconciliation of MySQLCluster %q\n", fmt.Sprintf("%s/%s", namespace, name)) return nil }