Skip to content

Commit 7a3917b

Browse files
committed
Merge branch 'master' of github.com:devfile/library into 355-kubeCRD-reference
2 parents 1c3b45d + 7a52b22 commit 7a3917b

File tree

7 files changed

+62
-1281
lines changed

7 files changed

+62
-1281
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-20210304212617-bfc3f501616b
6+
github.com/devfile/api/v2 v2.0.0-20210408144711-a313872749ed
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-20210304212617-bfc3f501616b h1:r6Z2rXRA60eQQTdh1cJBBrj3vp9/c1rNbX42kyw2WpA=
79-
github.com/devfile/api/v2 v2.0.0-20210304212617-bfc3f501616b/go.mod h1:Cot4snybn3qhIh48oIFi9McocnIx7zY5fFbjfrIpPvg=
78+
github.com/devfile/api/v2 v2.0.0-20210408144711-a313872749ed h1:eTSeB23FwKwMN0kI7qB7Nq3OhfCaXkPPWUsru8TRo+o=
79+
github.com/devfile/api/v2 v2.0.0-20210408144711-a313872749ed/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/configurables_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func TestAddAndRemoveEnvVars(t *testing.T) {
100100
},
101101
},
102102
Events: &v1.Events{
103-
WorkspaceEvents: v1.WorkspaceEvents{
103+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
104104
PostStop: []string{"post-stop"},
105105
},
106106
},
@@ -194,7 +194,7 @@ func testDevfileObj(fs filesystem.Filesystem) DevfileObj {
194194
},
195195
},
196196
Events: &v1.Events{
197-
WorkspaceEvents: v1.WorkspaceEvents{
197+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
198198
PostStop: []string{"post-stop"},
199199
},
200200
},

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

+24-1,243
Large diffs are not rendered by default.

