diff --git a/docs/stackit_observability_grafana_describe.md b/docs/stackit_observability_grafana_describe.md index 4eea4982a..e44800614 100644 --- a/docs/stackit_observability_grafana_describe.md +++ b/docs/stackit_observability_grafana_describe.md @@ -6,7 +6,6 @@ Shows details of the Grafana configuration of an Observability instance Shows details of the Grafana configuration of an Observability instance. The Grafana dashboard URL and initial credentials (admin user and password) will be shown in the "pretty" output format. These credentials are only valid for first login. Please change the password after first login. After changing, the initial password is no longer valid. -The initial password is hidden by default, if you want to show it use the "--show-password" flag. ``` stackit observability grafana describe INSTANCE_ID [flags] @@ -18,9 +17,6 @@ stackit observability grafana describe INSTANCE_ID [flags] Get details of the Grafana configuration of an Observability instance with ID "xxx" $ stackit observability grafana describe xxx - Get details of the Grafana configuration of an Observability instance with ID "xxx" and show the initial admin password - $ stackit observability grafana describe xxx --show-password - Get details of the Grafana configuration of an Observability instance with ID "xxx" in JSON format $ stackit observability grafana describe xxx --output-format json ``` @@ -28,8 +24,7 @@ stackit observability grafana describe INSTANCE_ID [flags] ### Options ``` - -h, --help Help for "stackit observability grafana describe" - -s, --show-password Show password in output + -h, --help Help for "stackit observability grafana describe" ``` ### Options inherited from parent commands diff --git a/go.mod b/go.mod index 6bdebecd0..f3d65c374 100644 --- a/go.mod +++ b/go.mod @@ -270,7 +270,7 @@ require ( github.com/stackitcloud/stackit-sdk-go/services/logme v0.25.3 github.com/stackitcloud/stackit-sdk-go/services/mariadb v0.25.3 github.com/stackitcloud/stackit-sdk-go/services/objectstorage v1.4.5 - github.com/stackitcloud/stackit-sdk-go/services/observability v0.15.1 + github.com/stackitcloud/stackit-sdk-go/services/observability v0.16.1 github.com/stackitcloud/stackit-sdk-go/services/rabbitmq v0.25.3 github.com/stackitcloud/stackit-sdk-go/services/redis v0.25.3 github.com/stackitcloud/stackit-sdk-go/services/sfs v0.3.0 diff --git a/go.sum b/go.sum index 0b4587bc2..d7a59de03 100644 --- a/go.sum +++ b/go.sum @@ -632,8 +632,8 @@ github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v1.5.8 h1:S7t4wcT6SN github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v1.5.8/go.mod h1:CdrhFUsBO7/iJleCc2yQjDChIbG6YaxKNBQRNCjgcF4= github.com/stackitcloud/stackit-sdk-go/services/objectstorage v1.4.5 h1:4gpvB6t7d2lLjInoTxcvjL9jCpBl5EDfYe5yUtR1MvA= github.com/stackitcloud/stackit-sdk-go/services/objectstorage v1.4.5/go.mod h1:Bdcd59sRySyhfSUCy+5BNkp5w9PECmrywdvt+ORMKnI= -github.com/stackitcloud/stackit-sdk-go/services/observability v0.15.1 h1:zk+47GhutK2ajO4Yiek0laGm2PdXvY8BvFZc8yHFnSE= -github.com/stackitcloud/stackit-sdk-go/services/observability v0.15.1/go.mod h1:vapb/sJqbHlf+c7pZWdE9GqrbyI8wesGvUc9o7oJ1Xk= +github.com/stackitcloud/stackit-sdk-go/services/observability v0.16.1 h1:FKeW3uiMXRl6Oau3xE6yBriXh4t7CwPb8QH6PR0uQXM= +github.com/stackitcloud/stackit-sdk-go/services/observability v0.16.1/go.mod h1:RiknJnL3OuU9wb2lyb80Hu+EnlyDQMG8vejDV7B9a5U= github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.24.3 h1:CAgu3Wsmo8pA1/VWqnqLftMn7X26uDs5zctTci4WG7A= github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.24.3/go.mod h1:VC3vqIQIDN+8SAzhlMdrK4eXeiSaNE1JtjIGFzpgiRI= github.com/stackitcloud/stackit-sdk-go/services/postgresflex v1.3.2 h1:uQIpj0phDRGrV78/vhtULwxaO2cBdHwqZcFKYUrH1Hs= diff --git a/internal/cmd/observability/grafana/describe/describe.go b/internal/cmd/observability/grafana/describe/describe.go index 674104a9b..88b7f70b6 100644 --- a/internal/cmd/observability/grafana/describe/describe.go +++ b/internal/cmd/observability/grafana/describe/describe.go @@ -21,7 +21,8 @@ import ( ) const ( - instanceIdArg = "INSTANCE_ID" + instanceIdArg = "INSTANCE_ID" + // Deprecated: showPasswordFlag is deprecated and will be removed on 2026-07-05. showPasswordFlag = "show-password" ) @@ -35,19 +36,15 @@ func NewCmd(params *types.CmdParams) *cobra.Command { cmd := &cobra.Command{ Use: fmt.Sprintf("describe %s", instanceIdArg), Short: "Shows details of the Grafana configuration of an Observability instance", - Long: fmt.Sprintf("%s\n%s\n%s", + Long: fmt.Sprintf("%s\n%s", "Shows details of the Grafana configuration of an Observability instance.", `The Grafana dashboard URL and initial credentials (admin user and password) will be shown in the "pretty" output format. These credentials are only valid for first login. Please change the password after first login. After changing, the initial password is no longer valid.`, - `The initial password is hidden by default, if you want to show it use the "--show-password" flag.`, ), Args: args.SingleArg(instanceIdArg, utils.ValidateUUID), Example: examples.Build( examples.NewExample( `Get details of the Grafana configuration of an Observability instance with ID "xxx"`, "$ stackit observability grafana describe xxx"), - examples.NewExample( - `Get details of the Grafana configuration of an Observability instance with ID "xxx" and show the initial admin password`, - "$ stackit observability grafana describe xxx --show-password"), examples.NewExample( `Get details of the Grafana configuration of an Observability instance with ID "xxx" in JSON format`, "$ stackit observability grafana describe xxx --output-format json"), @@ -86,6 +83,7 @@ func NewCmd(params *types.CmdParams) *cobra.Command { func configureFlags(cmd *cobra.Command) { cmd.Flags().BoolP(showPasswordFlag, "s", false, "Show password in output") + cobra.CheckErr(cmd.Flags().MarkDeprecated(showPasswordFlag, "This flag is deprecated and will be removed on 2026-07-05.")) } func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inputModel, error) { @@ -122,8 +120,10 @@ func outputResult(p *print.Printer, outputFormat string, showPassword bool, graf } else if grafanaConfigs == nil { return fmt.Errorf("grafanaConfigs is nil") } + p.Warn("GrafanaAdminPassword and GrafanaAdminUser are deprecated and will be removed on 2026-07-05.") return p.OutputResult(outputFormat, grafanaConfigs, func() error { + //nolint:staticcheck // field is deprecated but still supported until 2026-07-05 initialAdminPassword := utils.PtrString(instance.Instance.GrafanaAdminPassword) if !showPassword { initialAdminPassword = "" @@ -136,6 +136,7 @@ func outputResult(p *print.Printer, outputFormat string, showPassword bool, graf table.AddSeparator() table.AddRow("SINGLE SIGN-ON", utils.PtrString(grafanaConfigs.UseStackitSso)) table.AddSeparator() + //nolint:staticcheck // field is deprecated but still supported until 2026-07-05 table.AddRow("INITIAL ADMIN USER (DEFAULT)", utils.PtrString(instance.Instance.GrafanaAdminUser)) table.AddSeparator() table.AddRow("INITIAL ADMIN PASSWORD (DEFAULT)", initialAdminPassword)