Skip to content

Commit

Permalink
fix: polish the code based on review
Browse files Browse the repository at this point in the history
thanks @pmuir for your review

Signed-off-by: James Strachan <[email protected]>
  • Loading branch information
jstrachan committed Jan 30, 2020
1 parent 7a55985 commit 00c0cee
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pkg/cmd/opts/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ func (o *CommonOptions) EnvironmentContext(dir string, preferRequirementsFile bo
}
teamSettings := tc.TeamSettings()

// lets default to local file system for the requirements as we are often invoked before we've created the cluster
exists := false
if preferRequirementsFile {
// lets default to local file system for the requirements as we being invoked
// in a `jx boot` pipeline and we have not yet fully populated the `Environment` resources yet
fileName := ""
tc.Requirements, fileName, err = config.LoadRequirementsConfig(dir)
if err != nil {
Expand Down Expand Up @@ -68,13 +69,14 @@ func (o *CommonOptions) EnvironmentContext(dir string, preferRequirementsFile bo
if err != nil {
return tc, err
}
versionStreamURL := teamSettings.VersionStreamURL
versionStreamRef := teamSettings.VersionStreamRef
if versionStreamURL == "" {
versionStreamURL := ""
versionStreamRef := ""
if preferRequirementsFile {
versionStreamURL = tc.Requirements.VersionStream.URL
}
if versionStreamRef == "" {
versionStreamRef = tc.Requirements.VersionStream.Ref
} else {
versionStreamURL = teamSettings.VersionStreamURL
versionStreamRef = teamSettings.VersionStreamRef
}
tc.VersionResolver, err = o.CreateVersionResolver(versionStreamURL, versionStreamRef)
if err != nil {
Expand Down

0 comments on commit 00c0cee

Please sign in to comment.