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

Bump Kubefirst API SDK version. #2287

Merged
merged 4 commits into from
Sep 24, 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
8 changes: 6 additions & 2 deletions cmd/aws/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,13 @@ func createAws(cmd *cobra.Command, _ []string) error {
}

// Validate aws region
awsClient := &awsinternal.AWSConfiguration{
Config: awsinternal.NewAwsV2(cloudRegionFlag),
config, err := awsinternal.NewAwsV2(cloudRegionFlag)
if err != nil {
progress.Error(err.Error())
return fmt.Errorf("failed to validate AWS region: %w", err)
}

awsClient := &awsinternal.Configuration{Config: config}
creds, err := awsClient.Config.Credentials.Retrieve(aws.BackgroundContext())
if err != nil {
progress.Error(err.Error())
Expand Down
7 changes: 5 additions & 2 deletions cmd/aws/quota.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@ func evalAwsQuota(cmd *cobra.Command, _ []string) error {
return fmt.Errorf("failed to get cloud region flag: %w", err)
}

awsClient := &awsinternal.AWSConfiguration{
Config: awsinternal.NewAwsV2(cloudRegionFlag),
config, err := awsinternal.NewAwsV2(cloudRegionFlag)
if err != nil {
return fmt.Errorf("failed to create new aws config: %w", err)
}

awsClient := &awsinternal.Configuration{Config: config}
quotaDetails, err := awsClient.GetServiceQuotas([]string{"eks", "vpc"})
if err != nil {
return fmt.Errorf("failed to get service quotas: %w", err)
Expand Down
7 changes: 5 additions & 2 deletions cmd/civo/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func backupCivoSSL(_ *cobra.Command, _ []string) error {
return fmt.Errorf("invalid git provider option: %q", gitProvider)
}

config := providerConfigs.GetConfig(
config, err := providerConfigs.GetConfig(
clusterName,
domainName,
gitProvider,
Expand All @@ -46,6 +46,9 @@ func backupCivoSSL(_ *cobra.Command, _ []string) error {
os.Getenv("CF_API_TOKEN"),
os.Getenv("CF_ORIGIN_CA_ISSUER_API_TOKEN"),
)
if err != nil {
return fmt.Errorf("failed to get config: %w", err)
}

if _, err := os.Stat(config.SSLBackupDir + "/certificates"); os.IsNotExist(err) {
// path/to/whatever does not exist
Expand All @@ -62,7 +65,7 @@ func backupCivoSSL(_ *cobra.Command, _ []string) error {
}
}

err := ssl.Backup(config.SSLBackupDir, domainName, config.K1Dir, config.Kubeconfig)
err = ssl.Backup(config.SSLBackupDir, config.Kubeconfig)
if err != nil {
return fmt.Errorf("error backing up SSL resources: %w", err)
}
Expand Down
8 changes: 6 additions & 2 deletions cmd/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ var infoCmd = &cobra.Command{
Use: "info",
Short: "provides general Kubefirst setup data",
Long: `Provides machine data, files and folders paths`,
Run: func(_ *cobra.Command, _ []string) {
config := configs.ReadConfig()
RunE: func(_ *cobra.Command, _ []string) error {
config, err := configs.ReadConfig()
if err != nil {
return fmt.Errorf("failed to read config: %w", err)
}

var buf bytes.Buffer

Expand All @@ -43,6 +46,7 @@ var infoCmd = &cobra.Command{
fmt.Fprintf(tw, "Kubefirst Version\t%s\n", configs.K1Version)

progress.Success(buf.String())
return nil
},
}

Expand Down
Loading
Loading