Skip to content

Commit 5d990e4

Browse files
committed
feat(credentials)
1 parent 6c43584 commit 5d990e4

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

internal/cmd/beta/alb/credentials/create/create.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ type inputModel struct {
3737
func NewCmd(p *print.Printer) *cobra.Command {
3838
cmd := &cobra.Command{
3939
Use: "create",
40-
Short: "Creates a credential",
41-
Long: "Creates a credential.",
40+
Short: "Creates credentials",
41+
Long: "Creates credentials.",
4242
Args: cobra.NoArgs,
4343
Example: examples.Build(
4444
examples.NewExample(
@@ -65,7 +65,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
6565
}
6666

6767
if !model.AssumeYes {
68-
prompt := "Are your sure you want to create a credential?"
68+
prompt := "Are your sure you want to create credentials?"
6969
err = p.PromptForConfirmation(prompt)
7070
if err != nil {
7171
return err
@@ -76,7 +76,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
7676
req := buildRequest(ctx, model, apiClient)
7777
resp, err := req.Execute()
7878
if err != nil {
79-
return fmt.Errorf("create credential: %w", err)
79+
return fmt.Errorf("create credentials: %w", err)
8080
}
8181

8282
return outputResult(p, model.GlobalFlagModel.OutputFormat, resp)

internal/cmd/beta/alb/credentials/delete/delete.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
)
1616

1717
const (
18-
credentialRefArg = "CREDENTIAL_REF" // nolint:gosec // false alert, this are not valid credentials
18+
credentialRefArg = "CREDENTIAL_REF" // nolint:gosec // false alert, these are not valid credentials
1919
)
2020

2121
type inputModel struct {
@@ -26,13 +26,13 @@ type inputModel struct {
2626
func NewCmd(p *print.Printer) *cobra.Command {
2727
cmd := &cobra.Command{
2828
Use: fmt.Sprintf("delete %s", credentialRefArg),
29-
Short: "Deletes a credential",
30-
Long: "Deletes a credential.",
29+
Short: "Deletes credentials",
30+
Long: "Deletes credentials.",
3131
Args: args.SingleArg(credentialRefArg, nil),
3232
Example: examples.Build(
3333
examples.NewExample(
34-
`Delete credential with name "CREDENTIAL_REF"`,
35-
"$ stackit beta alb credentials delete CREDENTIAL_REF",
34+
`Delete credential with name "credential-12345"`,
35+
"$ stackit beta alb credentials delete credential-12345",
3636
),
3737
),
3838
RunE: func(cmd *cobra.Command, args []string) error {
@@ -49,7 +49,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
4949
}
5050

5151
if !model.AssumeYes {
52-
prompt := fmt.Sprintf("Are you sure you want to delete credential %q?", model.CredentialsRef)
52+
prompt := fmt.Sprintf("Are you sure you want to delete credentials %q?", model.CredentialsRef)
5353
err = p.PromptForConfirmation(prompt)
5454
if err != nil {
5555
return err

internal/cmd/beta/alb/credentials/describe/describe.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
)
2121

2222
const (
23-
credentialRefArg = "CREDENTIAL_REF" // nolint:gosec // false alert, this are not valid credentials
23+
credentialRefArg = "CREDENTIAL_REF" // nolint:gosec // false alert, these are not valid credentials
2424
)
2525

2626
type inputModel struct {
@@ -31,12 +31,12 @@ type inputModel struct {
3131
func NewCmd(p *print.Printer) *cobra.Command {
3232
cmd := &cobra.Command{
3333
Use: fmt.Sprintf("describe %s", credentialRefArg),
34-
Short: "Describes a credential",
35-
Long: "Describes a credential.",
34+
Short: "Describes credentials",
35+
Long: "Describes credentials.",
3636
Args: args.SingleArg(credentialRefArg, nil),
3737
Example: examples.Build(
3838
examples.NewExample(
39-
`Get details about a credential with name "credential-12345"`,
39+
`Get details about credentials with name "credential-12345"`,
4040
"$ stackit beta alb credential describe credential-12345",
4141
),
4242
),
@@ -57,7 +57,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
5757
req := buildRequest(ctx, model, apiClient)
5858
resp, err := req.Execute()
5959
if err != nil {
60-
return fmt.Errorf("read credential: %w", err)
60+
return fmt.Errorf("read credentials: %w", err)
6161
}
6262

6363
if credential := resp; credential != nil && credential.Credential != nil {
@@ -101,7 +101,7 @@ func outputResult(p *print.Printer, outputFormat string, response alb.Credential
101101
details, err := json.MarshalIndent(response, "", " ")
102102

103103
if err != nil {
104-
return fmt.Errorf("marshal credential: %w", err)
104+
return fmt.Errorf("marshal credentials: %w", err)
105105
}
106106
p.Outputln(string(details))
107107

@@ -110,7 +110,7 @@ func outputResult(p *print.Printer, outputFormat string, response alb.Credential
110110
details, err := yaml.MarshalWithOptions(response, yaml.IndentSequence(true), yaml.UseJSONMarshaler())
111111

112112
if err != nil {
113-
return fmt.Errorf("marshal credential: %w", err)
113+
return fmt.Errorf("marshal credentials: %w", err)
114114
}
115115
p.Outputln(string(details))
116116

internal/cmd/beta/alb/credentials/update/update.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ import (
2121
"github.com/stackitcloud/stackit-sdk-go/services/alb"
2222
)
2323

24-
const passwordEnv = "ALB_CREDENTIALS_PASSWORD" //nolint:gosec // false alert, this are not valid credentials
24+
const passwordEnv = "ALB_CREDENTIALS_PASSWORD" //nolint:gosec // false alert, these are not valid credentials
2525

2626
const (
2727
usernameFlag = "username"
2828
displaynameFlag = "displayname"
2929
passwordFlag = "password"
30-
credentialRefArg = "CREDENTIAL_REF_ARG" //nolint:gosec // false alert, this are not valid credentials
30+
credentialRefArg = "CREDENTIAL_REF_ARG" //nolint:gosec // false alert, these are not valid credentials
3131
)
3232

3333
type inputModel struct {
@@ -41,8 +41,8 @@ type inputModel struct {
4141
func NewCmd(p *print.Printer) *cobra.Command {
4242
cmd := &cobra.Command{
4343
Use: fmt.Sprintf("update %s", credentialRefArg),
44-
Short: "Update a credential",
45-
Long: "Update a credential.",
44+
Short: "Update credentials",
45+
Long: "Update credentials.",
4646
Args: args.SingleArg(credentialRefArg, nil),
4747
Example: examples.Build(
4848
examples.NewExample(

0 commit comments

Comments
 (0)