Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI
on: [pull_request, workflow_dispatch]

env:
GO_VERSION: "1.22"
GO_VERSION: "1.23"

jobs:
main:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/stackitcloud/stackit-cli

go 1.22
go 1.23

require (
github.com/fatih/color v1.18.0
Expand Down
17 changes: 6 additions & 11 deletions golang-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ linters-settings:
# it's a comma-separated list of prefixes
local-prefixes: github.com/freiheit-com/nmww
depguard:
list-type: blacklist
include-go-root: false
packages:
- github.com/stretchr/testify
packages-with-error-message:
# specify an error message to output when a blacklisted package is used
- github.com/stretchr/testify: "do not use a testing framework"
rules:
main:
list-mode: lax # Everything is allowed unless it is denied
deny:
- pkg: "github.com/stretchr/testify"
desc: Do not use a testing framework
misspell:
# Correct spellings using locale preferences for US or UK.
# Default is to use a neutral variety of English.
Expand Down Expand Up @@ -75,7 +74,6 @@ linters:
- unused
# additional linters
- errorlint
- exportloopref
- gochecknoinits
- gocritic
- gofmt
Expand All @@ -91,9 +89,6 @@ linters:
- forcetypeassert
- errcheck
disable:
- structcheck # deprecated
- deadcode # deprecated
- varcheck # deprecated
- noctx # false positive: finds errors with http.NewRequest that dont make sense
- unparam # false positives
issues:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
`Activate service account authentication in the STACKIT CLI using the service account token`,
"$ stackit auth activate-service-account --service-account-token my-service-account-token"),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
model := parseInput(p, cmd)

tokenCustomEndpoint, err := storeFlags()
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/auth/login/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
`Login to the STACKIT CLI. This command will open a browser window where you can login to your STACKIT account`,
"$ stackit auth login"),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(_ *cobra.Command, _ []string) error {
err := auth.AuthorizeUser(p, false)
if err != nil {
return fmt.Errorf("authorization failed: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/auth/logout/logout.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
`Log out of the STACKIT CLI.`,
"$ stackit auth logout"),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(_ *cobra.Command, _ []string) error {
err := auth.LogoutUser()
if err != nil {
return fmt.Errorf("log out failed: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/beta/network-area/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
`$ stackit beta network-area create --name network-area-3 --organization-id xxx --network-ranges "1.1.1.0/24,192.123.1.0/24" --transfer-network "192.160.0.0/24" --default-prefix-length 25 --max-prefix-length 29 --min-prefix-length 24`,
),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
ctx := context.Background()
model, err := parseInput(p, cmd)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/beta/network-area/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
"$ stackit beta network-area list --organization-id xxx --limit 10",
),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
ctx := context.Background()
model, err := parseInput(p, cmd)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
`$ stackit beta network-area network-range create --network-area-id xxx --organization-id yyy --network-range "1.1.1.0/24"`,
),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
ctx := context.Background()
model, err := parseInput(p, cmd)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
"$ stackit beta network-area network-range list --network-area-id xxx --organization-id yyy --limit 10",
),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
ctx := context.Background()
model, err := parseInput(p, cmd)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/beta/network-area/route/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
"$ stackit beta network-area route create --labels key=value,foo=bar --organization-id yyy --network-area-id xxx --prefix 1.1.1.0/24 --next-hop 1.1.1.1",
),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
ctx := context.Background()
model, err := parseInput(p, cmd)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/beta/network-area/route/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
"$ stackit beta network-area route list --network-area-id xxx --organization-id yyy --limit 10",
),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
ctx := context.Background()
model, err := parseInput(p, cmd)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/beta/network/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
`$ stackit beta network create --name network-1 --ipv6-dns-name-servers "2001:4860:4860::8888,2001:4860:4860::8844" --ipv6-prefix-length 56`,
),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
ctx := context.Background()
model, err := parseInput(p, cmd)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/beta/network/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
"$ stackit beta network list --limit 10",
),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
ctx := context.Background()
model, err := parseInput(p, cmd)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/beta/server/backup/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
`Create a Server Backup with name "mybackup" and retention period of 5 days`,
`$ stackit beta server backup create --server-id xxx --name=mybackup --retention-period=5`),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
ctx := context.Background()

model, err := parseInput(p, cmd)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/beta/server/backup/disable/disable.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
`Disable Server Backup functionality for your server.`,
"$ stackit beta server backup disable --server-id=zzz"),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
ctx := context.Background()
model, err := parseInput(p, cmd)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/beta/server/backup/enable/enable.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
`Enable Server Backup functionality for your server`,
"$ stackit beta server backup enable --server-id=zzz"),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
ctx := context.Background()
model, err := parseInput(p, cmd)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/beta/server/backup/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
`List all backups for a server with ID "xxx" in JSON format`,
"$ stackit beta server backup list --server-id xxx --output-format json"),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
ctx := context.Background()
model, err := parseInput(p, cmd)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
`Create a Server Backup Schedule with name "myschedule", backup name "mybackup" and retention period of 5 days`,
`$ stackit beta server backup schedule create --server-id xxx --backup-name=mybackup --backup-schedule-name=myschedule --backup-retention-period=5`),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
ctx := context.Background()

