Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions cmd/release-controller-api/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,7 @@ func (c *Controller) apiReleaseInfo(w http.ResponseWriter, req *http.Request) {

var changeLog []byte
var changeLogJson releasecontroller.ChangeLog
var rpmDiff *releasecontroller.RpmDiff

if tagInfo.Info.Previous != nil && len(tagInfo.PreviousTagPullSpec) > 0 && len(tagInfo.TagPullSpec) > 0 {
var wg sync.WaitGroup
Expand All @@ -685,6 +686,18 @@ func (c *Controller) apiReleaseInfo(w http.ResponseWriter, req *http.Request) {
c.changeLogWorker(result, tagInfo, format)
}()
}

wg.Add(1)
go func() {
defer wg.Done()
diff, err := c.releaseInfo.RpmDiff(tagInfo.PreviousTagPullSpec, tagInfo.TagPullSpec)
if err != nil {
klog.V(4).Infof("Unable to retrieve RPM diff for %s: %v", tagInfo.Tag, err)
return
}
rpmDiff = &diff
}()

wg.Wait()

if renderHTML.err == nil {
Expand All @@ -705,13 +718,14 @@ func (c *Controller) apiReleaseInfo(w http.ResponseWriter, req *http.Request) {
}

summary := releasecontroller.APIReleaseInfo{
Name: tagInfo.Tag,
Phase: tagInfo.Info.Tag.Annotations[releasecontroller.ReleaseAnnotationPhase],
Results: verificationJobs,
UpgradesTo: c.graph.UpgradesTo(tagInfo.Tag),
UpgradesFrom: c.graph.UpgradesFrom(tagInfo.Tag),
ChangeLog: changeLog,
ChangeLogJson: changeLogJson,
Name: tagInfo.Tag,
Phase: tagInfo.Info.Tag.Annotations[releasecontroller.ReleaseAnnotationPhase],
Results: verificationJobs,
UpgradesTo: c.graph.UpgradesTo(tagInfo.Tag),
UpgradesFrom: c.graph.UpgradesFrom(tagInfo.Tag),
ChangeLog: changeLog,
ChangeLogJson: changeLogJson,
NodeImageRpmDiff: rpmDiff,
}

data, err := json.MarshalIndent(&summary, "", " ")
Expand Down
2 changes: 2 additions & 0 deletions pkg/release-controller/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ type APIReleaseInfo struct {
ChangeLog []byte `json:"changeLog,omitempty"`
//ChangeLogJson is the json representation of the changes included in this release tag
ChangeLogJson ChangeLog `json:"changeLogJson,omitempty"`
// NodeImageRpmDiff is the RPM package diff between the previous and current node images
NodeImageRpmDiff *RpmDiff `json:"nodeImageRpmDiff,omitempty"`
}

// Release holds information about the release used during processing.
Expand Down
Loading