Skip to content

Commit 7a52b22

Browse files
authored
Merge pull request #79 from yangcao77/updateSchema
update to latest devfile/api
2 parents 85a331e + e91384b commit 7a52b22

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
@@ -44,8 +44,8 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do
4444
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
4545
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
4646
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
47-
github.com/devfile/api/v2 v2.0.0-20210304212617-bfc3f501616b h1:r6Z2rXRA60eQQTdh1cJBBrj3vp9/c1rNbX42kyw2WpA=
48-
github.com/devfile/api/v2 v2.0.0-20210304212617-bfc3f501616b/go.mod h1:Cot4snybn3qhIh48oIFi9McocnIx7zY5fFbjfrIpPvg=
47+
github.com/devfile/api/v2 v2.0.0-20210408144711-a313872749ed h1:eTSeB23FwKwMN0kI7qB7Nq3OhfCaXkPPWUsru8TRo+o=
48+
github.com/devfile/api/v2 v2.0.0-20210408144711-a313872749ed/go.mod h1:Cot4snybn3qhIh48oIFi9McocnIx7zY5fFbjfrIpPvg=
4949
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
5050
github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
5151
github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=

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
@@ -101,7 +101,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
101101
},
102102
},
103103
Events: &v1.Events{
104-
WorkspaceEvents: v1.WorkspaceEvents{
104+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
105105
PostStop: []string{"post-stop"},
106106
},
107107
},
@@ -149,7 +149,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
149149
},
150150
},
151151
Events: &v1.Events{
152-
WorkspaceEvents: v1.WorkspaceEvents{
152+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
153153
PostStart: []string{"post-start-0"},
154154
},
155155
},
@@ -220,7 +220,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
220220
},
221221
},
222222
Events: &v1.Events{
223-
WorkspaceEvents: v1.WorkspaceEvents{
223+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
224224
PostStart: []string{"post-start-0"},
225225
PostStop: []string{"post-stop"},
226226
PreStop: []string{},
@@ -284,7 +284,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
284284
},
285285
},
286286
Events: &v1.Events{
287-
WorkspaceEvents: v1.WorkspaceEvents{
287+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
288288
PostStop: []string{"post-stop"},
289289
},
290290
},
@@ -332,7 +332,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
332332
},
333333
},
334334
Events: &v1.Events{
335-
WorkspaceEvents: v1.WorkspaceEvents{
335+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
336336
PostStart: []string{"post-start-0"},
337337
},
338338
},
@@ -403,7 +403,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
403403
},
404404
},
405405
Events: &v1.Events{
406-
WorkspaceEvents: v1.WorkspaceEvents{
406+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
407407
PostStart: []string{"post-start-0"},
408408
PostStop: []string{"post-stop"},
409409
PreStop: []string{},
@@ -621,7 +621,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
621621
DevWorkspaceTemplateSpec: v1.DevWorkspaceTemplateSpec{
622622
DevWorkspaceTemplateSpecContent: v1.DevWorkspaceTemplateSpecContent{
623623
Events: &v1.Events{
624-
WorkspaceEvents: v1.WorkspaceEvents{
624+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
625625
PostStop: []string{"post-stop"},
626626
},
627627
},
@@ -640,7 +640,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
640640
DevWorkspaceTemplateSpec: v1.DevWorkspaceTemplateSpec{
641641
DevWorkspaceTemplateSpecContent: v1.DevWorkspaceTemplateSpecContent{
642642
Events: &v1.Events{
643-
WorkspaceEvents: v1.WorkspaceEvents{
643+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
644644
PostStop: []string{"post-stop"},
645645
},
646646
},
@@ -655,7 +655,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
655655
DevWorkspaceTemplateSpec: v1.DevWorkspaceTemplateSpec{
656656
DevWorkspaceTemplateSpecContent: v1.DevWorkspaceTemplateSpecContent{
657657
Events: &v1.Events{
658-
WorkspaceEvents: v1.WorkspaceEvents{
658+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
659659
PostStop: []string{"post-stop"},
660660
PreStart: []string{},
661661
PreStop: []string{},
@@ -745,7 +745,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
745745
},
746746
},
747747
Events: &v1.Events{
748-
WorkspaceEvents: v1.WorkspaceEvents{
748+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
749749
PostStop: []string{"post-stop"},
750750
},
751751
},
@@ -793,7 +793,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
793793
},
794794
},
795795
Events: &v1.Events{
796-
WorkspaceEvents: v1.WorkspaceEvents{
796+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
797797
PostStart: []string{"post-start-0"},
798798
},
799799
},
@@ -864,7 +864,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
864864
},
865865
},
866866
Events: &v1.Events{
867-
WorkspaceEvents: v1.WorkspaceEvents{
867+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
868868
PostStart: []string{"post-start-0"},
869869
PostStop: []string{"post-stop"},
870870
PreStop: []string{},
@@ -928,7 +928,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
928928
},
929929
},
930930
Events: &v1.Events{
931-
WorkspaceEvents: v1.WorkspaceEvents{
931+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
932932
PostStop: []string{"post-stop-1"},
933933
},
934934
},
@@ -976,7 +976,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
976976
},
977977
},
978978
Events: &v1.Events{
979-
WorkspaceEvents: v1.WorkspaceEvents{
979+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
980980
PostStart: []string{"post-start-0"},
981981
PostStop: []string{"post-stop-2"},
982982
},
@@ -1074,7 +1074,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
10741074
},
10751075
},
10761076
Events: &v1.Events{
1077-
WorkspaceEvents: v1.WorkspaceEvents{
1077+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
10781078
PostStart: []string{"post-start-0"},
10791079
PostStop: []string{"post-stop-1", "post-stop-2"},
10801080
PreStop: []string{},
@@ -1580,7 +1580,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
15801580
},
15811581
},
15821582
Events: &v1.Events{
1583-
WorkspaceEvents: v1.WorkspaceEvents{
1583+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
15841584
PostStop: []string{"post-stop"},
15851585
},
15861586
},
@@ -1616,7 +1616,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
16161616
},
16171617
},
16181618
Events: &v1.Events{
1619-
WorkspaceEvents: v1.WorkspaceEvents{
1619+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
16201620
PostStart: []string{"post-start-0"},
16211621
},
16221622
},
@@ -1672,7 +1672,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
16721672
},
16731673
},
16741674
Events: &v1.Events{
1675-
WorkspaceEvents: v1.WorkspaceEvents{
1675+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
16761676
PreStart: []string{"pre-start-0"},
16771677
},
16781678
},
@@ -1751,7 +1751,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
17511751
},
17521752
},
17531753
Events: &v1.Events{
1754-
WorkspaceEvents: v1.WorkspaceEvents{
1754+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
17551755
PostStart: []string{"post-start-0"},
17561756
PostStop: []string{"post-stop"},
17571757
PreStop: []string{},
@@ -2510,7 +2510,7 @@ func Test_parseParentFromRegistry(t *testing.T) {
25102510
},
25112511
},
25122512
Events: &v1.Events{
2513-
WorkspaceEvents: v1.WorkspaceEvents{
2513+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
25142514
PostStop: []string{"post-stop"},
25152515
},
25162516
},
@@ -2559,7 +2559,7 @@ func Test_parseParentFromRegistry(t *testing.T) {
25592559
},
25602560
},
25612561
Events: &v1.Events{
2562-
WorkspaceEvents: v1.WorkspaceEvents{
2562+
DevWorkspaceEvents: v1.DevWorkspaceEvents{
25632563
PostStart: []string{},
25642564
PostStop: []string{"post-stop"},
25652565
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)