Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): nil panic on set-default #304

Merged
merged 2 commits into from
Aug 22, 2024
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
3 changes: 3 additions & 0 deletions cmd/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ var profileSetDefaultCmd = &cobra.Command{
Short: "Set a profile as default",
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
// ensure profile is initialized
InitProfile(cmd, false)

profileName := args[0]

print := cli.NewPrinter(true)
Expand Down
9 changes: 6 additions & 3 deletions pkg/profiles/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import (
"errors"
"fmt"

Check failure on line 5 in pkg/profiles/profile.go

View workflow job for this annotation

GitHub Actions / Run govulncheck

"fmt" imported and not used

Check failure on line 5 in pkg/profiles/profile.go

View workflow job for this annotation

GitHub Actions / unit tests

"fmt" imported and not used

Check failure on line 5 in pkg/profiles/profile.go

View workflow job for this annotation

GitHub Actions / e2e tests

"fmt" imported and not used
)

// TODO:
Expand Down Expand Up @@ -30,9 +31,11 @@
config ProfileConfig
}

const PROFILE_DRIVER_KEYRING = "keyring"
const PROFILE_DRIVER_IN_MEMORY = "in-memory"
const PROFILE_DRIVER_DEFAULT = PROFILE_DRIVER_KEYRING
const (
PROFILE_DRIVER_KEYRING = "keyring"
PROFILE_DRIVER_IN_MEMORY = "in-memory"
PROFILE_DRIVER_DEFAULT = PROFILE_DRIVER_KEYRING
)

type profileConfigVariadicFunc func(profileConfig) profileConfig

Expand Down
Loading