Skip to content

Commit

Permalink
docker-app: Add patch for unused parameters
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Doan <[email protected]>
  • Loading branch information
doanac authored and ricardosalveti committed Feb 26, 2020
1 parent d7573d4 commit a6662a6
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
From a190097ce8d0286b75b9f61553d44629256cf162 Mon Sep 17 00:00:00 2001
From: Andy Doan <[email protected]>
Date: Wed, 26 Feb 2020 16:04:34 -0600
Subject: [PATCH] Warn on unused parameters rather than exit

This allows us to use a single params.yml file for multiple apps in our
factory.

Signed-off-by: Andy Doan <[email protected]>
---
internal/commands/parameters.go | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/internal/commands/parameters.go b/internal/commands/parameters.go
index 50080a24..d1bfa2f3 100644
--- a/internal/commands/parameters.go
+++ b/internal/commands/parameters.go
@@ -2,6 +2,7 @@ package commands

import (
"fmt"
+ "os"

"github.com/deislabs/cnab-go/bundle"
"github.com/docker/app/internal"
@@ -84,7 +85,8 @@ func matchAndMergeParametersDefinition(currentValues map[string]interface{}, par
for k, v := range parameterValues {
definition, ok := parameterDefinitions[k]
if !ok {
- return fmt.Errorf("parameter %q is not defined in the bundle", k)
+ fmt.Fprintf(os.Stderr, "WARNING: parameter %q is not defined in the bundle\n", k)
+ continue
}
value, err := definition.ConvertValue(v)
if err != nil {
--
2.25.1

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=4859e97a9c7780e77972d989
GO_IMPORT = "github.com/docker/app"
SRC_URI = "git://${GO_IMPORT} \
file://0001-packing-use-hub.foundries.io-cnab-app-base-for-cnab-.patch;patchdir=src/${GO_IMPORT} \
file://0001-Warn-on-unused-parameters-rather-than-exit.patch;patchdir=src/${GO_IMPORT} \
"
SRCREV = "7eea32b735b1830ca7de723a1ecb923eae65a2f7"

Expand Down

0 comments on commit a6662a6

Please sign in to comment.