Skip to content

Commit

Permalink
Display a message when stopping and resuming
Browse files Browse the repository at this point in the history
Signed-off-by: d-kuro <[email protected]>
  • Loading branch information
d-kuro committed Nov 22, 2023
1 parent 72492c5 commit 8bf3f8a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/kubectl-moco/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cmd
import (
"context"
"fmt"
"os"

mocov1beta2 "github.com/cybozu-go/moco/api/v1beta2"
"github.com/cybozu-go/moco/pkg/constants"
Expand Down Expand Up @@ -56,6 +57,8 @@ 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)

return nil
}

Expand Down Expand Up @@ -92,5 +95,7 @@ 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))

return nil
}
5 changes: 5 additions & 0 deletions cmd/kubectl-moco/cmd/stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cmd
import (
"context"
"fmt"
"os"

mocov1beta2 "github.com/cybozu-go/moco/api/v1beta2"
"github.com/cybozu-go/moco/pkg/constants"
Expand Down Expand Up @@ -57,6 +58,8 @@ 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))

return nil
}

Expand Down Expand Up @@ -94,5 +97,7 @@ 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))

return nil
}

0 comments on commit 8bf3f8a

Please sign in to comment.