diff --git a/README.md b/README.md index 62657d84..58f44fa4 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ ## About The Devfile Parser library is a Golang module that: -1. parses a devfile as specified by the [api](https://devfile.io/docs/2.2.1/devfile-schema) & [schema](https://github.com/devfile/api/tree/main/schemas/latest). +1. parses a devfile as specified by the [api](https://devfile.io/docs/2.2.2/devfile-schema) & [schema](https://github.com/devfile/api/tree/main/schemas/latest). 2. writes to the specified devfile with the updated data. 3. generates Kubernetes objects for the various devfile resources. 4. defines util functions for the devfile. diff --git a/go.mod b/go.mod index 89672184..feaf5277 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,8 @@ module github.com/devfile/library/v2 go 1.19 require ( - github.com/devfile/api/v2 v2.2.1 - github.com/devfile/registry-support/registry-library v0.0.0-20240311160550-e51ee8934746 + github.com/devfile/api/v2 v2.2.2 + github.com/devfile/registry-support/registry-library v0.0.0-20240328155806-7c89891a72ce github.com/distribution/distribution/v3 v3.0.0-20221208165359-362910506bc2 github.com/fatih/color v1.14.1 github.com/fsnotify/fsnotify v1.7.0 diff --git a/go.sum b/go.sum index ef734f6d..4fd16dd8 100644 --- a/go.sum +++ b/go.sum @@ -92,12 +92,12 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/devfile/api/v2 v2.2.1 h1:VSX297YqY4C4j4uhn7M0RdZeBaeWqyVi4NnagzEmxu0= -github.com/devfile/api/v2 v2.2.1/go.mod h1:qp8jcw12y1JdCsxjK/7LJ7uWaJOxcY1s2LUk5PhbkbM= +github.com/devfile/api/v2 v2.2.2 h1:DXRCPWFlZhTIE38Of2jzTRjQHadfbxBC8GS+m+EjoCU= +github.com/devfile/api/v2 v2.2.2/go.mod h1:qp8jcw12y1JdCsxjK/7LJ7uWaJOxcY1s2LUk5PhbkbM= github.com/devfile/registry-support/index/generator v0.0.0-20240311135803-6215550f93d4 h1:t09mGdy31tC2YBp6kVD7x8m0jq1CyBUSYMUvrF0iaWw= github.com/devfile/registry-support/index/generator v0.0.0-20240311135803-6215550f93d4/go.mod h1:3Ngbmm12LW03tAEHpDNymM7zryd5H1Xo3ZAGlBpecf8= -github.com/devfile/registry-support/registry-library v0.0.0-20240311160550-e51ee8934746 h1:VQLQguSjxcU1xtUjbqmEW6R9Ehgjk1PzG56vHnzXyEw= -github.com/devfile/registry-support/registry-library v0.0.0-20240311160550-e51ee8934746/go.mod h1:2RRLQaOYuzh8n59euz6Bu60hFoX/LLVM9uzFOFDyOZM= +github.com/devfile/registry-support/registry-library v0.0.0-20240328155806-7c89891a72ce h1:IgUCI7eCq6m0JzRx3+FZuIeJy5e+rUSQYMr3NBzrqyg= +github.com/devfile/registry-support/registry-library v0.0.0-20240328155806-7c89891a72ce/go.mod h1:2RRLQaOYuzh8n59euz6Bu60hFoX/LLVM9uzFOFDyOZM= github.com/distribution/distribution/v3 v3.0.0-20221208165359-362910506bc2 h1:aBfCb7iqHmDEIp6fBvC/hQUddQfg+3qdYjwzaiP9Hnc= github.com/distribution/distribution/v3 v3.0.0-20221208165359-362910506bc2/go.mod h1:WHNsWjnIn2V1LYOrME7e8KxSeKunYHsxEm4am0BUtcI= github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= diff --git a/pkg/devfile/parse_test.go b/pkg/devfile/parse_test.go index 9b100dd7..3faf765e 100644 --- a/pkg/devfile/parse_test.go +++ b/pkg/devfile/parse_test.go @@ -300,10 +300,11 @@ spec: "PARAMS": "bar", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, wantErrorStr: nil, }, @@ -325,10 +326,11 @@ spec: "OTHER": "other", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, wantErrorStr: nil, }, { @@ -348,10 +350,11 @@ spec: "PARAMS": "baz", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, wantErrorStr: nil, }, { @@ -370,10 +373,11 @@ spec: "PARAMS": "baz", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, wantErrorStr: nil, }, @@ -393,10 +397,11 @@ spec: "PARAMS": "baz", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, wantErrorStr: nil, }, @@ -416,10 +421,11 @@ spec: "PARAMS": "baz", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, wantErrorStr: nil, }, @@ -438,10 +444,11 @@ spec: "PARAMS": "baz", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, wantErrorStr: nil, }, @@ -460,10 +467,11 @@ spec: "PARAMS": "baz", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, wantErrorStr: nil, }, @@ -482,10 +490,11 @@ spec: "PARAMS": "baz", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, wantErrorStr: nil, }, @@ -507,10 +516,11 @@ spec: "PARAMS": "baz", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, wantErrorStr: nil, }, @@ -540,10 +550,11 @@ spec: "PARAMS": "baz", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, wantErrorStr: nil, }, @@ -562,10 +573,11 @@ spec: "PARAMS": "from devfile.yaml based on priority", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, additionalChecks: func(devfileObj parser.DevfileObj) error { if devfileObj.Data.GetMetadata().DisplayName != "Go Runtime (devfile.yaml)" { @@ -591,10 +603,11 @@ spec: "PARAMS": "from .devfile.yaml based on priority", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, additionalChecks: func(devfileObj parser.DevfileObj) error { if devfileObj.Data.GetMetadata().DisplayName != "Go Runtime (.devfile.yaml)" { @@ -620,10 +633,11 @@ spec: "PARAMS": "from devfile.yml based on priority", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, additionalChecks: func(devfileObj parser.DevfileObj) error { if devfileObj.Data.GetMetadata().DisplayName != "Test stack (devfile.yml)" { @@ -649,10 +663,11 @@ spec: "PARAMS": "from .devfile.yml based on priority", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, additionalChecks: func(devfileObj parser.DevfileObj) error { if devfileObj.Data.GetMetadata().DisplayName != "Test stack (.devfile.yml)" { @@ -678,10 +693,11 @@ spec: "PARAMS": "from devfile.yml", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, additionalChecks: func(devfileObj parser.DevfileObj) error { if devfileObj.Data.GetMetadata().DisplayName != "Test stack (devfile.yml)" { @@ -707,10 +723,11 @@ spec: "PARAMS": "from .devfile.yml", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, additionalChecks: func(devfileObj parser.DevfileObj) error { if devfileObj.Data.GetMetadata().DisplayName != "Test stack (.devfile.yml)" { @@ -736,10 +753,11 @@ spec: "PARAMS": "from .devfile.yaml", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, additionalChecks: func(devfileObj parser.DevfileObj) error { if devfileObj.Data.GetMetadata().DisplayName != "Go Runtime (.devfile.yaml)" { @@ -765,10 +783,11 @@ spec: "PARAMS": "from any valid devfile file", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, additionalChecks: func(devfileObj parser.DevfileObj) error { if devfileObj.Data.GetMetadata().DisplayName != "Test stack (valid-devfile.yaml.txt)" { @@ -794,10 +813,11 @@ spec: "PARAMS": "baz", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, wantErrorStr: &unsupportedSchemaError, },