Skip to content

Commit 05b971b

Browse files
Alexandre CatalanAlexandre Catalan
authored andcommitted
Merge branch 'main' into feat/STACKITCRE-382-registry
2 parents df0cfe0 + 03f7993 commit 05b971b

1,503 files changed

Lines changed: 10415 additions & 137 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎docs/stackit_mongodbflex_instance_update.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ stackit mongodbflex instance update INSTANCE_ID [flags]
2929
-h, --help[=true|false] Help for "stackit mongodbflex instance update"
3030
-n, --name string Instance name
3131
--storage-class string Storage class
32-
--storage-size int Storage size (in GB)
32+
--storage-size int32 Storage size (in GB)
3333
--type string Instance type, (one of: [Replica, Sharded, Single])
3434
--version string Version
3535
```

‎go.mod‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ require (
2727
github.com/stackitcloud/stackit-sdk-go/services/iaas v1.15.1
2828
github.com/stackitcloud/stackit-sdk-go/services/intake v0.12.0
2929
github.com/stackitcloud/stackit-sdk-go/services/logs v0.12.0
30-
github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v1.13.0
30+
github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v1.14.0
3131
github.com/stackitcloud/stackit-sdk-go/services/opensearch v1.5.0
3232
github.com/stackitcloud/stackit-sdk-go/services/postgresflex v1.16.0
3333
github.com/stackitcloud/stackit-sdk-go/services/registry v0.3.0
@@ -39,15 +39,15 @@ require (
3939
github.com/stackitcloud/stackit-sdk-go/services/serverupdate v1.6.0
4040
github.com/stackitcloud/stackit-sdk-go/services/serviceaccount v0.22.0
4141
github.com/stackitcloud/stackit-sdk-go/services/serviceenablement v1.8.0
42-
github.com/stackitcloud/stackit-sdk-go/services/ske v1.22.0
42+
github.com/stackitcloud/stackit-sdk-go/services/ske v1.23.0
4343
github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v1.20.0
4444
github.com/stackitcloud/stackit-sdk-go/services/valkey v0.4.0
45-
github.com/stackitcloud/stackit-sdk-go/services/vpn v0.15.3
45+
github.com/stackitcloud/stackit-sdk-go/services/vpn v0.16.0
4646
github.com/zalando/go-keyring v0.2.8
4747
golang.org/x/mod v0.43.0
4848
golang.org/x/oauth2 v0.38.0
49-
golang.org/x/term v0.47.0
50-
golang.org/x/text v0.43.0
49+
golang.org/x/term v0.48.0
50+
golang.org/x/text v0.44.0
5151
k8s.io/apimachinery v0.37.2
5252
k8s.io/client-go v0.37.2
5353
)
@@ -238,7 +238,7 @@ require (
238238
go.yaml.in/yaml/v2 v2.4.4 // indirect
239239
go.yaml.in/yaml/v3 v3.0.4 // indirect
240240
golang.org/x/exp/typeparams v0.0.0-20260209203927-2842357ff358 // indirect
241-
golang.org/x/sync v0.24.0 // indirect
241+
golang.org/x/sync v0.25.0 // indirect
242242
golang.org/x/telemetry v0.0.0-20261009151841-97e8ea77aa2a // indirect
243243
golang.org/x/tools v0.52.0 // indirect
244244
google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af // indirect
@@ -279,7 +279,7 @@ require (
279279
github.com/stackitcloud/stackit-sdk-go/services/redis v1.6.0
280280
github.com/stackitcloud/stackit-sdk-go/services/sfs v0.13.1
281281
github.com/subosito/gotenv v1.6.0 // indirect
282-
golang.org/x/sys v0.49.0 // indirect
282+
golang.org/x/sys v0.50.0 // indirect
283283
gopkg.in/yaml.v3 v3.0.1 // indirect
284284
k8s.io/api v0.37.2 // indirect
285285
k8s.io/klog/v2 v2.140.0 // indirect

‎go.sum‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -640,8 +640,8 @@ github.com/stackitcloud/stackit-sdk-go/services/logs v0.12.0 h1:4ZUQuj5Zp9E4Ebym
640640
github.com/stackitcloud/stackit-sdk-go/services/logs v0.12.0/go.mod h1:YKBTmDJmeVeaWKnmJoyLTsZCy/FkdWcD/GXm3rAvG3c=
641641
github.com/stackitcloud/stackit-sdk-go/services/mariadb v1.4.0 h1:LFpdvASJnTv5Y/PEfwgK0pn7ixXLgcUmLt2cRTg979g=
642642
github.com/stackitcloud/stackit-sdk-go/services/mariadb v1.4.0/go.mod h1:GpFHOEVEq+Pog9dWPMvGeF4mEvB+MVLIRh3/jB1isUI=
643-
github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v1.13.0 h1:+7cw7kFNw2dZ3opWDusuW+GC+3lwf8mjpHtIvi2+wqs=
644-
github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v1.13.0/go.mod h1:yNxGU6mwDzXX82/QfgxRzg2M3+ktVNKS1qPzT01QIi0=
643+
github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v1.14.0 h1:GdCzKryyTnQM+al6ntIp8gBkJfy7htUGAbAb5xxTIvc=
644+
github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v1.14.0/go.mod h1:yNxGU6mwDzXX82/QfgxRzg2M3+ktVNKS1qPzT01QIi0=
645645
github.com/stackitcloud/stackit-sdk-go/services/objectstorage v1.13.0 h1:lVFUq1AVW2wgiKjtcr8FeEY+Jxw3hBXyh7I+qWW6ad4=
646646
github.com/stackitcloud/stackit-sdk-go/services/objectstorage v1.13.0/go.mod h1:HAQToFb4LrI6jdOdOowApI3KLF3D0KzE9ne0Lty4wkw=
647647
github.com/stackitcloud/stackit-sdk-go/services/observability v0.26.0 h1:Dh7vvXKGDvUVX1jC2Y7BKnIitKV/se7N/cdDiPrOV9k=
@@ -674,14 +674,14 @@ github.com/stackitcloud/stackit-sdk-go/services/serviceenablement v1.8.0 h1:PsLX
674674
github.com/stackitcloud/stackit-sdk-go/services/serviceenablement v1.8.0/go.mod h1:izKsr/tJKDNPsgZ/LFQ2civLOICA75BKU06NNWgADIw=
675675
github.com/stackitcloud/stackit-sdk-go/services/sfs v0.13.1 h1:jlxd9ee8GX4wzQywyKiu9Jid6Mjqiru/QNm4OhUS70U=
676676
github.com/stackitcloud/stackit-sdk-go/services/sfs v0.13.1/go.mod h1:QDhu6jIIgqgO7l/wAGlfUDHC4Q20vfyUifh3a0qT3W4=
677-
github.com/stackitcloud/stackit-sdk-go/services/ske v1.22.0 h1:DNTwOlCLphNSr454IeqGo/eSIgxlajNzmx30gjyAdyk=
678-
github.com/stackitcloud/stackit-sdk-go/services/ske v1.22.0/go.mod h1:MfP4FhM/g/2C1PREHFyB8oLPzZ9Lrewq9R7z70361F8=
677+
github.com/stackitcloud/stackit-sdk-go/services/ske v1.23.0 h1:Jqwtn80Wy3ee+jJGoRiALkKuob/LidC7n3TBL2Ge6gQ=
678+
github.com/stackitcloud/stackit-sdk-go/services/ske v1.23.0/go.mod h1:MfP4FhM/g/2C1PREHFyB8oLPzZ9Lrewq9R7z70361F8=
679679
github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v1.20.0 h1:dHsxhHt2iVz+hhk5IW1AfW3ic5JVdC5C9FKqFMAMZy8=
680680
github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v1.20.0/go.mod h1:chULz8M6OKvzWEMVH/3DWKDb1UQab87O1KLJfWV0Vp4=
681681
github.com/stackitcloud/stackit-sdk-go/services/valkey v0.4.0 h1:75iJs+mZPnrGSlSoTZtKYYCyNqtqgx6JVChwJokcKVg=
682682
github.com/stackitcloud/stackit-sdk-go/services/valkey v0.4.0/go.mod h1:0crDO5v97ulHjVZVoFR2gJ4FCpEQeXGdM+V+AlZ6M6E=
683-
github.com/stackitcloud/stackit-sdk-go/services/vpn v0.15.3 h1:rtY3Pdup5W3ZNQFiNo6STnoKKxpfM4YWjMbaps3OZb4=
684-
github.com/stackitcloud/stackit-sdk-go/services/vpn v0.15.3/go.mod h1:CQ2Mv18PiEDsJ9ENp7BB7hS5nnS6bZmfWoneCzH+IjQ=
683+
github.com/stackitcloud/stackit-sdk-go/services/vpn v0.16.0 h1:G6ec8vtjGJUWr5SK1dvZGCRdFxa08mTMGDK6vSx1SgQ=
684+
github.com/stackitcloud/stackit-sdk-go/services/vpn v0.16.0/go.mod h1:CQ2Mv18PiEDsJ9ENp7BB7hS5nnS6bZmfWoneCzH+IjQ=
685685
github.com/stbenjam/no-sprintf-host-port v0.3.1 h1:AyX7+dxI4IdLBPtDbsGAyqiTSLpCP9hWRrXQDU4Cm/g=
686686
github.com/stbenjam/no-sprintf-host-port v0.3.1/go.mod h1:ODbZesTCHMVKthBHskvUUexdcNHAQRXk9NpSsL8p/HQ=
687687
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
@@ -882,8 +882,8 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ
882882
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
883883
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
884884
golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
885-
golang.org/x/sync v0.24.0 h1:iqiDrGoDgyuvAKrhLQthUEzU/R378N78gXbBjxed7oA=
886-
golang.org/x/sync v0.24.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0=
885+
golang.org/x/sync v0.25.0 h1:dJnifr0nMV8/SBnBvdo4eSGGnrc3O4FFx6IqvtLcmRs=
886+
golang.org/x/sync v0.25.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0=
887887
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
888888
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
889889
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -933,8 +933,8 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
933933
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
934934
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
935935
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
936-
golang.org/x/sys v0.49.0 h1:XbzkgYJHdqh/8m2Uu0W/dQv8nktxx4BFHp1M0gROTXA=
937-
golang.org/x/sys v0.49.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og=
936+
golang.org/x/sys v0.50.0 h1:dkKZEFTEKaLr1sjhs0WiKqoi8Jj5nHbS3Njmx1UoMJs=
937+
golang.org/x/sys v0.50.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og=
938938
golang.org/x/telemetry v0.0.0-20261009151841-97e8ea77aa2a h1:wnveMBKHwx8/nIb8WYT5P9vtefdXOvIWxzycCkc5n6Q=
939939
golang.org/x/telemetry v0.0.0-20261009151841-97e8ea77aa2a/go.mod h1:i+ivNqjDnTF3WTElsdk5g9V5DTSBYgdNo7xTU9SDwYA=
940940
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
@@ -943,8 +943,8 @@ golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
943943
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
944944
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
945945
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
946-
golang.org/x/term v0.47.0 h1:cpyOwQkr2Nzxe2p6KnrTG7Ei2wtzjsuSjhpXXepZ/BM=
947-
golang.org/x/term v0.47.0/go.mod h1:efAfAuG6RKABvg1ArGebRkvX6LXul14SM67o2e4mUCY=
946+
golang.org/x/term v0.48.0 h1:G6UU1eiSB8nl3DzeUGt7Mg+2SctI8tPS6Z5/mBt6cOk=
947+
golang.org/x/term v0.48.0/go.mod h1:BRDLHCZr2SUjIeBHHpRyQeC9xzSAVbzY2rvKgafnHf4=
948948
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
949949
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
950950
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -955,8 +955,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
955955
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
956956
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
957957
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
958-
golang.org/x/text v0.43.0 h1:1QivrlhwAsnMOcqgOdl9my7s9OyZl8O5/UGUTJVXoWc=
959-
golang.org/x/text v0.43.0/go.mod h1:hbSIYA/amXcRXTFSZqh8tWHEoqRvvbKPJ2uz/KU+a+s=
958+
golang.org/x/text v0.44.0 h1:YItdp/mQNGnsmrgpcdA5yQ3bnRxCfo/Tj/iByGW9GGo=
959+
golang.org/x/text v0.44.0/go.mod h1:S4FR1waQ9LbjQTls97SyRjDaUUVkaM+cXwwuG/G+MwY=
960960
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
961961
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
962962
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=

‎golang-ci.yaml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ linters:
1515
- revive
1616
- sqlclosecheck
1717
- wastedassign
18+
- wsl_v5
1819
disable:
1920
- noctx # false positive: finds errors with http.NewRequest that dont make sense
2021
- unparam # false positives
@@ -39,7 +40,7 @@ linters:
3940
- experimental
4041
gosec:
4142
excludes:
42-
# Suppressions: (see https://github.com/securego/gosec#available-rules for details)
43+
# Suppressions: (see https://github.com/securego/gosec#available-rules for details)
4344
- G104 # "Audit errors not checked" -> which we don't need and is a badly implemented version of errcheck
4445
- G102 # "Bind to all interfaces" -> since this is normal in k8s
4546
- G304 # "File path provided as taint input" -> too many false positives
@@ -66,6 +67,9 @@ linters:
6667
- name: atomic
6768
- name: empty-lines
6869
- name: early-return
70+
wsl_v5:
71+
allow-whole-block: true
72+
branch-max-lines: 4
6973
exclusions:
7074
generated: lax
7175
paths:

‎internal/cmd/affinity-groups/affinity-groups.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
2121
Run: utils.CmdHelp,
2222
}
2323
addSubcommands(cmd, params)
24+
2425
return cmd
2526
}
2627

‎internal/cmd/affinity-groups/create/create.go‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
4444
),
4545
RunE: func(cmd *cobra.Command, args []string) error {
4646
ctx := context.Background()
47+
4748
model, err := parseInput(params.Printer, cmd, args)
4849
if err != nil {
4950
return err
@@ -56,6 +57,7 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
5657
}
5758

5859
prompt := fmt.Sprintf("Are you sure you want to create the affinity group %q?", model.Name)
60+
5961
err = params.Printer.PromptForConfirmation(prompt)
6062
if err != nil {
6163
return err
@@ -68,13 +70,16 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
6870
if err != nil {
6971
return fmt.Errorf("create affinity group: %w", err)
7072
}
73+
7174
if resp := result; resp != nil {
7275
return outputResult(params.Printer, *model, *resp)
7376
}
77+
7478
return fmt.Errorf("create affinity group: nil result")
7579
},
7680
}
7781
configureFlags(cmd)
82+
7883
return cmd
7984
}
8085

@@ -95,6 +100,7 @@ func buildRequest(ctx context.Context, model inputModel, apiClient *iaas.APIClie
95100
Policy: model.Policy,
96101
},
97102
)
103+
98104
return req
99105
}
100106

@@ -111,6 +117,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command, _ []string) (*inputModel,
111117
}
112118

113119
p.DebugInputModel(model)
120+
114121
return &model, nil
115122
}
116123

‎internal/cmd/affinity-groups/create/create_test.go‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ func fixtureFlagValues(mods ...func(flagValues map[string]string)) map[string]st
4141
for _, mod := range mods {
4242
mod(flagValues)
4343
}
44+
4445
return flagValues
4546
}
4647

@@ -57,15 +58,18 @@ func fixtureInputModel(mods ...func(model *inputModel)) *inputModel {
5758
for _, mod := range mods {
5859
mod(model)
5960
}
61+
6062
return model
6163
}
6264

6365
func fixtureRequest(mods ...func(request *iaas.ApiCreateAffinityGroupRequest)) iaas.ApiCreateAffinityGroupRequest {
6466
request := testClient.DefaultAPI.CreateAffinityGroup(testCtx, testProjectId, testRegion)
67+
6568
request = request.CreateAffinityGroupPayload(fixturePayload())
6669
for _, mod := range mods {
6770
mod(&request)
6871
}
72+
6973
return request
7074
}
7175

@@ -77,6 +81,7 @@ func fixturePayload(mods ...func(payload *iaas.CreateAffinityGroupPayload)) iaas
7781
for _, mod := range mods {
7882
mod(&payload)
7983
}
84+
8085
return payload
8186
}
8287

@@ -145,6 +150,7 @@ func TestBuildRequest(t *testing.T) {
145150
for _, tt := range tests {
146151
t.Run(tt.description, func(t *testing.T) {
147152
request := buildRequest(testCtx, tt.model, testClient)
153+
148154
diff := cmp.Diff(request, tt.expectedRequest,
149155
cmp.AllowUnexported(tt.expectedRequest),
150156
cmpopts.EquateComparable(testCtx, iaas.DefaultAPIService{}))
@@ -180,6 +186,7 @@ func TestOutputResult(t *testing.T) {
180186
isValid: true,
181187
},
182188
}
189+
183190
params := testparams.NewTestParams()
184191
for _, tt := range tests {
185192
t.Run(tt.description, func(t *testing.T) {
@@ -188,9 +195,12 @@ func TestOutputResult(t *testing.T) {
188195
if !tt.isValid {
189196
return
190197
}
198+
191199
t.Fatalf("error output result: %v", err)
200+
192201
return
193202
}
203+
194204
if !tt.isValid {
195205
t.Fatalf("did not fail on invalid input")
196206
return

‎internal/cmd/affinity-groups/delete/delete.go‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
4343
),
4444
RunE: func(cmd *cobra.Command, args []string) error {
4545
ctx := context.Background()
46+
4647
model, err := parseInput(params.Printer, cmd, args)
4748
if err != nil {
4849
return err
@@ -57,32 +58,38 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
5758
projectLabel, err := projectname.GetProjectName(ctx, params.Printer, params.CliVersion, cmd)
5859
if err != nil {
5960
params.Printer.Debug(print.ErrorLevel, "get project name: %v", err)
61+
6062
projectLabel = model.ProjectId
6163
}
6264

6365
affinityGroupLabel, err := iaasUtils.GetAffinityGroupName(ctx, apiClient.DefaultAPI, model.ProjectId, model.Region, model.AffinityGroupId)
6466
if err != nil {
6567
params.Printer.Debug(print.ErrorLevel, "get affinity group name: %v", err)
68+
6669
affinityGroupLabel = model.AffinityGroupId
6770
}
6871

6972
prompt := fmt.Sprintf("Are you sure you want to delete affinity group %q?", affinityGroupLabel)
73+
7074
err = params.Printer.PromptForConfirmation(prompt)
7175
if err != nil {
7276
return err
7377
}
7478

7579
// Call API
7680
request := buildRequest(ctx, *model, apiClient)
81+
7782
err = request.Execute()
7883
if err != nil {
7984
return fmt.Errorf("delete affinity group: %w", err)
8085
}
86+
8187
params.Printer.Info("Deleted affinity group %q for %q\n", affinityGroupLabel, projectLabel)
8288

8389
return nil
8490
},
8591
}
92+
8693
return cmd
8794
}
8895

@@ -102,5 +109,6 @@ func parseInput(p *print.Printer, cmd *cobra.Command, cliArgs []string) (*inputM
102109
}
103110

104111
p.DebugInputModel(model)
112+
105113
return &model, nil
106114
}

0 commit comments

Comments
 (0)