From cd39d60ee9eece1cad354fd211d0fbbc95110b7d Mon Sep 17 00:00:00 2001 From: Andrew Suderman Date: Fri, 22 Apr 2022 10:06:23 -0600 Subject: [PATCH] Don't parse env on convert command --- cmd/root.go | 1 + pkg/course/course.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/cmd/root.go b/cmd/root.go index 95fc3f0a..5d1f3637 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -276,6 +276,7 @@ var convertCmd = &cobra.Command{ return validateCobraArgs(cmd, args) }, Run: func(cmd *cobra.Command, args []string) { + course.ParseEnv = false newCourse, err := course.OpenCourseFile(courseFile, courseSchema) if err != nil { color.Red(err.Error()) diff --git a/pkg/course/course.go b/pkg/course/course.go index 64719305..b3957d7a 100644 --- a/pkg/course/course.go +++ b/pkg/course/course.go @@ -34,6 +34,7 @@ import ( var ( SchemaValidationError error = errors.New("Course file has schema validation errors") + ParseEnv bool = true ) // FileV2 is the heart of reckoner, it contains the definitions of the releases to be installed @@ -641,6 +642,9 @@ func parseSecrets(courseData []byte) error { } func parseEnv(data string) (string, error) { + if !ParseEnv { + return data, nil + } dataWithEnv := os.Expand(data, func(key string) string { if key == "$" { return "$"