Skip to content

Commit

Permalink
fix: Support checking for updates in a gcloud bucket
Browse files Browse the repository at this point in the history
Signed-off-by: David Conde <[email protected]>
  • Loading branch information
David Conde authored and jenkins-x-bot committed Nov 18, 2019
1 parent 00880d9 commit fa2e0aa
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions pkg/cmd/opts/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,19 @@ func (o *CommonOptions) InstallTerraform() error {

// GetLatestJXVersion returns latest jx version
func (o *CommonOptions) GetLatestJXVersion(resolver *versionstream.VersionResolver) (semver.Version, error) {
if config.LatestVersionStringsBucket != "" {
err := o.InstallRequirements(cloud.GKE)
if err != nil {
return semver.Version{}, err
}
gcloudOpts := &gke.GCloud{}
latestVersionStrings, err := gcloudOpts.ListObjects(config.LatestVersionStringsBucket, "binaries/jx")
if err != nil {
return semver.Version{}, nil
}
return util.GetLatestVersionStringFromBucketURLs(latestVersionStrings)
}

dir := resolver.VersionsDir
matrix, err := dependencymatrix.LoadDependencyMatrix(dir)
if err != nil {
Expand All @@ -553,18 +566,6 @@ func (o *CommonOptions) GetLatestJXVersion(resolver *versionstream.VersionResolv
}
log.Logger().Warnf("could not find the version of jx in the dependency matrix of the version stream at %s", dir)

if config.LatestVersionStringsBucket != "" {
err := o.InstallRequirements(cloud.GKE)
if err != nil {
return semver.Version{}, err
}
gcloudOpts := &gke.GCloud{}
latestVersionStrings, err := gcloudOpts.ListObjects(config.LatestVersionStringsBucket, "binaries/jx")
if err != nil {
return semver.Version{}, nil
}
return util.GetLatestVersionStringFromBucketURLs(latestVersionStrings)
}
if runtime.GOOS == "darwin" && !o.NoBrew {
log.Logger().Debugf("Locating latest JX version from HomeBrew")
// incase auto-update is not enabled, lets perform an explicit brew update first
Expand Down

0 comments on commit fa2e0aa

Please sign in to comment.