Documentation
¶
Index ¶
- Constants
- func GetContainerPortsFromStrings(ports []string) ([]corev1.ContainerPort, error)
- func InArray(arr []string, value string) bool
- func Merge(original []v1.EnvVar, other []v1.EnvVar) []v1.EnvVar
- func RemoveEnvVarsFromList(envVarList []v1.EnvVar, keys []string) ([]v1.EnvVar, error)
- type DevfileObj
- func (d DevfileObj) AddEnvVars(otherList []v1.EnvVar) error
- func (d DevfileObj) GetMemory() string
- func (d DevfileObj) GetMetadataName() string
- func (d DevfileObj) HasPorts() bool
- func (d DevfileObj) OverrideCommands(overridePatch []v1.CommandParentOverride) (err error)
- func (d DevfileObj) OverrideComponents(overridePatch []v1.ComponentParentOverride) error
- func (d DevfileObj) OverrideProjects(overridePatch []v1.ProjectParentOverride) error
- func (d DevfileObj) OverrideStarterProjects(overridePatch []v1.StarterProjectParentOverride) error
- func (d DevfileObj) RemoveEnvVars(keys []string) (err error)
- func (d DevfileObj) RemovePorts() error
- func (d DevfileObj) SetMemory(memory string) error
- func (d DevfileObj) SetMetadataName(name string) error
- func (d DevfileObj) SetPorts(ports ...string) error
- func (d *DevfileObj) WriteJsonDevfile() error
- func (d *DevfileObj) WriteYamlDevfile() error
Constants ¶
const ( Name = "Name" Ports = "Ports" Memory = "Memory" PortsDescription = "Ports to be opened in all component containers" MemoryDescription = "The Maximum memory all the component containers can consume" NameDescription = "The name of the component" )
const ( OutputDevfileJsonPath = "devfile.json" OutputDevfileYamlPath = "devfile.yaml" )
Default filenames for create devfile
Variables ¶
This section is empty.
Functions ¶
func GetContainerPortsFromStrings ¶
func GetContainerPortsFromStrings(ports []string) ([]corev1.ContainerPort, error)
GetContainerPortsFromStrings generates ContainerPort values from the array of string port values ports is the array containing the string port values
Types ¶
type DevfileObj ¶
type DevfileObj struct { // Ctx has devfile context info Ctx devfileCtx.DevfileCtx // Data has the devfile data Data data.DevfileData }
DevfileObj is the runtime devfile object
func Parse ¶
func Parse(path string) (d DevfileObj, err error)
Parse func populates the devfile data, parses and validates the devfile integrity. Creates devfile context and runtime objects
func ParseFromData ¶
func ParseFromData(data []byte) (d DevfileObj, err error)
ParseFromData func parses and validates the devfile integrity. Creates devfile context and runtime objects
func ParseFromURL ¶
func ParseFromURL(url string) (d DevfileObj, err error)
ParseFromURL func parses and validates the devfile integrity. Creates devfile context and runtime objects
func (DevfileObj) AddEnvVars ¶
func (d DevfileObj) AddEnvVars(otherList []v1.EnvVar) error
AddEnvVars adds environment variables to all the components in a devfile
func (DevfileObj) GetMemory ¶
func (d DevfileObj) GetMemory() string
GetMemory gets memoryLimit from devfile container
func (DevfileObj) GetMetadataName ¶
func (d DevfileObj) GetMetadataName() string
GetMetadataName gets metadata name from a devfile
func (DevfileObj) HasPorts ¶
func (d DevfileObj) HasPorts() bool
HasPorts checks if a devfile contains container endpoints
func (DevfileObj) OverrideCommands ¶
func (d DevfileObj) OverrideCommands(overridePatch []v1.CommandParentOverride) (err error)
OverrideCommands overrides the commands of the parent devfile overridePatch contains the patches to be applied to the parent's commands
func (DevfileObj) OverrideComponents ¶
func (d DevfileObj) OverrideComponents(overridePatch []v1.ComponentParentOverride) error
OverrideComponents overrides the components of the parent devfile overridePatch contains the patches to be applied to the parent's components
func (DevfileObj) OverrideProjects ¶
func (d DevfileObj) OverrideProjects(overridePatch []v1.ProjectParentOverride) error
OverrideProjects overrides the projects of the parent devfile overridePatch contains the patches to be applied to the parent's projects
func (DevfileObj) OverrideStarterProjects ¶
func (d DevfileObj) OverrideStarterProjects(overridePatch []v1.StarterProjectParentOverride) error
OverrideStarterProjects overrides the starter projects of the parent devfile overridePatch contains the patches to be applied to the parent's starter projects
func (DevfileObj) RemoveEnvVars ¶
func (d DevfileObj) RemoveEnvVars(keys []string) (err error)
RemoveEnvVars removes the environment variables which have the keys from all the components in a devfile
func (DevfileObj) RemovePorts ¶
func (d DevfileObj) RemovePorts() error
RemovePorts removes all container endpoints from a devfile
func (DevfileObj) SetMemory ¶
func (d DevfileObj) SetMemory(memory string) error
SetMemory sets memoryLimit in devfile container
func (DevfileObj) SetMetadataName ¶
func (d DevfileObj) SetMetadataName(name string) error
SetMetadataName set metadata name in a devfile
func (DevfileObj) SetPorts ¶
func (d DevfileObj) SetPorts(ports ...string) error
SetPorts converts ports to endpoints, adds to a devfile
func (*DevfileObj) WriteJsonDevfile ¶
func (d *DevfileObj) WriteJsonDevfile() error
WriteJsonDevfile creates a devfile.json file
func (*DevfileObj) WriteYamlDevfile ¶
func (d *DevfileObj) WriteYamlDevfile() error
WriteYamlDevfile creates a devfile.yaml file