Skip to content
This repository has been archived by the owner on Aug 14, 2020. It is now read-only.

Commit

Permalink
ace validator: fix app annotations validation.
Browse files Browse the repository at this point in the history
The runtimeApp annotations were merged over themself and not over the image
manifest annotations.
  • Loading branch information
sgotti committed Aug 19, 2016
1 parent 737c544 commit 2cd8535
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions ace/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,10 @@ func validatePodMetadata(metadataURL string, pm *schema.PodManifest) results {
func validateAppAnnotations(metadataURL string, pm *schema.PodManifest, app *schema.RuntimeApp, img *schema.ImageManifest) results {
r := results{}

// build a map of expected annotations by merging app.Annotations
// build a map of expected annotations by merging img.Annotations
// with PodManifest overrides
expectedAnnots := app.Annotations
a := pm.Apps.Get(app.Name)
if a == nil {
panic("could not find app in manifest!")
}
for _, annot := range a.Annotations {
expectedAnnots := img.Annotations
for _, annot := range app.Annotations {
expectedAnnots.Set(annot.Name, annot.Value)
}
if len(expectedAnnots) == 0 {
Expand Down

0 comments on commit 2cd8535

Please sign in to comment.