-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker-app: Add patch for unused parameters
Signed-off-by: Andy Doan <[email protected]>
- Loading branch information
1 parent
d7573d4
commit a6662a6
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
...es-containers/docker-app/docker-app/0001-Warn-on-unused-parameters-rather-than-exit.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters