From 04e1965f9e3ba5f20ffa6064112f0cf8ecaa28fe Mon Sep 17 00:00:00 2001 From: Stephanie Date: Mon, 11 Jan 2021 17:54:45 -0500 Subject: [PATCH] update to use latest api repo and latest schema Signed-off-by: Stephanie --- go.mod | 2 +- go.sum | 5 +- pkg/devfile/generator/generators_test.go | 4 +- pkg/devfile/generator/utils.go | 2 +- pkg/devfile/generator/utils_test.go | 4 +- pkg/devfile/parser/configurables.go | 2 +- pkg/devfile/parser/configurables_test.go | 2 +- pkg/devfile/parser/context/schema_test.go | 10 +- pkg/devfile/parser/data/interface.go | 4 +- .../data/v2/2.0.0/devfileJsonSchema200.go | 183 ++++++++++++++---- pkg/devfile/parser/data/v2/commands.go | 2 +- pkg/devfile/parser/data/v2/commands_test.go | 4 +- .../parser/data/v2/common/command_helper.go | 2 +- .../data/v2/common/command_helper_test.go | 2 +- .../parser/data/v2/common/component_helper.go | 2 +- .../data/v2/common/component_helper_test.go | 2 +- pkg/devfile/parser/data/v2/common/options.go | 2 +- .../parser/data/v2/common/options_test.go | 2 +- .../parser/data/v2/common/project_helper.go | 2 +- .../data/v2/common/project_helper_test.go | 2 +- pkg/devfile/parser/data/v2/components.go | 2 +- pkg/devfile/parser/data/v2/components_test.go | 4 +- pkg/devfile/parser/data/v2/events.go | 2 +- pkg/devfile/parser/data/v2/events_test.go | 2 +- pkg/devfile/parser/data/v2/header.go | 2 +- pkg/devfile/parser/data/v2/header_test.go | 6 +- pkg/devfile/parser/data/v2/parent.go | 2 +- pkg/devfile/parser/data/v2/parent_test.go | 2 +- pkg/devfile/parser/data/v2/projects.go | 2 +- pkg/devfile/parser/data/v2/projects_test.go | 2 +- pkg/devfile/parser/data/v2/types.go | 2 +- pkg/devfile/parser/data/v2/volumes.go | 2 +- pkg/devfile/parser/data/v2/volumes_test.go | 2 +- pkg/devfile/parser/data/v2/workspace.go | 2 +- pkg/devfile/parser/data/v2/workspace_test.go | 2 +- pkg/devfile/parser/parse.go | 4 +- pkg/devfile/parser/parse_test.go | 4 +- pkg/devfile/parser/writer_test.go | 4 +- pkg/testingutil/devfile.go | 4 +- 39 files changed, 197 insertions(+), 95 deletions(-) diff --git a/go.mod b/go.mod index 7537dcf1..1af4dbc3 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/devfile/library go 1.13 require ( - github.com/devfile/api v0.0.0-20201211221100-a68230324c7e + github.com/devfile/api/v2 v2.0.0-20210111205815-273464363288 github.com/fatih/color v1.7.0 github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 github.com/gobwas/glob v0.2.3 diff --git a/go.sum b/go.sum index 0846279d..a59cc190 100644 --- a/go.sum +++ b/go.sum @@ -44,9 +44,8 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/devfile/api v0.0.0-20201211221100-a68230324c7e h1:Jy3C3ul05YvL4bJpAVhFwPZD8neOJUBZy7GuCcjc8nc= -github.com/devfile/api v0.0.0-20201211221100-a68230324c7e/go.mod h1:/aDiwWjDEW/fY1/Ig8umVtmneAXKZImnLvWqzMlcfrY= -github.com/devfile/api v0.0.0-20201222180101-071eecafa93c h1:rAgQa1Vw0y8nLX+HoWWODNgMOBPVAMW+1KbfpyZJAUA= +github.com/devfile/api/v2 v2.0.0-20210111205815-273464363288 h1:3Ea0dVgtCEyWSjobneehLnqIGoK2pS6bWnGnJ1ek24Q= +github.com/devfile/api/v2 v2.0.0-20210111205815-273464363288/go.mod h1:ujP0i3nip2g/aSOXGEy3A7vTC6EIe1kZf9Cteja6OJg= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= diff --git a/pkg/devfile/generator/generators_test.go b/pkg/devfile/generator/generators_test.go index 40618375..cf5a5a78 100644 --- a/pkg/devfile/generator/generators_test.go +++ b/pkg/devfile/generator/generators_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" - "github.com/devfile/api/pkg/attributes" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + "github.com/devfile/api/v2/pkg/attributes" "github.com/devfile/library/pkg/devfile/parser" "github.com/devfile/library/pkg/devfile/parser/data/v2/common" "github.com/devfile/library/pkg/testingutil" diff --git a/pkg/devfile/generator/utils.go b/pkg/devfile/generator/utils.go index 3dd6e809..0ed35a6c 100644 --- a/pkg/devfile/generator/utils.go +++ b/pkg/devfile/generator/utils.go @@ -5,7 +5,7 @@ import ( "path/filepath" "strings" - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/library/pkg/devfile/parser" "github.com/devfile/library/pkg/devfile/parser/data/v2/common" buildv1 "github.com/openshift/api/build/v1" diff --git a/pkg/devfile/generator/utils_test.go b/pkg/devfile/generator/utils_test.go index 88fb8df6..f2539d8f 100644 --- a/pkg/devfile/generator/utils_test.go +++ b/pkg/devfile/generator/utils_test.go @@ -6,13 +6,13 @@ import ( "strings" "testing" - "github.com/devfile/api/pkg/attributes" + "github.com/devfile/api/v2/pkg/attributes" "github.com/devfile/library/pkg/devfile/parser" "github.com/devfile/library/pkg/devfile/parser/data/v2/common" "github.com/devfile/library/pkg/testingutil" buildv1 "github.com/openshift/api/build/v1" - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" diff --git a/pkg/devfile/parser/configurables.go b/pkg/devfile/parser/configurables.go index 08d68b95..8bef2197 100644 --- a/pkg/devfile/parser/configurables.go +++ b/pkg/devfile/parser/configurables.go @@ -5,7 +5,7 @@ import ( "strconv" "strings" - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/library/pkg/devfile/parser/data/v2/common" corev1 "k8s.io/api/core/v1" ) diff --git a/pkg/devfile/parser/configurables_test.go b/pkg/devfile/parser/configurables_test.go index afb850fb..0fe03b8d 100644 --- a/pkg/devfile/parser/configurables_test.go +++ b/pkg/devfile/parser/configurables_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" devfileCtx "github.com/devfile/library/pkg/devfile/parser/context" v2 "github.com/devfile/library/pkg/devfile/parser/data/v2" "github.com/devfile/library/pkg/testingutil/filesystem" diff --git a/pkg/devfile/parser/context/schema_test.go b/pkg/devfile/parser/context/schema_test.go index 71b15c91..9e45007a 100644 --- a/pkg/devfile/parser/context/schema_test.go +++ b/pkg/devfile/parser/context/schema_test.go @@ -67,7 +67,7 @@ const ( ], "commands": [ { - "id": "download dependencies", + "id": "download-dependencies", "exec": { "component": "nodejs", "commandLine": "npm install", @@ -78,7 +78,7 @@ const ( } }, { - "id": "run the app", + "id": "run-the-app", "exec": { "component": "nodejs", "commandLine": "nodemon app.js", @@ -90,7 +90,7 @@ const ( } }, { - "id": "run the app (debugging enabled)", + "id": "run-the-app-debugging-enabled", "exec": { "component": "nodejs", "commandLine": "nodemon --inspect app.js", @@ -101,14 +101,14 @@ const ( } }, { - "id": "stop the app", + "id": "stop-the-app", "exec": { "component": "nodejs", "commandLine": "node_server_pids=$(pgrep -fx '.*nodemon (--inspect )?app.js' | tr \"\\\\n\" \" \") && echo \"Stopping node server with PIDs: ${node_server_pids}\" && kill -15 ${node_server_pids} &>/dev/null && echo 'Done.'" } }, { - "id": "Attach remote debugger", + "id": "attach-remote-debugger", "vscodeLaunch": { "inlined": "{\n \"version\": \"0.2.0\",\n \"configurations\": [\n {\n \"type\": \"node\",\n \"request\": \"attach\",\n \"name\": \"Attach to Remote\",\n \"address\": \"localhost\",\n \"port\": 9229,\n \"localRoot\": \"${workspaceFolder}\",\n \"remoteRoot\": \"${workspaceFolder}\"\n }\n ]\n}\n" } diff --git a/pkg/devfile/parser/data/interface.go b/pkg/devfile/parser/data/interface.go index 56dd6e68..732a15cf 100644 --- a/pkg/devfile/parser/data/interface.go +++ b/pkg/devfile/parser/data/interface.go @@ -1,8 +1,8 @@ package data import ( - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" - devfilepkg "github.com/devfile/api/pkg/devfile" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + devfilepkg "github.com/devfile/api/v2/pkg/devfile" "github.com/devfile/library/pkg/devfile/parser/data/v2/common" ) diff --git a/pkg/devfile/parser/data/v2/2.0.0/devfileJsonSchema200.go b/pkg/devfile/parser/data/v2/2.0.0/devfileJsonSchema200.go index 8f671813..a94bf5f9 100644 --- a/pkg/devfile/parser/data/v2/2.0.0/devfileJsonSchema200.go +++ b/pkg/devfile/parser/data/v2/2.0.0/devfileJsonSchema200.go @@ -215,7 +215,9 @@ const JsonSchema200 = `{ }, "id": { "description": "Mandatory identifier that allows referencing this command in composite commands, from a parent, or in events.", - "type": "string" + "type": "string", + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" }, "vscodeLaunch": { "description": "Command providing the definition of a VsCode launch action", @@ -414,7 +416,9 @@ const JsonSchema200 = `{ ] }, "name": { - "type": "string" + "type": "string", + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" }, "path": { "description": "Path of the endpoint URL", @@ -426,13 +430,15 @@ const JsonSchema200 = `{ "default": "http", "enum": [ "http", + "https", "ws", + "wss", "tcp", "udp" ] }, "secure": { - "description": "Describes whether the endpoint should be secured and protected by some authentication process", + "description": "Describes whether the endpoint should be secured and protected by some authentication process. This requires a protocol of 'https' or 'wss'.", "type": "boolean" }, "targetPort": { @@ -489,7 +495,9 @@ const JsonSchema200 = `{ "properties": { "name": { "description": "The volume mount name is the name of an existing 'Volume' component. If several containers mount the same volume name then they will reuse the same volume and will be able to access to the same files.", - "type": "string" + "type": "string", + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" }, "path": { "description": "The path in the component container where the volume should be mounted. If not path is mentioned, default path is the is '/\u003cname\u003e'.", @@ -543,7 +551,9 @@ const JsonSchema200 = `{ ] }, "name": { - "type": "string" + "type": "string", + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" }, "path": { "description": "Path of the endpoint URL", @@ -555,13 +565,15 @@ const JsonSchema200 = `{ "default": "http", "enum": [ "http", + "https", "ws", + "wss", "tcp", "udp" ] }, "secure": { - "description": "Describes whether the endpoint should be secured and protected by some authentication process", + "description": "Describes whether the endpoint should be secured and protected by some authentication process. This requires a protocol of 'https' or 'wss'.", "type": "boolean" }, "targetPort": { @@ -584,7 +596,9 @@ const JsonSchema200 = `{ }, "name": { "description": "Mandatory name that allows referencing the component from other elements (such as commands) or from an external devfile that may reference this component through a parent or a plugin.", - "type": "string" + "type": "string", + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" }, "openshift": { "description": "Allows importing into the workspace the OpenShift resources defined in a given manifest. For example this allows reusing the OpenShift definitions used to deploy some runtime components in production.", @@ -627,7 +641,9 @@ const JsonSchema200 = `{ ] }, "name": { - "type": "string" + "type": "string", + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" }, "path": { "description": "Path of the endpoint URL", @@ -639,13 +655,15 @@ const JsonSchema200 = `{ "default": "http", "enum": [ "http", + "https", "ws", + "wss", "tcp", "udp" ] }, "secure": { - "description": "Describes whether the endpoint should be secured and protected by some authentication process", + "description": "Describes whether the endpoint should be secured and protected by some authentication process. This requires a protocol of 'https' or 'wss'.", "type": "boolean" }, "targetPort": { @@ -876,7 +894,9 @@ const JsonSchema200 = `{ }, "id": { "description": "Mandatory identifier that allows referencing this command in composite commands, from a parent, or in events.", - "type": "string" + "type": "string", + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" }, "vscodeLaunch": { "description": "Command providing the definition of a VsCode launch action", @@ -1059,7 +1079,9 @@ const JsonSchema200 = `{ ] }, "name": { - "type": "string" + "type": "string", + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" }, "path": { "description": "Path of the endpoint URL", @@ -1070,13 +1092,15 @@ const JsonSchema200 = `{ "type": "string", "enum": [ "http", + "https", "ws", + "wss", "tcp", "udp" ] }, "secure": { - "description": "Describes whether the endpoint should be secured and protected by some authentication process", + "description": "Describes whether the endpoint should be secured and protected by some authentication process. This requires a protocol of 'https' or 'wss'.", "type": "boolean" }, "targetPort": { @@ -1131,7 +1155,9 @@ const JsonSchema200 = `{ "properties": { "name": { "description": "The volume mount name is the name of an existing 'Volume' component. If several containers mount the same volume name then they will reuse the same volume and will be able to access to the same files.", - "type": "string" + "type": "string", + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" }, "path": { "description": "The path in the component container where the volume should be mounted. If not path is mentioned, default path is the is '/\u003cname\u003e'.", @@ -1183,7 +1209,9 @@ const JsonSchema200 = `{ ] }, "name": { - "type": "string" + "type": "string", + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" }, "path": { "description": "Path of the endpoint URL", @@ -1194,13 +1222,15 @@ const JsonSchema200 = `{ "type": "string", "enum": [ "http", + "https", "ws", + "wss", "tcp", "udp" ] }, "secure": { - "description": "Describes whether the endpoint should be secured and protected by some authentication process", + "description": "Describes whether the endpoint should be secured and protected by some authentication process. This requires a protocol of 'https' or 'wss'.", "type": "boolean" }, "targetPort": { @@ -1223,7 +1253,9 @@ const JsonSchema200 = `{ }, "name": { "description": "Mandatory name that allows referencing the component from other elements (such as commands) or from an external devfile that may reference this component through a parent or a plugin.", - "type": "string" + "type": "string", + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" }, "openshift": { "description": "Allows importing into the workspace the OpenShift resources defined in a given manifest. For example this allows reusing the OpenShift definitions used to deploy some runtime components in production.", @@ -1264,7 +1296,9 @@ const JsonSchema200 = `{ ] }, "name": { - "type": "string" + "type": "string", + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" }, "path": { "description": "Path of the endpoint URL", @@ -1275,13 +1309,15 @@ const JsonSchema200 = `{ "type": "string", "enum": [ "http", + "https", "ws", + "wss", "tcp", "udp" ] }, "secure": { - "description": "Describes whether the endpoint should be secured and protected by some authentication process", + "description": "Describes whether the endpoint should be secured and protected by some authentication process. This requires a protocol of 'https' or 'wss'.", "type": "boolean" }, "targetPort": { @@ -1406,10 +1442,33 @@ const JsonSchema200 = `{ "type": "object", "additionalProperties": true }, + "description": { + "description": "Optional devfile description", + "type": "string" + }, + "displayName": { + "description": "Optional devfile display name", + "type": "string" + }, + "globalMemoryLimit": { + "description": "Optional devfile global memory limit", + "type": "string" + }, + "icon": { + "description": "Optional devfile icon", + "type": "string" + }, "name": { "description": "Optional devfile name", "type": "string" }, + "tags": { + "description": "Optional devfile tags", + "type": "array", + "items": { + "type": "string" + } + }, "version": { "description": "Optional semver-compatible version", "type": "string", @@ -1628,7 +1687,9 @@ const JsonSchema200 = `{ }, "id": { "description": "Mandatory identifier that allows referencing this command in composite commands, from a parent, or in events.", - "type": "string" + "type": "string", + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" }, "vscodeLaunch": { "description": "Command providing the definition of a VsCode launch action", @@ -1816,7 +1877,9 @@ const JsonSchema200 = `{ ] }, "name": { - "type": "string" + "type": "string", + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" }, "path": { "description": "Path of the endpoint URL", @@ -1827,13 +1890,15 @@ const JsonSchema200 = `{ "type": "string", "enum": [ "http", + "https", "ws", + "wss", "tcp", "udp" ] }, "secure": { - "description": "Describes whether the endpoint should be secured and protected by some authentication process", + "description": "Describes whether the endpoint should be secured and protected by some authentication process. This requires a protocol of 'https' or 'wss'.", "type": "boolean" }, "targetPort": { @@ -1888,7 +1953,9 @@ const JsonSchema200 = `{ "properties": { "name": { "description": "The volume mount name is the name of an existing 'Volume' component. If several containers mount the same volume name then they will reuse the same volume and will be able to access to the same files.", - "type": "string" + "type": "string", + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" }, "path": { "description": "The path in the component container where the volume should be mounted. If not path is mentioned, default path is the is '/\u003cname\u003e'.", @@ -1940,7 +2007,9 @@ const JsonSchema200 = `{ ] }, "name": { - "type": "string" + "type": "string", + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" }, "path": { "description": "Path of the endpoint URL", @@ -1951,13 +2020,15 @@ const JsonSchema200 = `{ "type": "string", "enum": [ "http", + "https", "ws", + "wss", "tcp", "udp" ] }, "secure": { - "description": "Describes whether the endpoint should be secured and protected by some authentication process", + "description": "Describes whether the endpoint should be secured and protected by some authentication process. This requires a protocol of 'https' or 'wss'.", "type": "boolean" }, "targetPort": { @@ -1980,7 +2051,9 @@ const JsonSchema200 = `{ }, "name": { "description": "Mandatory name that allows referencing the component from other elements (such as commands) or from an external devfile that may reference this component through a parent or a plugin.", - "type": "string" + "type": "string", + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" }, "openshift": { "description": "Allows importing into the workspace the OpenShift resources defined in a given manifest. For example this allows reusing the OpenShift definitions used to deploy some runtime components in production.", @@ -2021,7 +2094,9 @@ const JsonSchema200 = `{ ] }, "name": { - "type": "string" + "type": "string", + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" }, "path": { "description": "Path of the endpoint URL", @@ -2032,13 +2107,15 @@ const JsonSchema200 = `{ "type": "string", "enum": [ "http", + "https", "ws", + "wss", "tcp", "udp" ] }, "secure": { - "description": "Describes whether the endpoint should be secured and protected by some authentication process", + "description": "Describes whether the endpoint should be secured and protected by some authentication process. This requires a protocol of 'https' or 'wss'.", "type": "boolean" }, "targetPort": { @@ -2269,7 +2346,9 @@ const JsonSchema200 = `{ }, "id": { "description": "Mandatory identifier that allows referencing this command in composite commands, from a parent, or in events.", - "type": "string" + "type": "string", + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" }, "vscodeLaunch": { "description": "Command providing the definition of a VsCode launch action", @@ -2452,7 +2531,9 @@ const JsonSchema200 = `{ ] }, "name": { - "type": "string" + "type": "string", + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" }, "path": { "description": "Path of the endpoint URL", @@ -2463,13 +2544,15 @@ const JsonSchema200 = `{ "type": "string", "enum": [ "http", + "https", "ws", + "wss", "tcp", "udp" ] }, "secure": { - "description": "Describes whether the endpoint should be secured and protected by some authentication process", + "description": "Describes whether the endpoint should be secured and protected by some authentication process. This requires a protocol of 'https' or 'wss'.", "type": "boolean" }, "targetPort": { @@ -2524,7 +2607,9 @@ const JsonSchema200 = `{ "properties": { "name": { "description": "The volume mount name is the name of an existing 'Volume' component. If several containers mount the same volume name then they will reuse the same volume and will be able to access to the same files.", - "type": "string" + "type": "string", + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" }, "path": { "description": "The path in the component container where the volume should be mounted. If not path is mentioned, default path is the is '/\u003cname\u003e'.", @@ -2576,7 +2661,9 @@ const JsonSchema200 = `{ ] }, "name": { - "type": "string" + "type": "string", + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" }, "path": { "description": "Path of the endpoint URL", @@ -2587,13 +2674,15 @@ const JsonSchema200 = `{ "type": "string", "enum": [ "http", + "https", "ws", + "wss", "tcp", "udp" ] }, "secure": { - "description": "Describes whether the endpoint should be secured and protected by some authentication process", + "description": "Describes whether the endpoint should be secured and protected by some authentication process. This requires a protocol of 'https' or 'wss'.", "type": "boolean" }, "targetPort": { @@ -2616,7 +2705,9 @@ const JsonSchema200 = `{ }, "name": { "description": "Mandatory name that allows referencing the component from other elements (such as commands) or from an external devfile that may reference this component through a parent or a plugin.", - "type": "string" + "type": "string", + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" }, "openshift": { "description": "Allows importing into the workspace the OpenShift resources defined in a given manifest. For example this allows reusing the OpenShift definitions used to deploy some runtime components in production.", @@ -2657,7 +2748,9 @@ const JsonSchema200 = `{ ] }, "name": { - "type": "string" + "type": "string", + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" }, "path": { "description": "Path of the endpoint URL", @@ -2668,13 +2761,15 @@ const JsonSchema200 = `{ "type": "string", "enum": [ "http", + "https", "ws", + "wss", "tcp", "udp" ] }, "secure": { - "description": "Describes whether the endpoint should be secured and protected by some authentication process", + "description": "Describes whether the endpoint should be secured and protected by some authentication process. This requires a protocol of 'https' or 'wss'.", "type": "boolean" }, "targetPort": { @@ -2867,7 +2962,9 @@ const JsonSchema200 = `{ }, "name": { "description": "Project name", - "type": "string" + "type": "string", + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" }, "sparseCheckoutDirs": { "description": "Populate the project sparsely with selected directories.", @@ -2989,7 +3086,9 @@ const JsonSchema200 = `{ }, "name": { "description": "Project name", - "type": "string" + "type": "string", + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" }, "subDir": { "description": "Sub-directory from a starter project to be used as root for starter project.", @@ -3118,7 +3217,9 @@ const JsonSchema200 = `{ }, "name": { "description": "Project name", - "type": "string" + "type": "string", + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" }, "sparseCheckoutDirs": { "description": "Populate the project sparsely with selected directories.", @@ -3248,7 +3349,9 @@ const JsonSchema200 = `{ }, "name": { "description": "Project name", - "type": "string" + "type": "string", + "maxLength": 63, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" }, "subDir": { "description": "Sub-directory from a starter project to be used as root for starter project.", diff --git a/pkg/devfile/parser/data/v2/commands.go b/pkg/devfile/parser/data/v2/commands.go index 99557103..d308713c 100644 --- a/pkg/devfile/parser/data/v2/commands.go +++ b/pkg/devfile/parser/data/v2/commands.go @@ -3,7 +3,7 @@ package v2 import ( "strings" - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/library/pkg/devfile/parser/data/v2/common" ) diff --git a/pkg/devfile/parser/data/v2/commands_test.go b/pkg/devfile/parser/data/v2/commands_test.go index 8a2cf0b3..b003f3d9 100644 --- a/pkg/devfile/parser/data/v2/commands_test.go +++ b/pkg/devfile/parser/data/v2/commands_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" - "github.com/devfile/api/pkg/attributes" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + "github.com/devfile/api/v2/pkg/attributes" "github.com/devfile/library/pkg/devfile/parser/data/v2/common" ) diff --git a/pkg/devfile/parser/data/v2/common/command_helper.go b/pkg/devfile/parser/data/v2/common/command_helper.go index 3469cd73..728ce29d 100644 --- a/pkg/devfile/parser/data/v2/common/command_helper.go +++ b/pkg/devfile/parser/data/v2/common/command_helper.go @@ -1,7 +1,7 @@ package common import ( - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" ) // GetGroup returns the group the command belongs to diff --git a/pkg/devfile/parser/data/v2/common/command_helper_test.go b/pkg/devfile/parser/data/v2/common/command_helper_test.go index 37d71ed0..b13e2a11 100644 --- a/pkg/devfile/parser/data/v2/common/command_helper_test.go +++ b/pkg/devfile/parser/data/v2/common/command_helper_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" ) func TestGetGroup(t *testing.T) { diff --git a/pkg/devfile/parser/data/v2/common/component_helper.go b/pkg/devfile/parser/data/v2/common/component_helper.go index b225d238..dede5428 100644 --- a/pkg/devfile/parser/data/v2/common/component_helper.go +++ b/pkg/devfile/parser/data/v2/common/component_helper.go @@ -3,7 +3,7 @@ package common import ( "fmt" - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" ) // IsContainer checks if the component is a container diff --git a/pkg/devfile/parser/data/v2/common/component_helper_test.go b/pkg/devfile/parser/data/v2/common/component_helper_test.go index 61895e95..6fb5896e 100644 --- a/pkg/devfile/parser/data/v2/common/component_helper_test.go +++ b/pkg/devfile/parser/data/v2/common/component_helper_test.go @@ -3,7 +3,7 @@ package common import ( "testing" - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" ) func TestIsContainer(t *testing.T) { diff --git a/pkg/devfile/parser/data/v2/common/options.go b/pkg/devfile/parser/data/v2/common/options.go index f4de76ee..c7665ff5 100644 --- a/pkg/devfile/parser/data/v2/common/options.go +++ b/pkg/devfile/parser/data/v2/common/options.go @@ -3,7 +3,7 @@ package common import ( "reflect" - apiAttributes "github.com/devfile/api/pkg/attributes" + apiAttributes "github.com/devfile/api/v2/pkg/attributes" ) // DevfileOptions provides options for Devfile operations diff --git a/pkg/devfile/parser/data/v2/common/options_test.go b/pkg/devfile/parser/data/v2/common/options_test.go index 3fc8f833..8e6c6fa2 100644 --- a/pkg/devfile/parser/data/v2/common/options_test.go +++ b/pkg/devfile/parser/data/v2/common/options_test.go @@ -3,7 +3,7 @@ package common import ( "testing" - "github.com/devfile/api/pkg/attributes" + "github.com/devfile/api/v2/pkg/attributes" ) func TestFilterDevfileObject(t *testing.T) { diff --git a/pkg/devfile/parser/data/v2/common/project_helper.go b/pkg/devfile/parser/data/v2/common/project_helper.go index 3c5f49d0..4028779b 100644 --- a/pkg/devfile/parser/data/v2/common/project_helper.go +++ b/pkg/devfile/parser/data/v2/common/project_helper.go @@ -3,7 +3,7 @@ package common import ( "fmt" - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" ) // GetDefaultSource get information about primary source diff --git a/pkg/devfile/parser/data/v2/common/project_helper_test.go b/pkg/devfile/parser/data/v2/common/project_helper_test.go index 0c52ecee..109b560e 100644 --- a/pkg/devfile/parser/data/v2/common/project_helper_test.go +++ b/pkg/devfile/parser/data/v2/common/project_helper_test.go @@ -3,7 +3,7 @@ package common import ( "testing" - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" ) func TestGitLikeProjectSource_GetDefaultSource(t *testing.T) { diff --git a/pkg/devfile/parser/data/v2/components.go b/pkg/devfile/parser/data/v2/components.go index e6a4b708..2da15b73 100644 --- a/pkg/devfile/parser/data/v2/components.go +++ b/pkg/devfile/parser/data/v2/components.go @@ -1,7 +1,7 @@ package v2 import ( - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/library/pkg/devfile/parser/data/v2/common" ) diff --git a/pkg/devfile/parser/data/v2/components_test.go b/pkg/devfile/parser/data/v2/components_test.go index 930612da..e625c83d 100644 --- a/pkg/devfile/parser/data/v2/components_test.go +++ b/pkg/devfile/parser/data/v2/components_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" - "github.com/devfile/api/pkg/attributes" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + "github.com/devfile/api/v2/pkg/attributes" "github.com/devfile/library/pkg/devfile/parser/data/v2/common" "github.com/devfile/library/pkg/testingutil" ) diff --git a/pkg/devfile/parser/data/v2/events.go b/pkg/devfile/parser/data/v2/events.go index 04ea60ab..621a8d05 100644 --- a/pkg/devfile/parser/data/v2/events.go +++ b/pkg/devfile/parser/data/v2/events.go @@ -1,7 +1,7 @@ package v2 import ( - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/library/pkg/devfile/parser/data/v2/common" ) diff --git a/pkg/devfile/parser/data/v2/events_test.go b/pkg/devfile/parser/data/v2/events_test.go index c17750be..2cbf0715 100644 --- a/pkg/devfile/parser/data/v2/events_test.go +++ b/pkg/devfile/parser/data/v2/events_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" ) func TestDevfile200_AddEvents(t *testing.T) { diff --git a/pkg/devfile/parser/data/v2/header.go b/pkg/devfile/parser/data/v2/header.go index 5f79866c..6798ec95 100644 --- a/pkg/devfile/parser/data/v2/header.go +++ b/pkg/devfile/parser/data/v2/header.go @@ -1,7 +1,7 @@ package v2 import ( - devfilepkg "github.com/devfile/api/pkg/devfile" + devfilepkg "github.com/devfile/api/v2/pkg/devfile" ) //GetSchemaVersion gets devfile schema version diff --git a/pkg/devfile/parser/data/v2/header_test.go b/pkg/devfile/parser/data/v2/header_test.go index e2d58cd9..81cc250c 100644 --- a/pkg/devfile/parser/data/v2/header_test.go +++ b/pkg/devfile/parser/data/v2/header_test.go @@ -4,9 +4,9 @@ import ( "reflect" "testing" - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" - "github.com/devfile/api/pkg/attributes" - devfilepkg "github.com/devfile/api/pkg/devfile" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + "github.com/devfile/api/v2/pkg/attributes" + devfilepkg "github.com/devfile/api/v2/pkg/devfile" ) func TestDevfile200_GetSchemaVersion(t *testing.T) { diff --git a/pkg/devfile/parser/data/v2/parent.go b/pkg/devfile/parser/data/v2/parent.go index 2e6f1242..75df021a 100644 --- a/pkg/devfile/parser/data/v2/parent.go +++ b/pkg/devfile/parser/data/v2/parent.go @@ -1,7 +1,7 @@ package v2 import ( - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" ) // GetParent returns the Parent object parsed from devfile diff --git a/pkg/devfile/parser/data/v2/parent_test.go b/pkg/devfile/parser/data/v2/parent_test.go index a4ce5ab2..9592f18c 100644 --- a/pkg/devfile/parser/data/v2/parent_test.go +++ b/pkg/devfile/parser/data/v2/parent_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" ) func TestDevfile200_SetParent(t *testing.T) { diff --git a/pkg/devfile/parser/data/v2/projects.go b/pkg/devfile/parser/data/v2/projects.go index 70ec18f3..01bee4de 100644 --- a/pkg/devfile/parser/data/v2/projects.go +++ b/pkg/devfile/parser/data/v2/projects.go @@ -3,7 +3,7 @@ package v2 import ( "strings" - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/library/pkg/devfile/parser/data/v2/common" ) diff --git a/pkg/devfile/parser/data/v2/projects_test.go b/pkg/devfile/parser/data/v2/projects_test.go index 6f38b5c6..ee232b13 100644 --- a/pkg/devfile/parser/data/v2/projects_test.go +++ b/pkg/devfile/parser/data/v2/projects_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/kylelemons/godebug/pretty" ) diff --git a/pkg/devfile/parser/data/v2/types.go b/pkg/devfile/parser/data/v2/types.go index e7fdff4e..7a8505ba 100644 --- a/pkg/devfile/parser/data/v2/types.go +++ b/pkg/devfile/parser/data/v2/types.go @@ -1,7 +1,7 @@ package v2 import ( - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" ) // DevfileV2 is the devfile go struct from devfile/api diff --git a/pkg/devfile/parser/data/v2/volumes.go b/pkg/devfile/parser/data/v2/volumes.go index 1f17e6ff..2a338006 100644 --- a/pkg/devfile/parser/data/v2/volumes.go +++ b/pkg/devfile/parser/data/v2/volumes.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/library/pkg/devfile/parser/data/v2/common" ) diff --git a/pkg/devfile/parser/data/v2/volumes_test.go b/pkg/devfile/parser/data/v2/volumes_test.go index c115c978..54b86fd4 100644 --- a/pkg/devfile/parser/data/v2/volumes_test.go +++ b/pkg/devfile/parser/data/v2/volumes_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/library/pkg/testingutil" "github.com/kylelemons/godebug/pretty" ) diff --git a/pkg/devfile/parser/data/v2/workspace.go b/pkg/devfile/parser/data/v2/workspace.go index 54e047e2..e73b8d47 100644 --- a/pkg/devfile/parser/data/v2/workspace.go +++ b/pkg/devfile/parser/data/v2/workspace.go @@ -1,7 +1,7 @@ package v2 import ( - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" ) // GetDevfileWorkspace returns the workspace content for the devfile diff --git a/pkg/devfile/parser/data/v2/workspace_test.go b/pkg/devfile/parser/data/v2/workspace_test.go index 75f95237..5ecbd5ee 100644 --- a/pkg/devfile/parser/data/v2/workspace_test.go +++ b/pkg/devfile/parser/data/v2/workspace_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" ) func TestDevfile200_SetDevfileWorkspace(t *testing.T) { diff --git a/pkg/devfile/parser/parse.go b/pkg/devfile/parser/parse.go index 43c72895..109e2e29 100644 --- a/pkg/devfile/parser/parse.go +++ b/pkg/devfile/parser/parse.go @@ -11,8 +11,8 @@ import ( "reflect" - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" - apiOverride "github.com/devfile/api/pkg/utils/overriding" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + apiOverride "github.com/devfile/api/v2/pkg/utils/overriding" "github.com/pkg/errors" ) diff --git a/pkg/devfile/parser/parse_test.go b/pkg/devfile/parser/parse_test.go index 5c15290d..86e2b8e4 100644 --- a/pkg/devfile/parser/parse_test.go +++ b/pkg/devfile/parser/parse_test.go @@ -8,8 +8,8 @@ import ( "reflect" "testing" - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" - devfilepkg "github.com/devfile/api/pkg/devfile" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + devfilepkg "github.com/devfile/api/v2/pkg/devfile" devfileCtx "github.com/devfile/library/pkg/devfile/parser/context" v2 "github.com/devfile/library/pkg/devfile/parser/data/v2" "github.com/ghodss/yaml" diff --git a/pkg/devfile/parser/writer_test.go b/pkg/devfile/parser/writer_test.go index f226a49d..b1520de1 100644 --- a/pkg/devfile/parser/writer_test.go +++ b/pkg/devfile/parser/writer_test.go @@ -3,8 +3,8 @@ package parser import ( "testing" - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" - devfilepkg "github.com/devfile/api/pkg/devfile" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + devfilepkg "github.com/devfile/api/v2/pkg/devfile" devfileCtx "github.com/devfile/library/pkg/devfile/parser/context" v2 "github.com/devfile/library/pkg/devfile/parser/data/v2" "github.com/devfile/library/pkg/testingutil/filesystem" diff --git a/pkg/testingutil/devfile.go b/pkg/testingutil/devfile.go index 08cca6a3..3386d9df 100644 --- a/pkg/testingutil/devfile.go +++ b/pkg/testingutil/devfile.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - v1 "github.com/devfile/api/pkg/apis/workspaces/v1alpha2" - devfilepkg "github.com/devfile/api/pkg/devfile" + v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + devfilepkg "github.com/devfile/api/v2/pkg/devfile" "github.com/devfile/library/pkg/devfile/parser/data/v2/common" )