Skip to content

Commit bdd9d56

Browse files
author
Yago Carlos Fernandez Gou
committed
Address review: adjust cli version for client
1 parent 47db483 commit bdd9d56

File tree

6 files changed

+8
-6
lines changed

6 files changed

+8
-6
lines changed

internal/cmd/intake/runner/create/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func NewCreateCmd(p *params.CmdParams) *cobra.Command {
6161
}
6262

6363
// Configure API client
64-
apiClient, err := client.ConfigureClient(p.Printer)
64+
apiClient, err := client.ConfigureClient(p.Printer, p.CliVersion)
6565
if err != nil {
6666
return err
6767
}

internal/cmd/intake/runner/delete/delete.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func NewDeleteCmd(p *params.CmdParams) *cobra.Command {
4646
}
4747

4848
// Configure API client
49-
apiClient, err := client.ConfigureClient(p.Printer)
49+
apiClient, err := client.ConfigureClient(p.Printer, p.CliVersion)
5050
if err != nil {
5151
return err
5252
}

internal/cmd/intake/runner/describe/describe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func NewDescribeCmd(p *params.CmdParams) *cobra.Command {
5151
}
5252

5353
// Configure API client
54-
apiClient, err := client.ConfigureClient(p.Printer)
54+
apiClient, err := client.ConfigureClient(p.Printer, p.CliVersion)
5555
if err != nil {
5656
return err
5757
}

internal/cmd/intake/runner/list/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func NewListCmd(p *params.CmdParams) *cobra.Command {
5656
}
5757

5858
// Configure API client
59-
apiClient, err := client.ConfigureClient(p.Printer)
59+
apiClient, err := client.ConfigureClient(p.Printer, p.CliVersion)
6060
if err != nil {
6161
return err
6262
}

internal/cmd/intake/runner/update/update.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func NewUpdateCmd(p *params.CmdParams) *cobra.Command {
6565
}
6666

6767
// Configure API client
68-
apiClient, err := client.ConfigureClient(p.Printer)
68+
apiClient, err := client.ConfigureClient(p.Printer, p.CliVersion)
6969
if err != nil {
7070
return err
7171
}

internal/pkg/services/intake/client/client.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ import (
66
"github.com/stackitcloud/stackit-cli/internal/pkg/config"
77
"github.com/stackitcloud/stackit-cli/internal/pkg/errors"
88
"github.com/stackitcloud/stackit-cli/internal/pkg/print"
9+
"github.com/stackitcloud/stackit-cli/internal/pkg/utils"
910
sdkConfig "github.com/stackitcloud/stackit-sdk-go/core/config"
1011
"github.com/stackitcloud/stackit-sdk-go/services/intake"
1112
)
1213

1314
// ConfigureClient creates and configures a new Intake API client
14-
func ConfigureClient(p *print.Printer) (*intake.APIClient, error) {
15+
func ConfigureClient(p *print.Printer, cliVersion string) (*intake.APIClient, error) {
1516
authCfgOption, err := auth.AuthenticationConfig(p, auth.AuthorizeUser)
1617
if err != nil {
1718
p.Debug(print.ErrorLevel, "configure authentication: %v", err)
@@ -20,6 +21,7 @@ func ConfigureClient(p *print.Printer) (*intake.APIClient, error) {
2021

2122
region := viper.GetString(config.RegionKey)
2223
cfgOptions := []sdkConfig.ConfigurationOption{
24+
utils.UserAgentConfigOption(cliVersion),
2325
sdkConfig.WithRegion(region),
2426
authCfgOption,
2527
}

0 commit comments

Comments
 (0)