diff --git a/deploy/crds/workspaces.ecd.eclipse.org_devworkspaces_crd.yaml b/deploy/crds/workspaces.ecd.eclipse.org_devworkspaces_crd.yaml index 5eebb0760..2176947ac 100644 --- a/deploy/crds/workspaces.ecd.eclipse.org_devworkspaces_crd.yaml +++ b/deploy/crds/workspaces.ecd.eclipse.org_devworkspaces_crd.yaml @@ -308,8 +308,6 @@ spec: cheEditor: description: CheEditor component properties: - alias: - type: string locationType: description: Type of plugin location enum: @@ -318,6 +316,11 @@ spec: type: string memoryLimit: type: string + name: + description: Optional name that allows referencing the + component in commands, or inside a parent If omitted + it will be infered from the location (uri or registryEntry) + type: string registryEntry: description: Location of an entry inside a plugin registry properties: @@ -335,8 +338,6 @@ spec: chePlugin: description: ChePlugin component properties: - alias: - type: string locationType: description: Type of plugin location enum: @@ -345,6 +346,11 @@ spec: type: string memoryLimit: type: string + name: + description: Optional name that allows referencing the + component in commands, or inside a parent If omitted + it will be infered from the location (uri or registryEntry) + type: string registryEntry: description: Location of an entry inside a plugin registry properties: @@ -362,8 +368,6 @@ spec: container: description: Container component properties: - alias: - type: string endpoints: items: properties: @@ -474,32 +478,40 @@ spec: kubernetes: description: Kubernetes component properties: - alias: - type: string inlined: description: Reference to the plugin definition type: string locationType: description: Type of Kubernetes-like location type: string + name: + description: Optional name that allows referencing the + component in commands, or inside a parent + type: string url: description: Location in a plugin registry type: string + required: + - name type: object openshift: description: Openshift component properties: - alias: - type: string inlined: description: Reference to the plugin definition type: string locationType: description: Type of Kubernetes-like location type: string + name: + description: Optional name that allows referencing the + component in commands, or inside a parent + type: string url: description: Location in a plugin registry type: string + required: + - name type: object type: description: Type of project source diff --git a/deploy/crds/workspaces.ecd.eclipse.org_devworkspacetemplates_crd.yaml b/deploy/crds/workspaces.ecd.eclipse.org_devworkspacetemplates_crd.yaml index fa65caf75..2af6c7292 100644 --- a/deploy/crds/workspaces.ecd.eclipse.org_devworkspacetemplates_crd.yaml +++ b/deploy/crds/workspaces.ecd.eclipse.org_devworkspacetemplates_crd.yaml @@ -298,8 +298,6 @@ spec: cheEditor: description: CheEditor component properties: - alias: - type: string locationType: description: Type of plugin location enum: @@ -308,6 +306,11 @@ spec: type: string memoryLimit: type: string + name: + description: Optional name that allows referencing the component + in commands, or inside a parent If omitted it will be infered + from the location (uri or registryEntry) + type: string registryEntry: description: Location of an entry inside a plugin registry properties: @@ -325,8 +328,6 @@ spec: chePlugin: description: ChePlugin component properties: - alias: - type: string locationType: description: Type of plugin location enum: @@ -335,6 +336,11 @@ spec: type: string memoryLimit: type: string + name: + description: Optional name that allows referencing the component + in commands, or inside a parent If omitted it will be infered + from the location (uri or registryEntry) + type: string registryEntry: description: Location of an entry inside a plugin registry properties: @@ -352,8 +358,6 @@ spec: container: description: Container component properties: - alias: - type: string endpoints: items: properties: @@ -463,32 +467,40 @@ spec: kubernetes: description: Kubernetes component properties: - alias: - type: string inlined: description: Reference to the plugin definition type: string locationType: description: Type of Kubernetes-like location type: string + name: + description: Optional name that allows referencing the component + in commands, or inside a parent + type: string url: description: Location in a plugin registry type: string + required: + - name type: object openshift: description: Openshift component properties: - alias: - type: string inlined: description: Reference to the plugin definition type: string locationType: description: Type of Kubernetes-like location type: string + name: + description: Optional name that allows referencing the component + in commands, or inside a parent + type: string url: description: Location in a plugin registry type: string + required: + - name type: object type: description: Type of project source diff --git a/devfile-support/samples/custom-devfile.yaml b/devfile-support/samples/custom-devfile.yaml index ed6147883..869b38603 100644 --- a/devfile-support/samples/custom-devfile.yaml +++ b/devfile-support/samples/custom-devfile.yaml @@ -8,6 +8,7 @@ projects: custom-info: "connexion-information" components: - kubernetes: + name: "production" url: "https://somewhere/production-environment.yaml" - custom: componentClass: "NewComponentType" diff --git a/devfile-support/samples/sample-devfile.yaml b/devfile-support/samples/sample-devfile.yaml index 844743c0d..e177b6482 100644 --- a/devfile-support/samples/sample-devfile.yaml +++ b/devfile-support/samples/sample-devfile.yaml @@ -37,4 +37,5 @@ components: field2: "" name: "myNewComponent" - kubernetes: + name: "production" url: "https://somewhere/production-environment.yaml" diff --git a/pkg/apis/workspaces/v1alpha1/components.go b/pkg/apis/workspaces/v1alpha1/components.go index 6592368b1..e5c2b90b3 100644 --- a/pkg/apis/workspaces/v1alpha1/components.go +++ b/pkg/apis/workspaces/v1alpha1/components.go @@ -21,7 +21,6 @@ const ( // Workspace component: Anything that will bring additional features / tooling / behaviour / context // to the workspace, in order to make working in it easier. type BaseComponent struct { - Alias string `json:"alias,omitempty"` } type Component struct { diff --git a/pkg/apis/workspaces/v1alpha1/kubernetesLikeComponent.go b/pkg/apis/workspaces/v1alpha1/kubernetesLikeComponent.go index 5f02c7db5..4d58c5553 100644 --- a/pkg/apis/workspaces/v1alpha1/kubernetesLikeComponent.go +++ b/pkg/apis/workspaces/v1alpha1/kubernetesLikeComponent.go @@ -3,6 +3,10 @@ package v1alpha1 // +k8s:openapi-gen=true // +union type K8sLikeComponentLocation struct { + // Optional name that allows referencing the component + // in commands, or inside a parent + Name string `json:"name"` + // Type of Kubernetes-like location // + // +unionDiscriminator @@ -20,7 +24,7 @@ type K8sLikeComponentLocation struct { type K8sLikeComponent struct { BaseComponent `json:",inline"` - Location K8sLikeComponentLocation `json:",inline"` + Location K8sLikeComponentLocation `json:",inline"` } // Component that allows partly importing Kubernetes resources into the workspace POD diff --git a/pkg/apis/workspaces/v1alpha1/pluginLikeComponents.go b/pkg/apis/workspaces/v1alpha1/pluginLikeComponents.go index eb68b7bc2..9f42e9e4c 100644 --- a/pkg/apis/workspaces/v1alpha1/pluginLikeComponents.go +++ b/pkg/apis/workspaces/v1alpha1/pluginLikeComponents.go @@ -1,7 +1,7 @@ package v1alpha1 type RegistryEntryPluginLocation struct { - Id string `json:"id"` + Id string `json:"id"` // +optional BaseUrl string `json:"baseUrl,omitempty"` @@ -13,8 +13,8 @@ type RegistryEntryPluginLocation struct { type PluginLocationType string const ( - RegistryEntryPluginLocationType PluginLocationType = "RegistryEntry" - UriPluginLocationType PluginLocationType = "Uri" + RegistryEntryPluginLocationType PluginLocationType = "RegistryEntry" + UriPluginLocationType PluginLocationType = "Uri" ) // +k8s:openapi-gen=true @@ -37,7 +37,14 @@ type ChePluginLocation struct { type PluginLikeComponent struct { BaseComponent `json:",inline"` - MemoryLimit string `json:"memoryLimit,omitempty"` + + // +optional + // Optional name that allows referencing the component + // in commands, or inside a parent + // If omitted it will be infered from the location (uri or registryEntry) + Name string `json:"name,omitempty"` + + MemoryLimit string `json:"memoryLimit,omitempty"` ChePluginLocation `json:",inline"` } diff --git a/pkg/apis/workspaces/v1alpha1/zz_generated.openapi.go b/pkg/apis/workspaces/v1alpha1/zz_generated.openapi.go index ed7b64090..8b856cbc5 100644 --- a/pkg/apis/workspaces/v1alpha1/zz_generated.openapi.go +++ b/pkg/apis/workspaces/v1alpha1/zz_generated.openapi.go @@ -298,6 +298,13 @@ func schema_pkg_apis_workspaces_v1alpha1_K8sLikeComponentLocation(ref common.Ref SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Optional name that allows referencing the component in commands, or inside a parent", + Type: []string{"string"}, + Format: "", + }, + }, "locationType": { SchemaProps: spec.SchemaProps{ Description: "Type of Kubernetes-like location", @@ -320,6 +327,7 @@ func schema_pkg_apis_workspaces_v1alpha1_K8sLikeComponentLocation(ref common.Ref }, }, }, + Required: []string{"name"}, }, VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ @@ -328,6 +336,7 @@ func schema_pkg_apis_workspaces_v1alpha1_K8sLikeComponentLocation(ref common.Ref "discriminator": "locationType", "fields-to-discriminateBy": map[string]interface{}{ "inlined": "Inlined", + "name": "Name", "url": "Url", }, }, diff --git a/samples/example.devworkspace.yaml b/samples/example.devworkspace.yaml index 88ee8f8f3..eb0890068 100644 --- a/samples/example.devworkspace.yaml +++ b/samples/example.devworkspace.yaml @@ -42,4 +42,5 @@ spec: field1: "" field2: "" - kubernetes: + name: "production" url: "https://somewhere/production-environment.yaml" diff --git a/schemas/devfile.json b/schemas/devfile.json index 728177bd5..c71a8a2e2 100644 --- a/schemas/devfile.json +++ b/schemas/devfile.json @@ -328,9 +328,6 @@ "cheEditor": { "description": "CheEditor component", "properties": { - "alias": { - "type": "string" - }, "locationType": { "description": "Type of plugin location", "enum": [ @@ -342,6 +339,10 @@ "memoryLimit": { "type": "string" }, + "name": { + "description": "Optional name that allows referencing the component in commands, or inside a parent If omitted it will be infered from the location (uri or registryEntry)", + "type": "string" + }, "registryEntry": { "description": "Location of an entry inside a plugin registry", "properties": { @@ -367,9 +368,6 @@ "chePlugin": { "description": "ChePlugin component", "properties": { - "alias": { - "type": "string" - }, "locationType": { "description": "Type of plugin location", "enum": [ @@ -381,6 +379,10 @@ "memoryLimit": { "type": "string" }, + "name": { + "description": "Optional name that allows referencing the component in commands, or inside a parent If omitted it will be infered from the location (uri or registryEntry)", + "type": "string" + }, "registryEntry": { "description": "Location of an entry inside a plugin registry", "properties": { @@ -406,9 +408,6 @@ "container": { "description": "Container component", "properties": { - "alias": { - "type": "string" - }, "endpoints": { "items": { "properties": { @@ -554,9 +553,6 @@ "kubernetes": { "description": "Kubernetes component", "properties": { - "alias": { - "type": "string" - }, "inlined": { "description": "Reference to the plugin definition", "type": "string" @@ -565,19 +561,23 @@ "description": "Type of Kubernetes-like location", "type": "string" }, + "name": { + "description": "Optional name that allows referencing the component in commands, or inside a parent", + "type": "string" + }, "url": { "description": "Location in a plugin registry", "type": "string" } }, + "required": [ + "name" + ], "type": "object" }, "openshift": { "description": "Openshift component", "properties": { - "alias": { - "type": "string" - }, "inlined": { "description": "Reference to the plugin definition", "type": "string" @@ -586,11 +586,18 @@ "description": "Type of Kubernetes-like location", "type": "string" }, + "name": { + "description": "Optional name that allows referencing the component in commands, or inside a parent", + "type": "string" + }, "url": { "description": "Location in a plugin registry", "type": "string" } }, + "required": [ + "name" + ], "type": "object" }, "type": { diff --git a/schemas/devworkspace-template-spec.json b/schemas/devworkspace-template-spec.json index 18fb7dbd0..1d4c142a8 100644 --- a/schemas/devworkspace-template-spec.json +++ b/schemas/devworkspace-template-spec.json @@ -328,9 +328,6 @@ "cheEditor": { "description": "CheEditor component", "properties": { - "alias": { - "type": "string" - }, "locationType": { "description": "Type of plugin location", "enum": [ @@ -342,6 +339,10 @@ "memoryLimit": { "type": "string" }, + "name": { + "description": "Optional name that allows referencing the component in commands, or inside a parent If omitted it will be infered from the location (uri or registryEntry)", + "type": "string" + }, "registryEntry": { "description": "Location of an entry inside a plugin registry", "properties": { @@ -367,9 +368,6 @@ "chePlugin": { "description": "ChePlugin component", "properties": { - "alias": { - "type": "string" - }, "locationType": { "description": "Type of plugin location", "enum": [ @@ -381,6 +379,10 @@ "memoryLimit": { "type": "string" }, + "name": { + "description": "Optional name that allows referencing the component in commands, or inside a parent If omitted it will be infered from the location (uri or registryEntry)", + "type": "string" + }, "registryEntry": { "description": "Location of an entry inside a plugin registry", "properties": { @@ -406,9 +408,6 @@ "container": { "description": "Container component", "properties": { - "alias": { - "type": "string" - }, "endpoints": { "items": { "properties": { @@ -554,9 +553,6 @@ "kubernetes": { "description": "Kubernetes component", "properties": { - "alias": { - "type": "string" - }, "inlined": { "description": "Reference to the plugin definition", "type": "string" @@ -565,19 +561,23 @@ "description": "Type of Kubernetes-like location", "type": "string" }, + "name": { + "description": "Optional name that allows referencing the component in commands, or inside a parent", + "type": "string" + }, "url": { "description": "Location in a plugin registry", "type": "string" } }, + "required": [ + "name" + ], "type": "object" }, "openshift": { "description": "Openshift component", "properties": { - "alias": { - "type": "string" - }, "inlined": { "description": "Reference to the plugin definition", "type": "string" @@ -586,11 +586,18 @@ "description": "Type of Kubernetes-like location", "type": "string" }, + "name": { + "description": "Optional name that allows referencing the component in commands, or inside a parent", + "type": "string" + }, "url": { "description": "Location in a plugin registry", "type": "string" } }, + "required": [ + "name" + ], "type": "object" }, "type": { diff --git a/schemas/devworkspace-template.json b/schemas/devworkspace-template.json index 40b027075..d85193c32 100644 --- a/schemas/devworkspace-template.json +++ b/schemas/devworkspace-template.json @@ -342,9 +342,6 @@ "cheEditor": { "description": "CheEditor component", "properties": { - "alias": { - "type": "string" - }, "locationType": { "description": "Type of plugin location", "enum": [ @@ -356,6 +353,10 @@ "memoryLimit": { "type": "string" }, + "name": { + "description": "Optional name that allows referencing the component in commands, or inside a parent If omitted it will be infered from the location (uri or registryEntry)", + "type": "string" + }, "registryEntry": { "description": "Location of an entry inside a plugin registry", "properties": { @@ -381,9 +382,6 @@ "chePlugin": { "description": "ChePlugin component", "properties": { - "alias": { - "type": "string" - }, "locationType": { "description": "Type of plugin location", "enum": [ @@ -395,6 +393,10 @@ "memoryLimit": { "type": "string" }, + "name": { + "description": "Optional name that allows referencing the component in commands, or inside a parent If omitted it will be infered from the location (uri or registryEntry)", + "type": "string" + }, "registryEntry": { "description": "Location of an entry inside a plugin registry", "properties": { @@ -420,9 +422,6 @@ "container": { "description": "Container component", "properties": { - "alias": { - "type": "string" - }, "endpoints": { "items": { "properties": { @@ -568,9 +567,6 @@ "kubernetes": { "description": "Kubernetes component", "properties": { - "alias": { - "type": "string" - }, "inlined": { "description": "Reference to the plugin definition", "type": "string" @@ -579,19 +575,23 @@ "description": "Type of Kubernetes-like location", "type": "string" }, + "name": { + "description": "Optional name that allows referencing the component in commands, or inside a parent", + "type": "string" + }, "url": { "description": "Location in a plugin registry", "type": "string" } }, + "required": [ + "name" + ], "type": "object" }, "openshift": { "description": "Openshift component", "properties": { - "alias": { - "type": "string" - }, "inlined": { "description": "Reference to the plugin definition", "type": "string" @@ -600,11 +600,18 @@ "description": "Type of Kubernetes-like location", "type": "string" }, + "name": { + "description": "Optional name that allows referencing the component in commands, or inside a parent", + "type": "string" + }, "url": { "description": "Location in a plugin registry", "type": "string" } }, + "required": [ + "name" + ], "type": "object" }, "type": { diff --git a/schemas/devworkspace.json b/schemas/devworkspace.json index 4758136f7..22b06de67 100644 --- a/schemas/devworkspace.json +++ b/schemas/devworkspace.json @@ -351,9 +351,6 @@ "cheEditor": { "description": "CheEditor component", "properties": { - "alias": { - "type": "string" - }, "locationType": { "description": "Type of plugin location", "enum": [ @@ -365,6 +362,10 @@ "memoryLimit": { "type": "string" }, + "name": { + "description": "Optional name that allows referencing the component in commands, or inside a parent If omitted it will be infered from the location (uri or registryEntry)", + "type": "string" + }, "registryEntry": { "description": "Location of an entry inside a plugin registry", "properties": { @@ -390,9 +391,6 @@ "chePlugin": { "description": "ChePlugin component", "properties": { - "alias": { - "type": "string" - }, "locationType": { "description": "Type of plugin location", "enum": [ @@ -404,6 +402,10 @@ "memoryLimit": { "type": "string" }, + "name": { + "description": "Optional name that allows referencing the component in commands, or inside a parent If omitted it will be infered from the location (uri or registryEntry)", + "type": "string" + }, "registryEntry": { "description": "Location of an entry inside a plugin registry", "properties": { @@ -429,9 +431,6 @@ "container": { "description": "Container component", "properties": { - "alias": { - "type": "string" - }, "endpoints": { "items": { "properties": { @@ -577,9 +576,6 @@ "kubernetes": { "description": "Kubernetes component", "properties": { - "alias": { - "type": "string" - }, "inlined": { "description": "Reference to the plugin definition", "type": "string" @@ -588,19 +584,23 @@ "description": "Type of Kubernetes-like location", "type": "string" }, + "name": { + "description": "Optional name that allows referencing the component in commands, or inside a parent", + "type": "string" + }, "url": { "description": "Location in a plugin registry", "type": "string" } }, + "required": [ + "name" + ], "type": "object" }, "openshift": { "description": "Openshift component", "properties": { - "alias": { - "type": "string" - }, "inlined": { "description": "Reference to the plugin definition", "type": "string" @@ -609,11 +609,18 @@ "description": "Type of Kubernetes-like location", "type": "string" }, + "name": { + "description": "Optional name that allows referencing the component in commands, or inside a parent", + "type": "string" + }, "url": { "description": "Location in a plugin registry", "type": "string" } }, + "required": [ + "name" + ], "type": "object" }, "type": {