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

Fixed the error messages #68

Merged
merged 1 commit into from
Oct 12, 2023
Merged
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
10 changes: 9 additions & 1 deletion cmd/setEnvironmentSecret.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ package cmd

import (
"errors"
"fmt"
"os"

apiclient "github.com/equinor/radix-cli/generated-client/client"
"github.com/equinor/radix-cli/generated-client/client/environment"
Expand Down Expand Up @@ -66,6 +68,10 @@ var setEnvironmentSecretCmd = &cobra.Command{
}

component, _ := cmd.Flags().GetString(componentOption)
if component == "" {
return errors.New("`component` is required")
}

awaitReconcile, _ := cmd.Flags().GetBool(awaitReconcileOption)

cmd.SilenceUsage = true
Expand All @@ -81,7 +87,8 @@ var setEnvironmentSecretCmd = &cobra.Command{
})

if !reconciledOk {
return errors.New("component was not reconciled within time")
return fmt.Errorf("component was not reconciled within time: either component %s does not exist in the environment %s or the component has not secret %s",
component, environmentName, secretName)
}
}

Expand All @@ -107,6 +114,7 @@ func isComponentSecretReconciled(apiClient *apiclient.Radixapi, appName, environ

env, err := apiClient.Environment.GetEnvironment(getEnvironmentParameters, nil)
if err != nil {
fmt.Fprintln(os.Stderr, err)
return false
}

Expand Down