Skip to content

Commit

Permalink
Add Component api kind
Browse files Browse the repository at this point in the history
  • Loading branch information
feloy committed Apr 13, 2022
1 parent 40486eb commit 482b02d
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
24 changes: 24 additions & 0 deletions pkg/api/component.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package api

type RunningMode string

const (
RunninModeDev = "Dev"
RunninModeDeploy = "Deploy"
RunninModeUnknown = "Unknown"
)

// Component describes the state of a devfile component
type Component struct {
DevfilePath string `json:"devfilePath"`
DevfileData DevfileData `json:"devfileData"`
ForwardedPorts []ForwardedPort `json:"forwardedPorts"`
RunningIn []RunningMode `json:"runningIn"`
ManagedBy string `json:"managedBy"`
}

type ForwardedPort struct {
ContainerName string `json:"containerName"`
LocalPort int `json:"localPort"`
ContainerPort int `json:"containerPort"`
}
16 changes: 16 additions & 0 deletions pkg/api/devfile-data.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package api

import "github.com/devfile/library/pkg/devfile/parser/data"

// DevfileData describes a devfile content
type DevfileData struct {
Devfile data.DevfileData
SupportedOdoFeatures SupportedOdoFeatures
}

// SupportedOdoFeatures indicates the support of high-level (odo) features by a devfile component
type SupportedOdoFeatures struct {
Dev bool
Deploy bool
Debug bool
}

0 comments on commit 482b02d

Please sign in to comment.