Skip to content

Commit

Permalink
Bump Kubefirst API SDK version.
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickdappollonio committed Sep 18, 2024
1 parent e557ba8 commit f80b57d
Show file tree
Hide file tree
Showing 18 changed files with 236 additions and 96 deletions.
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 err

Check failure on line 28 in cmd/info.go

View workflow job for this annotation

GitHub Actions / build

error returned from external package is unwrapped: sig: var github.com/konstructio/kubefirst-api/pkg/configs.ReadConfig func() (*github.com/konstructio/kubefirst-api/configs.Config, error) (wrapcheck)
}

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

0 comments on commit f80b57d

Please sign in to comment.