model, err := parseInput(p, cmd)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/beta/server/backup/schedule/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
`List all backup schedules for a server with ID "xxx" in JSON format`,
"$ stackit beta server backup schedule list --server-id xxx --output-format json"),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
ctx := context.Background()
model, err := parseInput(p, cmd)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/beta/server/command/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
`Create a server command for server with ID "xxx", template name "RunShellScript" and a script provided on the command line`,
`$ stackit beta server command create --server-id xxx --template-name=RunShellScript --params script='echo hello'`),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
ctx := context.Background()

model, err := parseInput(p, cmd)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/beta/server/command/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
`List all commands for a server with ID "xxx" in JSON format`,
"$ stackit beta server command list --server-id xxx --output-format json"),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
ctx := context.Background()
model, err := parseInput(p, cmd)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/beta/server/command/template/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
`List all commands templates in JSON format`,
"$ stackit beta server command template list --output-format json"),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
ctx := context.Background()
model, err := parseInput(p, cmd)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/beta/sqlserverflex/database/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
`List up to 10 SQLServer Flex databases of instance with ID "xxx"`,
"$ stackit beta sqlserverflex database list --instance-id xxx --limit 10"),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
ctx := context.Background()
model, err := parseInput(p, cmd)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
`Create a SQLServer Flex instance with name "my-instance", specify flavor by CPU and RAM, set storage size to 20 GB, and restrict access to a specific range of IP addresses. Other parameters are set to default values`,
`$ stackit beta sqlserverflex instance create --name my-instance --cpu 1 --ram 4 --storage-size 20 --acl 1.2.3.0/24`),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
ctx := context.Background()

model, err := parseInput(p, cmd)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/beta/sqlserverflex/instance/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
`List up to 10 SQLServer Flex instances`,
"$ stackit beta sqlserverflex instance list --limit 10"),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
ctx := context.Background()
model, err := parseInput(p, cmd)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/beta/sqlserverflex/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
`List SQL Server Flex user roles and database compatibilities for a given instance. The IDs of existing instances can be obtained by running "$ stackit beta sqlserverflex instance list"`,
"$ stackit beta sqlserverflex options --user-roles --db-compatibilities --instance-id <INSTANCE_ID>"),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
ctx := context.Background()
model, err := parseInput(p, cmd)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/beta/sqlserverflex/user/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
`$ stackit beta sqlserverflex user create --instance-id xxx --username johndoe --roles "##STACKIT_LoginManager##,##STACKIT_DatabaseManager##"`),
),
Args: args.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
ctx := context.Background()
model, err := parseInput(p, cmd)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/beta/sqlserverflex/user/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
"$ stackit beta sqlserverflex user list --instance-id xxx --limit 10"),
),
Args: args.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
ctx := context.Background()
model, err := parseInput(p, cmd)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/beta/volume/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
`$ stackit beta volume create --availability-zone eu01-1 --performance-class storage_premium_perf1 --size 64`,
),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
ctx := context.Background()
model, err := parseInput(p, cmd)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/beta/volume/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
"$ stackit beta volume list --limit 10",
),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
ctx := context.Background()
model, err := parseInput(p, cmd)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/beta/volume/performance-class/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
"$ stackit beta volume performance-class list --limit 10",
),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
ctx := context.Background()
model, err := parseInput(p, cmd)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/config/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
`List your active configuration in a json format`,
"$ stackit config list --output-format json"),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
configData := viper.AllSettings()

model := parseInput(p, cmd)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/config/profile/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
`List the configuration profiles in a json format`,
"$ stackit config profile list --output-format json"),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
model := parseInput(p, cmd)

profiles, err := config.ListProfiles()
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/config/profile/unset/unset.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
`Unset the currently active configuration profile. The default profile will be used.`,
"$ stackit config profile unset"),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(_ *cobra.Command, _ []string) error {
err := config.UnsetProfile(p)
if err != nil {
return fmt.Errorf("unset profile: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/config/set/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
`Set the DNS custom endpoint. This endpoint will be used on all calls to the DNS API (unless overridden by the "STACKIT_DNS_CUSTOM_ENDPOINT" environment variable)`,
"$ stackit config set --dns-custom-endpoint https://dns.stackit.cloud"),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
model, err := parseInput(p, cmd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/config/unset/unset.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
`Unset the DNS custom endpoint stored in your configuration`,
"$ stackit config unset --dns-custom-endpoint"),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
model := parseInput(p, cmd)

if model.Async {
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/dns/record-set/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
`Create a DNS record set with name "my-rr" with records "1.2.3.4" and "5.6.7.8" in zone with ID "xxx"`,
"$ stackit dns record-set create --zone-id xxx --name my-rr --record 1.2.3.4 --record 5.6.7.8"),
),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
ctx := context.Background()
model, err := parseInput(p, cmd)
if err != nil {
Expand Down
Loading