Skip to content

Commit 53645d2

Browse files
committed
update source attribute to imported from devfile/api
Signed-off-by: Stephanie <[email protected]>
1 parent 6be752c commit 53645d2

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/devfile/library
33
go 1.13
44

55
require (
6-
github.com/devfile/api/v2 v2.0.0-20210420202853-ff3c01bf8292
6+
github.com/devfile/api/v2 v2.0.0-20210507143755-39103b31c0f3
77
github.com/fatih/color v1.7.0
88
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32
99
github.com/gobwas/glob v0.2.3

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do
7575
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
7676
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
7777
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
78-
github.com/devfile/api/v2 v2.0.0-20210420202853-ff3c01bf8292 h1:XNtHHNf041XmYSbz8u4ZhLbebjhdoY79wDW0HT3Y9UI=
79-
github.com/devfile/api/v2 v2.0.0-20210420202853-ff3c01bf8292/go.mod h1:Cot4snybn3qhIh48oIFi9McocnIx7zY5fFbjfrIpPvg=
78+
github.com/devfile/api/v2 v2.0.0-20210507143755-39103b31c0f3 h1:gm67QZRqq8vCtrpxXlTNPf7xss5rjn9CFcPtAUr+nqo=
79+
github.com/devfile/api/v2 v2.0.0-20210507143755-39103b31c0f3/go.mod h1:Cot4snybn3qhIh48oIFi9McocnIx7zY5fFbjfrIpPvg=
8080
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
8181
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
8282
github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=

pkg/devfile/parser/data/v2/2.1.0/devfileJsonSchema210.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1414,6 +1414,7 @@ const JsonSchema210 = `{
14141414
}
14151415
},
14161416
"registryUrl": {
1417+
"description": "Registry URL to pull the parent devfile from when using id in the parent reference. To ensure the parent devfile gets resolved consistently in different environments, it is recommended to always specify the 'regsitryURL' when 'Id' is used.",
14171418
"type": "string"
14181419
},
14191420
"starterProjects": {
@@ -1535,7 +1536,7 @@ const JsonSchema210 = `{
15351536
}
15361537
},
15371538
"uri": {
1538-
"description": "Uri of a Devfile yaml file",
1539+
"description": "URI Reference of a parent devfile YAML file. It can be a full URL or a relative URI with the current devfile as the base URI.",
15391540
"type": "string"
15401541
},
15411542
"variables": {

pkg/devfile/parser/sourceAttribute.go

+7-6
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ import (
44
"fmt"
55
v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
66
"github.com/devfile/api/v2/pkg/attributes"
7+
"github.com/devfile/api/v2/pkg/validation"
78
)
89

910
const (
10-
importSourceAttribute = "library.devfile.io/imported-from"
11-
parentOverrideAttribute = "library.devfile.io/parent-override-from"
12-
pluginOverrideAttribute = "library.devfile.io/plugin-override-from"
11+
importSourceAttribute = validation.ImportSourceAttribute
12+
parentOverrideAttribute = validation.ParentOverrideAttribute
13+
pluginOverrideAttribute = validation.PluginOverrideAttribute
1314
)
1415

15-
// addSourceAttributesForParentOverride adds an attribute 'library.devfile.io/imported-from=<source reference>'
16+
// addSourceAttributesForParentOverride adds an attribute 'api.devfile.io/imported-from=<source reference>'
1617
// to all elements of template spec content that support attributes.
1718
func addSourceAttributesForTemplateSpecContent(sourceImportReference v1.ImportReference, template *v1.DevWorkspaceTemplateSpecContent) {
1819
for idx, component := range template.Components {
@@ -41,7 +42,7 @@ func addSourceAttributesForTemplateSpecContent(sourceImportReference v1.ImportRe
4142
}
4243
}
4344

44-
// addSourceAttributesForParentOverride adds an attribute 'library.devfile.io/parent-override-from=<source reference>'
45+
// addSourceAttributesForParentOverride adds an attribute 'api.devfile.io/parent-override-from=<source reference>'
4546
// to all elements of parent override that support attributes.
4647
func addSourceAttributesForParentOverride(sourceImportReference v1.ImportReference, parentOverrides *v1.ParentOverrides) {
4748
for idx, component := range parentOverrides.Components {
@@ -71,7 +72,7 @@ func addSourceAttributesForParentOverride(sourceImportReference v1.ImportReferen
7172

7273
}
7374

74-
// addSourceAttributesForPluginOverride adds an attribute 'library.devfile.io/plugin-override-from=<source reference>'
75+
// addSourceAttributesForPluginOverride adds an attribute 'api.devfile.io/plugin-override-from=<source reference>'
7576
// to all elements of plugin override that support attributes.
7677
func addSourceAttributesForPluginOverride(sourceImportReference v1.ImportReference, pluginOverrides *v1.PluginOverrides) {
7778
for idx, component := range pluginOverrides.Components {

0 commit comments

Comments
 (0)