v2

package
v2.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DevfileV2

type DevfileV2 struct {
	v1.Devfile
}

DevfileV2 is the devfile go struct from devfile/api

func (*DevfileV2) AddAttributes

func (d *DevfileV2) AddAttributes(key string, value interface{}) error

AddAttributes adds to the devfile top level attributes, value will be overwritten if key is already present

func (*DevfileV2) AddCommands

func (d *DevfileV2) AddCommands(commands []v1.Command) error

AddCommands adds the slice of Command objects to the Devfile's commands a command is considered as invalid if it is already defined command list passed in will be all processed, and returns a total error of all invalid commands

func (*DevfileV2) AddComponents

func (d *DevfileV2) AddComponents(components []v1.Component) error

AddComponents adds the slice of Component objects to the devfile's components a component is considered as invalid if it is already defined component list passed in will be all processed, and returns a total error of all invalid components

func (*DevfileV2) AddEnvVars

func (d *DevfileV2) AddEnvVars(containerEnvMap map[string][]v1alpha2.EnvVar) error

AddEnvVars accepts a map of container name mapped to an array of the env vars to be set; it adds the envirnoment variables to a given container name of the DevfileV2 object Example of containerEnvMap : {"runtime": {{Name: "Foo", Value: "Bar"}}}

func (*DevfileV2) AddEvents

func (d *DevfileV2) AddEvents(events v1.Events) error

AddEvents adds the Events Object to the devfile's events an event field is considered as invalid if it is already defined all event fields will be checked and processed, and returns a total error of all event fields

func (*DevfileV2) AddProjects

func (d *DevfileV2) AddProjects(projects []v1.Project) error

AddProjects adss the slice of Devfile projects to the Devfile's project list a project is considered as invalid if it is already defined project list passed in will be all processed, and returns a total error of all invalid projects

func (*DevfileV2) AddStarterProjects

func (d *DevfileV2) AddStarterProjects(projects []v1.StarterProject) error

AddStarterProjects adds the slice of Devfile starter projects to the Devfile's starter project list a starterProject is considered as invalid if it is already defined starterProject list passed in will be all processed, and returns a total error of all invalid starterProjects

func (*DevfileV2) AddVolumeMounts

func (d *DevfileV2) AddVolumeMounts(containerName string, volumeMounts []v1.VolumeMount) error

AddVolumeMounts adds the volume mounts to the specified container component

func (*DevfileV2) DeleteCommand

func (d *DevfileV2) DeleteCommand(id string) error

DeleteCommand removes the specified command

func (*DevfileV2) DeleteComponent

func (d *DevfileV2) DeleteComponent(name string) error

DeleteComponent removes the specified component

func (*DevfileV2) DeleteProject

func (d *DevfileV2) DeleteProject(name string) error

DeleteProject removes the specified project

func (*DevfileV2) DeleteStarterProject

func (d *DevfileV2) DeleteStarterProject(name string) error

DeleteStarterProject removes the specified starter project

func (*DevfileV2) DeleteVolumeMount

func (d *DevfileV2) DeleteVolumeMount(name string) error

DeleteVolumeMount deletes the volume mount from container components

func (*DevfileV2) GetAttributes

func (d *DevfileV2) GetAttributes() (attributes.Attributes, error)

GetAttributes gets the devfile top level attributes

func (*DevfileV2) GetCommands

func (d *DevfileV2) GetCommands(options common.DevfileOptions) ([]v1.Command, error)

GetCommands returns the slice of Command objects parsed from the Devfile

func (*DevfileV2) GetComponents

func (d *DevfileV2) GetComponents(options common.DevfileOptions) ([]v1.Component, error)

GetComponents returns the slice of Component objects parsed from the Devfile

func (*DevfileV2) GetDevfileContainerComponents

func (d *DevfileV2) GetDevfileContainerComponents(options common.DevfileOptions) ([]v1.Component, error)

GetDevfileContainerComponents iterates through the components in the devfile and returns a list of devfile container components. Deprecated, use GetComponents() with the DevfileOptions.

func (*DevfileV2) GetDevfileVolumeComponents

func (d *DevfileV2) GetDevfileVolumeComponents(options common.DevfileOptions) ([]v1.Component, error)

GetDevfileVolumeComponents iterates through the components in the devfile and returns a list of devfile volume components. Deprecated, use GetComponents() with the DevfileOptions.

func (*DevfileV2) GetDevfileWorkspaceSpec

func (d *DevfileV2) GetDevfileWorkspaceSpec() *v1.DevWorkspaceTemplateSpec

func (*DevfileV2) GetDevfileWorkspaceSpecContent

func (d *DevfileV2) GetDevfileWorkspaceSpecContent() *v1.DevWorkspaceTemplateSpecContent

