Skip to content

Commit

Permalink
fix: default the namespace from the jx-requirements.yml file
Browse files Browse the repository at this point in the history
also add validation of the enviroment variable `JX_SECRETS_YAML` to ensure its defined to point to the secrets yaml file

Signed-off-by: James Strachan <[email protected]>
  • Loading branch information
jstrachan committed Jan 31, 2020
1 parent 6946ad5 commit d1ccee5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/cmd/step/verify/step_verify_preinstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ func (o *StepVerifyPreInstallOptions) Run() error {
return err
}

if requirements.Helmfile {
// lets make sure we have the secrets defined as an env var
secretsYaml := os.Getenv("JX_SECRETS_YAML")
if secretsYaml == "" {
return fmt.Errorf("no $JX_SECRETS_YAML environment variable defined.\nPlease point this at your 'secrets.yaml' file.\nSee https://github.com/jenkins-x/enhancements/blob/master/proposals/2/docs/getting-started.md#setting-up-your-secrets\n")
}
}

err = o.ConfigureCommonOptions(requirements)
if err != nil {
return err
Expand All @@ -117,6 +125,9 @@ func (o *StepVerifyPreInstallOptions) Run() error {
}

// lets find the namespace to use
if o.Namespace == "" {
o.Namespace = requirements.Cluster.Namespace
}
ns, err := o.GetDeployNamespace(o.Namespace)
if err != nil {
return err
Expand Down

0 comments on commit d1ccee5

Please sign in to comment.