Skip to content

Commit

Permalink
Allow file parameters to be optional
Browse files Browse the repository at this point in the history
Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
  • Loading branch information
carolynvs committed Aug 31, 2021
1 parent 394869f commit daad9f8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/runtime/runtime-manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,15 @@ func (m *RuntimeManifest) Initialize() error {
return fmt.Errorf("unable to acquire value for parameter %s", paramName)
}

// TODO(carolynvs): hack around parameters ALWAYS being injected even when empty files mess things up
// I'm not sure yet why it's injecting as null instead of "" (as required by the spec)
// We want to get the null -> "" fixed, and also not write files into the bundle when unset.
// that's a cnab change somewhere probably
// the problem is in injectParameters in cnab-go
if string(bytes) == "null" {
m.FileSystem.Remove(param.Destination.Path)
continue
}
decoded, err := base64.StdEncoding.DecodeString(string(bytes))
if err != nil {
return errors.Wrapf(err, "unable to decode parameter %s", paramName)
Expand Down

0 comments on commit daad9f8

Please sign in to comment.