mirror of
https://github.com/kubevela/kubevela.git
synced 2026-05-06 01:17:09 +00:00
Fix: healthscope failed since appRevision is not set && rollout controller amend appRevision to workload since compRev does not have this one
This commit is contained in:
@@ -78,6 +78,9 @@ func (p *Parser) GenerateAppFile(ctx context.Context, app *v1beta1.Application)
|
||||
appName := app.Name
|
||||
|
||||
appfile := p.newAppfile(appName, ns, app)
|
||||
if app.Status.LatestRevision != nil {
|
||||
appfile.AppRevisionName = app.Status.LatestRevision.Name
|
||||
}
|
||||
|
||||
var wds []*Workload
|
||||
for _, comp := range app.Spec.Components {
|
||||
|
||||
@@ -221,13 +221,24 @@ func (h *handler) setWorkloadBaseInfo() {
|
||||
h.sourceWorkload.SetNamespace(h.rollout.Namespace)
|
||||
}
|
||||
|
||||
var appRev string
|
||||
if len(h.rollout.GetLabels()) > 0 {
|
||||
appRev = h.rollout.GetLabels()[oam.LabelAppRevision]
|
||||
}
|
||||
|
||||
h.targetWorkload.SetName(h.compName)
|
||||
util.AddLabels(h.targetWorkload, map[string]string{oam.LabelAppComponentRevision: h.targetRevName})
|
||||
util.AddLabels(h.targetWorkload, map[string]string{
|
||||
oam.LabelAppComponentRevision: h.targetRevName,
|
||||
oam.LabelAppRevision: appRev,
|
||||
})
|
||||
util.AddAnnotations(h.targetWorkload, map[string]string{oam.AnnotationSkipGC: "true"})
|
||||
|
||||
if h.sourceWorkload != nil {
|
||||
h.sourceWorkload.SetName(h.compName)
|
||||
util.AddLabels(h.sourceWorkload, map[string]string{oam.LabelAppComponentRevision: h.sourceRevName})
|
||||
util.AddLabels(h.sourceWorkload, map[string]string{
|
||||
oam.LabelAppComponentRevision: h.sourceRevName,
|
||||
oam.LabelAppRevision: appRev,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user