diff --git a/go.mod b/go.mod index 16296d55c..4e871531b 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/Xuanwo/go-locale v1.1.0 github.com/blang/semver v3.5.1+incompatible github.com/devfile/alizer v1.2.1 - github.com/devfile/api/v2 v2.2.1 + github.com/devfile/api/v2 v2.2.2 github.com/devfile/library/v2 v2.2.2-0.20231102090733-57a7da8b8392 github.com/devfile/registry-support/index/generator v0.0.0-20230322155332-33914affc83b github.com/devfile/registry-support/registry-library v0.0.0-20221201200738-19293ac0b8ab diff --git a/go.sum b/go.sum index 7649ae460..46da33d04 100644 --- a/go.sum +++ b/go.sum @@ -369,8 +369,8 @@ github.com/devfile/alizer v1.2.1/go.mod h1:kRCsbXuzCwXIbnSR4xpVZDr8Pl8j01rl+gPfk github.com/devfile/api/v2 v2.0.0-20211021164004-dabee4e633ed/go.mod h1:d99eTN6QxgzihOOFyOZA+VpUyD4Q1pYRYHZ/ci9J96Q= github.com/devfile/api/v2 v2.0.0-20220117162434-6e6e6a8bc14c/go.mod h1:d99eTN6QxgzihOOFyOZA+VpUyD4Q1pYRYHZ/ci9J96Q= github.com/devfile/api/v2 v2.2.0/go.mod h1:dN7xFrOVG+iPqn4UKGibXLd5oVsdE8XyK9OEb5JL3aI= -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/library v1.2.1-0.20211104222135-49d635cb492f/go.mod h1:uFZZdTuRqA68FVe/JoJHP92CgINyQkyWnM2Qyiim+50= github.com/devfile/library v1.2.1-0.20220308191614-f0f7e11b17de/go.mod h1:GSPfJaBg0+bBjBHbwBE5aerJLH6tWGQu2q2rHYd9czM= github.com/devfile/library/v2 v2.0.1/go.mod h1:paJ0PARAVy0br13VpBEQ4fO3rZVDxWtooQ29+23PNBk= diff --git a/vendor/github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2/devworkspacetemplate_spec.go b/vendor/github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2/devworkspacetemplate_spec.go index 1d48cf7cc..c2e761285 100644 --- a/vendor/github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2/devworkspacetemplate_spec.go +++ b/vendor/github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2/devworkspacetemplate_spec.go @@ -79,6 +79,14 @@ type DevWorkspaceTemplateSpecContent struct { // +devfile:toplevellist StarterProjects []StarterProject `json:"starterProjects,omitempty" patchStrategy:"merge" patchMergeKey:"name"` + // Additional projects related to the main project in the devfile, contianing names and sources locations + // +optional + // +patchMergeKey=name + // +patchStrategy=merge + // +devfile:overrides:include:omitInPlugin=true,description=Overrides of dependentProjects encapsulated in a parent devfile. + // +devfile:toplevellist + DependentProjects []Project `json:"dependentProjects,omitempty" patchStrategy:"merge" patchMergeKey:"name"` + // Predefined, ready-to-use, devworkspace-related commands // +optional // +patchMergeKey=id diff --git a/vendor/github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2/doc.go b/vendor/github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2/doc.go index adcc2c1da..04b838fb3 100644 --- a/vendor/github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2/doc.go +++ b/vendor/github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2/doc.go @@ -18,5 +18,5 @@ // +k8s:deepcopy-gen=package,register // +k8s:openapi-gen=true // +groupName=workspace.devfile.io -// +devfile:jsonschema:version=2.2.1 +// +devfile:jsonschema:version=2.2.2 package v1alpha2 diff --git a/vendor/github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2/zz_generated.deepcopy.go b/vendor/github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2/zz_generated.deepcopy.go index 60ed58638..936bb4bb2 100644 --- a/vendor/github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2/zz_generated.deepcopy.go +++ b/vendor/github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2/zz_generated.deepcopy.go @@ -1818,6 +1818,13 @@ func (in *DevWorkspaceTemplateSpecContent) DeepCopyInto(out *DevWorkspaceTemplat (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.DependentProjects != nil { + in, out := &in.DependentProjects, &out.DependentProjects + *out = make([]Project, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } if in.Commands != nil { in, out := &in.Commands, &out.Commands *out = make([]Command, len(*in)) @@ -3543,6 +3550,13 @@ func (in *ParentOverrides) DeepCopyInto(out *ParentOverrides) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.DependentProjects != nil { + in, out := &in.DependentProjects, &out.DependentProjects + *out = make([]ProjectParentOverride, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } if in.Commands != nil { in, out := &in.Commands, &out.Commands *out = make([]CommandParentOverride, len(*in)) diff --git a/vendor/github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2/zz_generated.parent_overrides.go b/vendor/github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2/zz_generated.parent_overrides.go index 85a966e88..05278a852 100644 --- a/vendor/github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2/zz_generated.parent_overrides.go +++ b/vendor/github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2/zz_generated.parent_overrides.go @@ -47,6 +47,14 @@ type ParentOverrides struct { // +devfile:toplevellist StarterProjects []StarterProjectParentOverride `json:"starterProjects,omitempty" patchStrategy:"merge" patchMergeKey:"name"` + // Overrides of dependentProjects encapsulated in a parent devfile. + // Overriding is done according to K8S strategic merge patch standard rules. + // +optional + // +patchMergeKey=name + // +patchStrategy=merge + // +devfile:toplevellist + DependentProjects []ProjectParentOverride `json:"dependentProjects,omitempty" patchStrategy:"merge" patchMergeKey:"name"` + // Overrides of commands encapsulated in a parent devfile or a plugin. // Overriding is done according to K8S strategic merge patch standard rules. // +optional diff --git a/vendor/github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2/zz_generated.toplevellistcontainer_definitions.go b/vendor/github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2/zz_generated.toplevellistcontainer_definitions.go index 45be709ff..27250b5bf 100644 --- a/vendor/github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2/zz_generated.toplevellistcontainer_definitions.go +++ b/vendor/github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2/zz_generated.toplevellistcontainer_definitions.go @@ -2,19 +2,21 @@ package v1alpha2 func (container DevWorkspaceTemplateSpecContent) GetToplevelLists() TopLevelLists { return TopLevelLists{ - "Components": extractKeys(container.Components), - "Projects": extractKeys(container.Projects), - "StarterProjects": extractKeys(container.StarterProjects), - "Commands": extractKeys(container.Commands), + "Components": extractKeys(container.Components), + "Projects": extractKeys(container.Projects), + "StarterProjects": extractKeys(container.StarterProjects), + "DependentProjects": extractKeys(container.DependentProjects), + "Commands": extractKeys(container.Commands), } } func (container ParentOverrides) GetToplevelLists() TopLevelLists { return TopLevelLists{ - "Components": extractKeys(container.Components), - "Projects": extractKeys(container.Projects), - "StarterProjects": extractKeys(container.StarterProjects), - "Commands": extractKeys(container.Commands), + "Components": extractKeys(container.Components), + "Projects": extractKeys(container.Projects), + "StarterProjects": extractKeys(container.StarterProjects), + "DependentProjects": extractKeys(container.DependentProjects), + "Commands": extractKeys(container.Commands), } } diff --git a/vendor/github.com/devfile/api/v2/pkg/validation/variables/variables.go b/vendor/github.com/devfile/api/v2/pkg/validation/variables/variables.go index b1adf413a..2b123c84d 100644 --- a/vendor/github.com/devfile/api/v2/pkg/validation/variables/variables.go +++ b/vendor/github.com/devfile/api/v2/pkg/validation/variables/variables.go @@ -39,6 +39,9 @@ type VariableWarning struct { // StarterProjects stores a map of starter project names to the invalid variable references StarterProjects map[string][]string + + // DependentProjects stores a map of dependent project names to invalid variable references + DependentProjects map[string][]string } // ValidateAndReplaceGlobalVariable validates the workspace template spec data for global variable references and replaces them with the variable value @@ -58,6 +61,9 @@ func ValidateAndReplaceGlobalVariable(workspaceTemplateSpec *v1alpha2.DevWorkspa // Validate the starter projects and replace for global variable variableWarning.StarterProjects = ValidateAndReplaceForStarterProjects(workspaceTemplateSpec.Variables, workspaceTemplateSpec.StarterProjects) + + // Validate the starter projects and replace for global variable + variableWarning.DependentProjects = ValidateAndReplaceForProjects(workspaceTemplateSpec.Variables, workspaceTemplateSpec.DependentProjects) } return variableWarning diff --git a/vendor/modules.txt b/vendor/modules.txt index fec4c1c0e..700063156 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -167,7 +167,7 @@ github.com/devfile/alizer/pkg/apis/recognizer github.com/devfile/alizer/pkg/schema github.com/devfile/alizer/pkg/utils github.com/devfile/alizer/pkg/utils/langfiles -# github.com/devfile/api/v2 v2.2.1 +# github.com/devfile/api/v2 v2.2.2 ## explicit; go 1.18 github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2 github.com/devfile/api/v2/pkg/attributes