Skip to content

Commit

Permalink
Merge pull request #118 from yangcao77/626-adopt-outerLoop
Browse files Browse the repository at this point in the history
update library for image component type
  • Loading branch information
yangcao77 authored Sep 23, 2021
2 parents b7c2cb5 + 197718d commit f858c8e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkg/devfile/parser/data/v2/common/component_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 10 additions & 0 deletions pkg/devfile/parser/data/v2/common/component_helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
1 change: 0 additions & 1 deletion pkg/devfile/parser/devfileobj.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (

// Default filenames for create devfile
const (
OutputDevfileJsonPath = "devfile.json"
OutputDevfileYamlPath = "devfile.yaml"
)

Expand Down

0 comments on commit f858c8e

Please sign in to comment.