Skip to content

Commit

Permalink
Don't parse env on convert command (#578)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Suderman committed Apr 22, 2022
1 parent 3e7c741 commit b43e06d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
4 changes: 4 additions & 0 deletions pkg/course/course.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 "$"
Expand Down

0 comments on commit b43e06d

Please sign in to comment.