Skip to content

Commit d5b6f68

Browse files
committed
Set KUBE_CROSS_VERSION to latest if required
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
1 parent 81eb410 commit d5b6f68

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pkg/gcp/gcb/gcb.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,18 @@ func (g *GCB) SetGCBSubstitutions(toolOrg, toolRepo, toolRef, gcsBucket string)
377377
logrus.Infof("KubeCross version not set for %s, falling back to latest", g.options.Branch)
378378
}
379379

380+
if g.options.Branch != git.DefaultBranch {
381+
kcVersionLatest, err := kc.Latest()
382+
if err != nil {
383+
return gcbSubs, fmt.Errorf("retrieve latest kube-cross version: %w", err)
384+
}
385+
386+
// if kcVersionBranch is empty, the branch does not exist yet, we use
387+
// the latest kubecross version
388+
if kcVersionBranch == "" {
389+
kcVersionBranch = kcVersionLatest
390+
}
391+
}
380392
gcbSubs["KUBE_CROSS_VERSION"] = kcVersionBranch
381393

382394
switch {

0 commit comments

Comments
 (0)