Files
odo/pkg/api/component.go
Philippe Martin 9605c92ede Remove API Server from experimental mode, set UI Server as experimental (#6985)
* Remove API Server from experimental mode, set UI Server as experimental

* Adapt api-server integration tests

* Disable --api-server by default in the tests

They are enabled only if `options.StartAPIServer`
is explicitly enabled.
This is to avoid potential port conflicting issue,
especially on Windows - see [1]

[1] https://github.com/redhat-developer/odo/issues/6939

* Error out if `--api-server-port` is set but `--api-server` is false

---------

Co-authored-by: Armel Soro <asoro@redhat.com>
2023-07-21 12:11:08 +02:00

57 lines
2.0 KiB
Go

package api
// Component describes the state of a devfile component
type Component struct {
DevfilePath string `json:"devfilePath,omitempty"`
DevfileData *DevfileData `json:"devfileData,omitempty"`
DevControlPlane []DevControlPlane `json:"devControlPlane,omitempty"`
DevForwardedPorts []ForwardedPort `json:"devForwardedPorts,omitempty"`
// RunningIn is the overall running mode map of the component;
// this is computing as a merge of RunningOn (all the different running modes
// for each platform the component is running on).
RunningIn RunningModes `json:"runningIn"`
// RunningOn represents the map of running modes for each platform the component is running on.
// The key is the platform, either cluster or podman.
RunningOn map[string]RunningModes `json:"runningOn,omitempty"`
Ingresses []ConnectionData `json:"ingresses,omitempty"`
Routes []ConnectionData `json:"routes,omitempty"`
ManagedBy string `json:"managedBy"`
}
type ForwardedPort struct {
Platform string `json:"platform,omitempty"`
ContainerName string `json:"containerName"`
PortName string `json:"portName"`
IsDebug bool `json:"isDebug"`
LocalAddress string `json:"localAddress"`
LocalPort int `json:"localPort"`
ContainerPort int `json:"containerPort"`
Exposure string `json:"exposure,omitempty"`
Protocol string `json:"protocol,omitempty"`
}
func (o ForwardedPort) GetPlatform() string {
return o.Platform
}
type DevControlPlane struct {
Platform string `json:"platform,omitempty"`
LocalPort int `json:"localPort"`
APIServerPath string `json:"apiServerPath"`
WebInterfacePath string `json:"webInterfacePath,omitempty"`
}
func (o DevControlPlane) GetPlatform() string {
return o.Platform
}
type ConnectionData struct {
Name string `json:"name"`
Rules []Rules `json:"rules,omitempty"`
}
type Rules struct {
Host string `json:"host"`
Paths []string `json:"paths"`
}