Skip to content

Commit 27db5ae

Browse files
fixed desired manifests response empty when using child app (#85)
1 parent fd823bf commit 27db5ae

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.1.14-cap-CR-commit-msg
1+
2.1.14-cap-CR-fix-rename-file

server/application/application.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,11 +1055,11 @@ func (s *Server) streamApplicationEvents(
10551055
actualState = &application.ApplicationResourceResponse{Manifest: ""}
10561056
}
10571057

1058+
var mr *apiclient.ManifestResponse = desiredManifests
10581059
if isApp(rs) {
10591060
app := &v1alpha1.Application{}
1060-
err = json.Unmarshal([]byte(actualState.Manifest), app)
1061-
if err != nil {
1062-
logWithAppStatus(a, logCtx, ts).WithError(err).Error("failed to get resource desired manifest")
1061+
if err := json.Unmarshal([]byte(actualState.Manifest), app); err != nil {
1062+
logWithAppStatus(a, logCtx, ts).WithError(err).Error("failed to unmarshal child application resource")
10631063
}
10641064
resourceDesiredManifests, err := s.GetManifests(ctx, &application.ApplicationManifestQuery{
10651065
Name: &rs.Name,
@@ -1068,11 +1068,11 @@ func (s *Server) streamApplicationEvents(
10681068
if err != nil {
10691069
logWithAppStatus(a, logCtx, ts).WithError(err).Error("failed to get resource desired manifest")
10701070
} else {
1071-
desiredManifests = resourceDesiredManifests
1071+
mr = resourceDesiredManifests
10721072
}
10731073
}
10741074

1075-
ev, err := getResourceEventPayload(a, &rs, es, actualState, desiredState, desiredManifests, appTree, manifestGenErr, ts)
1075+
ev, err := getResourceEventPayload(a, &rs, es, actualState, desiredState, mr, appTree, manifestGenErr, ts)
10761076
if err != nil {
10771077
logCtx.WithError(err).Error("failed to get event payload")
10781078
continue

0 commit comments

Comments
 (0)