From 5fc824e6fc06ff6328b0815d2f9a5cf9ad658750 Mon Sep 17 00:00:00 2001 From: Stephanie Date: Wed, 22 Sep 2021 15:18:28 -0400 Subject: [PATCH 1/2] add image component to helper function Signed-off-by: Stephanie --- pkg/devfile/parser/data/v2/common/component_helper.go | 2 ++ .../parser/data/v2/common/component_helper_test.go | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/pkg/devfile/parser/data/v2/common/component_helper.go b/pkg/devfile/parser/data/v2/common/component_helper.go index dede5428..1a5ba332 100644 --- a/pkg/devfile/parser/data/v2/common/component_helper.go +++ b/pkg/devfile/parser/data/v2/common/component_helper.go @@ -29,6 +29,8 @@ func GetComponentType(component v1.Component) (v1.ComponentType, error) { return v1.KubernetesComponentType, nil case component.Openshift != nil: return v1.OpenshiftComponentType, nil + case component.Image != nil: + return v1.ImageComponentType, nil case component.Custom != nil: return v1.CustomComponentType, nil 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 4607c70b..a2e7a0b3 100644 --- a/pkg/devfile/parser/data/v2/common/component_helper_test.go +++ b/pkg/devfile/parser/data/v2/common/component_helper_test.go @@ -150,6 +150,16 @@ func TestGetComponentType(t *testing.T) { }, componentType: v1.PluginComponentType, }, + { + name: "Image component", + component: v1.Component{ + Name: "name", + ComponentUnion: v1.ComponentUnion{ + Image: &v1.ImageComponent{}, + }, + }, + componentType: v1.ImageComponentType, + }, { name: "Custom component", component: v1.Component{ From 197718dd01d1d80d6d17e18969fadf005fde1549 Mon Sep 17 00:00:00 2001 From: Stephanie Date: Wed, 22 Sep 2021 17:33:21 -0400 Subject: [PATCH 2/2] remove json file name Signed-off-by: Stephanie --- pkg/devfile/parser/devfileobj.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/devfile/parser/devfileobj.go b/pkg/devfile/parser/devfileobj.go index f7ee33e9..65c669c8 100644 --- a/pkg/devfile/parser/devfileobj.go +++ b/pkg/devfile/parser/devfileobj.go @@ -7,7 +7,6 @@ import ( // Default filenames for create devfile const ( - OutputDevfileJsonPath = "devfile.json" OutputDevfileYamlPath = "devfile.yaml" )