Skip to content

Commit

Permalink
output error (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
rockspore authored Aug 31, 2020
1 parent 01a5244 commit c7bc1fa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/bindings/bindings.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,9 @@ func (b *bindings) verifyAll(appMap map[string][]App, printf shared.FormatFn) er
}

func (b *bindings) verify(p *product.APIProduct, appMap map[string][]App, printf shared.FormatFn) error {
if p == nil {
return nil
}
if p.GetBoundTargets() == nil {
printf("Product %s is unbound to any target, no need to verify.", p.Name)
return nil
Expand All @@ -355,7 +358,9 @@ func (b *bindings) verify(p *product.APIProduct, appMap map[string][]App, printf
printf("Verifying apps associated with product %s:", p.Name)
for _, app := range apps {
if !app.hasRemoteService {
return fmt.Errorf(" app %s associated with product %s is not associated with remote-service product", app.name, p.Name)
errStr := fmt.Sprintf(" app %s associated with product %s is not associated with remote-service product", app.name, p.Name)
printf(errStr)
return fmt.Errorf(errStr)
}
printf(" app %s associated with product %s is verified", app.name, p.Name)
}
Expand Down

0 comments on commit c7bc1fa

Please sign in to comment.