Skip to content

Commit

Permalink
Fix:Dry-run from revision application,Problems caused by resource ver…
Browse files Browse the repository at this point in the history
…sion lower than the current version (kubevela#5246)

Signed-off-by: old.prince <di7zhang@gmail.com>

Signed-off-by: old.prince <di7zhang@gmail.com>
  • Loading branch information
callmeoldprince authored and barnettZQG committed Jan 30, 2023
1 parent 3158912 commit 17a05de
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/apiserver/domain/service/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -1513,6 +1513,13 @@ func (c *applicationServiceImpl) DryRunAppOrRevision(ctx context.Context, appMod
}
case "REVISION":
app, _, err = c.getAppModelFromRevision(ctx, appModel.Name, dryRunReq.Version)
originalApp := &v1beta1.Application{}
if err := c.KubeClient.Get(ctx, types.NamespacedName{
Name: app.Name,
Namespace: app.Namespace,
}, originalApp); err == nil {
app.ResourceVersion = originalApp.ResourceVersion
}
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 17a05de

Please sign in to comment.