Skip to content

Commit

Permalink
Merge pull request #3362 from saschagrunert/latest-version
Browse files Browse the repository at this point in the history
Set `KUBE_CROSS_VERSION` to latest if required
  • Loading branch information
k8s-ci-robot committed Nov 15, 2023
2 parents 81eb410 + d5b6f68 commit dafadda
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/gcp/gcb/gcb.go
Expand Up @@ -377,6 +377,18 @@ func (g *GCB) SetGCBSubstitutions(toolOrg, toolRepo, toolRef, gcsBucket string)
logrus.Infof("KubeCross version not set for %s, falling back to latest", g.options.Branch)
}

if g.options.Branch != git.DefaultBranch {
kcVersionLatest, err := kc.Latest()
if err != nil {
return gcbSubs, fmt.Errorf("retrieve latest kube-cross version: %w", err)
}

// if kcVersionBranch is empty, the branch does not exist yet, we use
// the latest kubecross version
if kcVersionBranch == "" {
kcVersionBranch = kcVersionLatest
}
}
gcbSubs["KUBE_CROSS_VERSION"] = kcVersionBranch

switch {
Expand Down

0 comments on commit dafadda

Please sign in to comment.