diff --git a/pkg/devfile/generator/generators.go b/pkg/devfile/generator/generators.go index 628187d2..f8a5db0d 100644 --- a/pkg/devfile/generator/generators.go +++ b/pkg/devfile/generator/generators.go @@ -17,6 +17,8 @@ package generator import ( "fmt" + "github.com/devfile/api/v2/pkg/attributes" + "github.com/devfile/library/v2/pkg/devfile/parser/data" v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/library/v2/pkg/devfile/parser" @@ -185,10 +187,14 @@ func GetDeployment(devfileObj parser.DevfileObj, deployParams DeploymentParams) Containers: deployParams.Containers, Volumes: deployParams.Volumes, } - - globalAttributes, err := devfileObj.Data.GetAttributes() - if err != nil { - return nil, err + var globalAttributes attributes.Attributes + // attributes is not supported in versions less than 2.0.0, so we skip it + if devfileObj.Data.GetSchemaVersion() > string(data.APISchemaVersion200) { + var err error + globalAttributes, err = devfileObj.Data.GetAttributes() + if err != nil { + return nil, err + } } components, err := devfileObj.Data.GetDevfileContainerComponents(common.DevfileOptions{}) if err != nil {