Skip to content

Commit efd3756

Browse files
committed
feat(credentials): corrected chaining of commands
1 parent dd72209 commit efd3756

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

internal/cmd/beta/alb/alb.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package alb
22

33
import (
44
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb/create"
5-
keypair "github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb/credentials"
5+
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb/credentials"
66
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb/delete"
77
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb/describe"
88
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb/list"
@@ -35,7 +35,7 @@ func addSubcommands(cmd *cobra.Command, p *print.Printer) {
3535
template.NewCmd(p),
3636
create.NewCmd(p),
3737
update.NewCmd(p),
38-
keypair.NewCmd(p),
38+
credentials.NewCmd(p),
3939
describe.NewCmd(p),
4040
delete.NewCmd(p),
4141
pool.NewCmd(p),

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
4242
Example: examples.Build(
4343
examples.NewExample(
4444
`Create a new credential, the password is requested interactively or read from ENV variable `+passwordEnv,
45-
"$ stackit key-pair create --username some.user --displayname master-creds",
45+
"$ stackit beta alb credential create --username some.user --displayname master-creds",
4646
),
4747
),
4848
RunE: func(cmd *cobra.Command, _ []string) error {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ func Test_outputResult(t *testing.T) {
195195
type args struct {
196196
outputFormat string
197197
showOnlyPublicKey bool
198-
keyPair alb.CredentialsResponse
198+
response alb.CredentialsResponse
199199
}
200200
tests := []struct {
201201
name string
@@ -207,7 +207,7 @@ func Test_outputResult(t *testing.T) {
207207
args: args{
208208
outputFormat: "",
209209
showOnlyPublicKey: false,
210-
keyPair: alb.CredentialsResponse{},
210+
response: alb.CredentialsResponse{},
211211
},
212212
wantErr: false,
213213
},
@@ -216,7 +216,7 @@ func Test_outputResult(t *testing.T) {
216216
p.Cmd = NewCmd(p)
217217
for _, tt := range tests {
218218
t.Run(tt.name, func(t *testing.T) {
219-
if err := outputResult(p, tt.args.outputFormat, tt.args.keyPair); (err != nil) != tt.wantErr {
219+
if err := outputResult(p, tt.args.outputFormat, tt.args.response); (err != nil) != tt.wantErr {
220220
t.Errorf("outputResult() error = %v, wantErr %v", err, tt.wantErr)
221221
}
222222
})

internal/cmd/beta/alb/credentials/list/list_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ func TestBuildRequest(t *testing.T) {
196196
func Test_outputResult(t *testing.T) {
197197
type args struct {
198198
outputFormat string
199-
keyPairs []alb.CredentialsResponse
199+
response []alb.CredentialsResponse
200200
}
201201
tests := []struct {
202202
name string
@@ -207,7 +207,7 @@ func Test_outputResult(t *testing.T) {
207207
name: "empty",
208208
args: args{
209209
outputFormat: "",
210-
keyPairs: []alb.CredentialsResponse{
210+
response: []alb.CredentialsResponse{
211211
{},
212212
},
213213
},
@@ -220,7 +220,7 @@ func Test_outputResult(t *testing.T) {
220220
p := print.NewPrinter()
221221
p.Cmd = NewCmd(p)
222222

223-
if err := outputResult(p, tt.args.outputFormat, tt.args.keyPairs); (err != nil) != tt.wantErr {
223+
if err := outputResult(p, tt.args.outputFormat, tt.args.response); (err != nil) != tt.wantErr {
224224
t.Errorf("outputResult() error = %v, wantErr %v", err, tt.wantErr)
225225
}
226226
})

0 commit comments

Comments
 (0)