diff --git a/internal/cmd/ske/credential/rotate/rotate.go b/internal/cmd/ske/credential/rotate/rotate.go index 580273b9..0495c385 100644 --- a/internal/cmd/ske/credential/rotate/rotate.go +++ b/internal/cmd/ske/credential/rotate/rotate.go @@ -4,6 +4,7 @@ import ( "context" "fmt" + "github.com/stackitcloud/stackit-cli/internal/pkg/confirm" "github.com/stackitcloud/stackit-cli/internal/pkg/globalflags" "github.com/stackitcloud/stackit-cli/internal/pkg/services/ske/client" "github.com/stackitcloud/stackit-cli/internal/pkg/utils" @@ -34,6 +35,14 @@ func NewCmd() *cobra.Command { return err } + if !model.AssumeYes { + prompt := fmt.Sprintf("Are you sure you want to rotate credentials for project %s? (The old credentials will be invalid after this operation)", model.ProjectId) + err = confirm.PromptForConfirmation(cmd, prompt) + if err != nil { + return err + } + } + // Configure API client apiClient, err := client.ConfigureClient(cmd) if err != nil {