GetDevfileWorkspaceSpecContent returns the workspace spec content for the devfile

func (*DevfileV2) GetEvents

func (d *DevfileV2) GetEvents() v1.Events

GetEvents returns the Events Object parsed from devfile

func (*DevfileV2) GetMetadata

func (d *DevfileV2) GetMetadata() devfilepkg.DevfileMetadata

GetMetadata returns the DevfileMetadata Object parsed from devfile

func (*DevfileV2) GetParent

func (d *DevfileV2) GetParent() *v1.Parent

GetParent returns the Parent object parsed from devfile

func (*DevfileV2) GetProjects

func (d *DevfileV2) GetProjects(options common.DevfileOptions) ([]v1.Project, error)

GetProjects returns the Project Object parsed from devfile

func (*DevfileV2) GetSchemaVersion

func (d *DevfileV2) GetSchemaVersion() string

GetSchemaVersion gets devfile schema version

func (*DevfileV2) GetStarterProjects

func (d *DevfileV2) GetStarterProjects(options common.DevfileOptions) ([]v1.StarterProject, error)

GetStarterProjects returns the DevfileStarterProject parsed from devfile

func (*DevfileV2) GetVolumeMountPaths

func (d *DevfileV2) GetVolumeMountPaths(mountName, containerName string) ([]string, error)

GetVolumeMountPaths gets all the mount paths of the specified volume mount from the specified container component. A container can mount at different paths for a given volume.

func (*DevfileV2) RemoveEnvVars

func (d *DevfileV2) RemoveEnvVars(containerEnvMap map[string][]string) error

RemoveEnvVars accepts a map of container name mapped to an array of environment variables to be removed; it removes the env vars from the specified container name of the DevfileV2 object

func (*DevfileV2) RemovePorts

func (d *DevfileV2) RemovePorts(containerPortsMap map[string][]string) error

RemovePorts accepts a map of container name mapped to an array of port numbers to be removed; it removes the container endpoints with the specified port numbers of the specified container of the DevfileV2 object Example of containerPortsMap: {"runtime": {"8080", "9000"}, "wildfly": {"12956"}}

func (*DevfileV2) SetDevfileWorkspaceSpec

func (d *DevfileV2) SetDevfileWorkspaceSpec(spec v1.DevWorkspaceTemplateSpec)

SetDevfileWorkspaceSpec sets the workspace spec

func (*DevfileV2) SetDevfileWorkspaceSpecContent

func (d *DevfileV2) SetDevfileWorkspaceSpecContent(content v1.DevWorkspaceTemplateSpecContent)

SetDevfileWorkspaceSpecContent sets the workspace spec content

func (*DevfileV2) SetMetadata

func (d *DevfileV2) SetMetadata(metadata devfilepkg.DevfileMetadata)

SetMetadata sets the metadata for devfile

func (*DevfileV2) SetParent

func (d *DevfileV2) SetParent(parent *v1.Parent)

SetParent sets the parent for the devfile

func (*DevfileV2) SetPorts

func (d *DevfileV2) SetPorts(containerPortsMap map[string][]string) error

SetPorts accepts a map of container name mapped to an array of port numbers to be set; it converts ports to endpoints, sets the endpoint to a given container name of the DevfileV2 object Example of containerPortsMap: {"runtime": {"8080", "9000"}, "wildfly": {"12956"}}

func (*DevfileV2) SetSchemaVersion

func (d *DevfileV2) SetSchemaVersion(version string)

SetSchemaVersion sets devfile schema version

func (*DevfileV2) UpdateAttributes

func (d *DevfileV2) UpdateAttributes(key string, value interface{}) error

UpdateAttributes updates the devfile top level attribute for the specific key, err out if key is absent

func (*DevfileV2) UpdateCommand

func (d *DevfileV2) UpdateCommand(command v1.Command) error

UpdateCommand updates the command with the given id return an error if the command is not found

func (*DevfileV2) UpdateComponent

func (d *DevfileV2) UpdateComponent(component v1.Component) error

UpdateComponent updates the component with the given name return an error if the component is not found

func (*DevfileV2) UpdateEvents

func (d *DevfileV2) UpdateEvents(postStart, postStop, preStart, preStop []string)

UpdateEvents updates the devfile's events it only updates the events passed to it

func (*DevfileV2) UpdateProject

func (d *DevfileV2) UpdateProject(project v1.Project) error

UpdateProject updates the slice of Devfile projects parsed from the Devfile return an error if the project is not found

func (*DevfileV2) UpdateStarterProject

func (d *DevfileV2) UpdateStarterProject(project v1.StarterProject) error

UpdateStarterProject updates the slice of Devfile starter projects parsed from the Devfile

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL