applicaiton supports specifying different versions of Definition (#1597)

* app support specify the version of definition

* add e2e-test

* add docs

* add helm related test

* fix doc

* add more test

* fix docs
This commit is contained in:
yangsoon
2021-05-17 10:53:31 +08:00
parent a05a983a9a
commit 01dfedfac2
13 changed files with 1392 additions and 23 deletions
@@ -721,7 +721,7 @@ func (h *appHandler) handleRollout(ctx context.Context) (reconcile.Result, error
// targetRevision should always points to LatestRevison
targetRevision := h.app.Status.LatestRevision.Name
var srcRevision string
target, _ := oamutil.ExtractRevisionNum(targetRevision)
target, _ := oamutil.ExtractRevisionNum(targetRevision, "-")
// if target == 1 this is a initial scale operation, sourceRevision should be empty
// otherwise source revision always is targetRevision - 1
if target > 1 {
@@ -369,7 +369,7 @@ func (h historiesByRevision) Len() int { return len(h) }
func (h historiesByRevision) Swap(i, j int) { h[i], h[j] = h[j], h[i] }
func (h historiesByRevision) Less(i, j int) bool {
// the appRevision is generated by vela, the error always is nil, so ignore it
ir, _ := util.ExtractRevisionNum(h[i].Name)
ij, _ := util.ExtractRevisionNum(h[j].Name)
ir, _ := util.ExtractRevisionNum(h[i].Name, "-")
ij, _ := util.ExtractRevisionNum(h[j].Name, "-")
return ir < ij
}