diff --git a/pkg/cnab/config-adapter/helpers.go b/pkg/cnab/config-adapter/helpers.go index 404c87a2b1..cf48acc2af 100644 --- a/pkg/cnab/config-adapter/helpers.go +++ b/pkg/cnab/config-adapter/helpers.go @@ -17,12 +17,17 @@ func ConvertToTestBundle(ctx context.Context, cfg *config.Config, manifest *mani return converter.ToBundle(ctx) } - -func MakeCNABCompatible(schema *definition.Schema) { +// MakeCNABCompatible receives a schema with possible porter specific parameters +// and converts those parameters to CNAB compatible versions. +// Returns true if values were replaced and false otherwise. +func MakeCNABCompatible(schema *definition.Schema) bool { if v, ok := schema.Type.(string); ok { if t, ok := config.PorterParamMap[v]; ok { - schema.Type = t; + schema.Type = t schema.ContentEncoding = "base64" + return ok } } + + return false } \ No newline at end of file diff --git a/pkg/manifest/helpers.go b/pkg/manifest/helpers.go index 7742e8b427..49c1944edd 100644 --- a/pkg/manifest/helpers.go +++ b/pkg/manifest/helpers.go @@ -2,6 +2,9 @@ package manifest import "get.porter.sh/porter/pkg/config" +// MakeCNABCompatible receives a schema with possible porter specific parameters +// and converts those parameters to CNAB compatible versions. +// Returns true if values were replaced and false otherwise. func MakeCNABCompatible(def *ParameterDefinition) bool { if v, ok := def.Type.(string); ok { if t, ok := config.PorterParamMap[v]; ok {