pkg/devfile/parser/data/v2/events_test.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ func TestDevfile200_AddEvents(t *testing.T) {
1818
{
1919
name: "successfully add the events",
2020
currentEvents: &v1.Events{
21-
WorkspaceEvents: v1.WorkspaceEvents{
21+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
2222
PreStart: []string{"preStart1"},
2323
},
2424
},
2525
newEvents: v1.Events{
26-
WorkspaceEvents: v1.WorkspaceEvents{
26+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
2727
PostStart: []string{"postStart1"},
2828
},
2929
},
@@ -33,7 +33,7 @@ func TestDevfile200_AddEvents(t *testing.T) {
3333
name: "successfully add the events to empty devfile event",
3434
currentEvents: nil,
3535
newEvents: v1.Events{
36-
WorkspaceEvents: v1.WorkspaceEvents{
36+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
3737
PostStart: []string{"postStart1"},
3838
},
3939
},
@@ -42,12 +42,12 @@ func TestDevfile200_AddEvents(t *testing.T) {
4242
{
4343
name: "event already present",
4444
currentEvents: &v1.Events{
45-
WorkspaceEvents: v1.WorkspaceEvents{
45+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
4646
PreStart: []string{"preStart1"},
4747
},
4848
},
4949
newEvents: v1.Events{
50-
WorkspaceEvents: v1.WorkspaceEvents{
50+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
5151
PreStart: []string{"preStart2"},
5252
},
5353
},
@@ -86,12 +86,12 @@ func TestDevfile200_UpdateEvents(t *testing.T) {
8686
{
8787
name: "successfully add/update the events",
8888
currentEvents: &v1.Events{
89-
WorkspaceEvents: v1.WorkspaceEvents{
89+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
9090
PreStart: []string{"preStart1"},
9191
},
9292
},
9393
newEvents: v1.Events{
94-
WorkspaceEvents: v1.WorkspaceEvents{
94+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
9595
PreStart: []string{"preStart2"},
9696
PostStart: []string{"postStart2"},
9797
},
@@ -100,12 +100,12 @@ func TestDevfile200_UpdateEvents(t *testing.T) {
100100
{
101101
name: "successfully update the events to empty",
102102
currentEvents: &v1.Events{
103-
WorkspaceEvents: v1.WorkspaceEvents{
103+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
104104
PreStart: []string{"preStart1"},
105105
},
106106
},
107107
newEvents: v1.Events{
108-
WorkspaceEvents: v1.WorkspaceEvents{
108+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
109109
PreStart: []string{""},
110110
},
111111
},
@@ -114,7 +114,7 @@ func TestDevfile200_UpdateEvents(t *testing.T) {
114114
name: "successfully add the events to empty devfile events",
115115
currentEvents: nil,
116116
newEvents: v1.Events{
117-
WorkspaceEvents: v1.WorkspaceEvents{
117+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
118118
PreStart: []string{"preStart2"},
119119
PostStart: []string{"postStart2"},
120120
},

pkg/devfile/parser/parse_test.go

+21-21
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
104104
},
105105
},
106106
Events: &v1.Events{
107-
WorkspaceEvents: v1.WorkspaceEvents{
107+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
108108
PostStop: []string{"post-stop"},
109109
},
110110
},
@@ -152,7 +152,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
152152
},
153153
},
154154
Events: &v1.Events{
155-
WorkspaceEvents: v1.WorkspaceEvents{
155+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
156156
PostStart: []string{"post-start-0"},
157157
},
158158
},
@@ -223,7 +223,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
223223
},
224224
},
225225
Events: &v1.Events{
226-
WorkspaceEvents: v1.WorkspaceEvents{
226+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
227227
PostStart: []string{"post-start-0"},
228228
PostStop: []string{"post-stop"},
229229
PreStop: []string{},
@@ -287,7 +287,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
287287
},
288288
},
289289
Events: &v1.Events{
290-
WorkspaceEvents: v1.WorkspaceEvents{
290+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
291291
PostStop: []string{"post-stop"},
292292
},
293293
},
@@ -335,7 +335,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
335335
},
336336
},
337337
Events: &v1.Events{
338-
WorkspaceEvents: v1.WorkspaceEvents{
338+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
339339
PostStart: []string{"post-start-0"},
340340
},
341341
},
@@ -406,7 +406,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
406406
},
407407
},
408408
Events: &v1.Events{
409-
WorkspaceEvents: v1.WorkspaceEvents{
409+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
410410
PostStart: []string{"post-start-0"},
411411
PostStop: []string{"post-stop"},
412412
PreStop: []string{},
@@ -624,7 +624,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
624624
DevWorkspaceTemplateSpec: v1.DevWorkspaceTemplateSpec{
625625
DevWorkspaceTemplateSpecContent: v1.DevWorkspaceTemplateSpecContent{
626626
Events: &v1.Events{
627-
WorkspaceEvents: v1.WorkspaceEvents{
627+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
628628
PostStop: []string{"post-stop"},
629629
},
630630
},
@@ -643,7 +643,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
643643
DevWorkspaceTemplateSpec: v1.DevWorkspaceTemplateSpec{
644644
DevWorkspaceTemplateSpecContent: v1.DevWorkspaceTemplateSpecContent{
645645
Events: &v1.Events{
646-
WorkspaceEvents: v1.WorkspaceEvents{
646+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
647647
PostStop: []string{"post-stop"},
648648
},
649649
},
@@ -658,7 +658,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
658658
DevWorkspaceTemplateSpec: v1.DevWorkspaceTemplateSpec{
659659
DevWorkspaceTemplateSpecContent: v1.DevWorkspaceTemplateSpecContent{
660660
Events: &v1.Events{
661-
WorkspaceEvents: v1.WorkspaceEvents{
661+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
662662
PostStop: []string{"post-stop"},
663663
PreStart: []string{},
664664
PreStop: []string{},
@@ -748,7 +748,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
748748
},
749749
},
750750
Events: &v1.Events{
751-
WorkspaceEvents: v1.WorkspaceEvents{
751+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
752752
PostStop: []string{"post-stop"},
753753
},
754754
},
@@ -796,7 +796,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
796796
},
797797
},
798798
Events: &v1.Events{
799-
WorkspaceEvents: v1.WorkspaceEvents{
799+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
800800
PostStart: []string{"post-start-0"},
801801
},
802802
},
@@ -867,7 +867,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
867867
},
868868
},
869869
Events: &v1.Events{
870-
WorkspaceEvents: v1.WorkspaceEvents{
870+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
871871
PostStart: []string{"post-start-0"},
872872
PostStop: []string{"post-stop"},
873873
PreStop: []string{},
@@ -931,7 +931,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
931931
},
932932
},
933933
Events: &v1.Events{
934-
WorkspaceEvents: v1.WorkspaceEvents{
934+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
935935
PostStop: []string{"post-stop-1"},
936936
},
937937
},
@@ -979,7 +979,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
979979
},
980980
},
981981
Events: &v1.Events{
982-
WorkspaceEvents: v1.WorkspaceEvents{
982+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
983983
PostStart: []string{"post-start-0"},
984984
PostStop: []string{"post-stop-2"},
985985
},
@@ -1077,7 +1077,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
10771077
},
10781078
},
10791079
Events: &v1.Events{
1080-
WorkspaceEvents: v1.WorkspaceEvents{
1080+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
10811081
PostStart: []string{"post-start-0"},
10821082
PostStop: []string{"post-stop-1", "post-stop-2"},
10831083
PreStop: []string{},
@@ -1583,7 +1583,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
15831583
},
15841584
},
15851585
Events: &v1.Events{
1586-
WorkspaceEvents: v1.WorkspaceEvents{
1586+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
15871587
PostStop: []string{"post-stop"},
15881588
},
15891589
},
@@ -1619,7 +1619,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
16191619
},
16201620
},
16211621
Events: &v1.Events{
1622-
WorkspaceEvents: v1.WorkspaceEvents{
1622+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
16231623
PostStart: []string{"post-start-0"},
16241624
},
16251625
},
@@ -1675,7 +1675,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
16751675
},
16761676
},
16771677
Events: &v1.Events{
1678-
WorkspaceEvents: v1.WorkspaceEvents{
1678+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
16791679
PreStart: []string{"pre-start-0"},
16801680
},
16811681
},
@@ -1754,7 +1754,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
17541754
},
17551755
},
17561756
Events: &v1.Events{
1757-
WorkspaceEvents: v1.WorkspaceEvents{
1757+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
17581758
PostStart: []string{"post-start-0"},
17591759
PostStop: []string{"post-stop"},
17601760
PreStop: []string{},
@@ -2521,7 +2521,7 @@ func Test_parseParentFromRegistry(t *testing.T) {
25212521
},
25222522
},
25232523
Events: &v1.Events{
2524-
WorkspaceEvents: v1.WorkspaceEvents{
2524+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
25252525
PostStop: []string{"post-stop"},
25262526
},
25272527
},
@@ -2570,7 +2570,7 @@ func Test_parseParentFromRegistry(t *testing.T) {
25702570
},
25712571
},
25722572
Events: &v1.Events{
2573-
WorkspaceEvents: v1.WorkspaceEvents{
2573+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
25742574
PostStart: []string{},
25752575
PostStop: []string{"post-stop"},
25762576
PreStop: []string{},

updateApi.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ set -e
1010

1111
CURRENT_DIR=$(pwd)
1212
API_PKG="github.com/devfile/api/v2"
13-
SCHEMA_URL_MASTER="https://raw.githubusercontent.com/devfile/api/master/schemas/latest/devfile.json"
13+
SCHEMA_URL_MASTER="https://raw.githubusercontent.com/devfile/api/main/schemas/latest/devfile.json"
1414

1515
# 2.0.0 devfile
1616
SCHEMA_URL_200="https://raw.githubusercontent.com/devfile/api/2.0.x/schemas/latest/devfile.json"
@@ -31,7 +31,7 @@ trap 'onError' ERR
3131

3232

3333
echo -e "${GREEN}Updating devfile/api in go.mod${NC}"
34-
go get "${API_PKG}@master"
34+
go get "${API_PKG}@main"
3535

3636
echo -e "${GREEN}Get latest schema${NC}"
3737

0 commit comments

Comments
 (0)