const ( NotAvailable = "Not available" UnknownValue = "Unknown" )
const ShellExecutable string = "/bin/sh"
func ApplyKubernetes( mode string, appName string, componentName string, devfile parser.DevfileObj, kubernetes devfilev1.Component, kubeClient kclient.ClientInterface, path string, ) error
ApplyKubernetes contains the logic to create the k8s resources defined by the `apply` command mode(Dev, Deploy): the mode in which the resources are deployed appName: application name devfile: the devfile object kubernetes: the kubernetes devfile component to be deployed kubeClient: Kubernetes client to be used to deploy the resource path: path to the context directory
func Contains(component api.ComponentAbstract, components []api.ComponentAbstract) bool
Contains checks to see if the component exists in an array or not by checking the name
func ExecuteInNewContainer( ctx context.Context, kubeClient kclient.ClientInterface, configAutomountClient configAutomount.Client, devfileObj parser.DevfileObj, componentName string, appName string, command v1alpha2.Command, ) error
func ExecuteRunCommand(ctx context.Context, execClient exec.Client, platformClient platform.Client, devfileCmd devfilev1.Command, componentExists bool, podName string, appName string, componentName string) error
ExecuteRunCommand executes a Devfile command in the specified pod If componentExists, the previous instance of the command will be stopped before (if hotReloadCapable is not set)
func ExecuteTerminatingCommand( ctx context.Context, execClient exec.Client, platformClient platform.Client, command devfilev1.Command, componentExists bool, podName string, appName string, componentName string, msg string, directRun bool, ) error
func GatherName(contextDir string, devfileObj *parser.DevfileObj) (string, error)
GatherName computes and returns what should be used as name for the Devfile object specified.
If a non-blank name is available in the Devfile metadata (which is optional), it is sanitized and returned.
Otherwise, it uses Alizer to detect the name, from the project build tools (pom.xml, package.json, ...), or from the component directory name.
func GetComponentRuntimeFromDevfileMetadata(metadata devfile.DevfileMetadata) string
GetComponentRuntimeFromDevfileMetadata returns the Project Type defined in the Devfile metadata or if not set, the Language
func GetComponentTypeFromDevfileMetadata(metadata devfile.DevfileMetadata) string
GetComponentTypeFromDevfileMetadata returns component type from the devfile metadata; it could either be projectType or language, if neither of them are set, return 'Not available'
func GetContainersNames(pod *corev1.Pod) []string
func GetDevfileInfo(ctx context.Context, kubeClient kclient.ClientInterface, podmanClient podman.Client, name string) (parser.DevfileObj, error)
GetDevfileInfo extracts information from the labels and annotations of resources to rebuild a Devfile
func GetRunningModes(ctx context.Context, kubeClient kclient.ClientInterface, podmanClient podman.Client, name string) (map[platform.Client]api.RunningModes, error)
GetRunningModes returns the list of modes on which a "name" component is deployed, by looking into namespace the resources deployed with matching labels, based on the "odo.dev/mode" label
func ListAllClusterComponents(client kclient.ClientInterface, namespace string) ([]api.ComponentAbstract, error)
ListAllClusterComponents returns a list of all "components" on a cluster that are both odo and non-odo components.
We then return a list of "components" intended for listing / output purposes specifically for commands such as: `odo list` that are both odo and non-odo components.
func ListAllComponents(client kclient.ClientInterface, podmanClient podman.Client, namespace string, devObj *parser.DevfileObj, componentName string) ([]api.ComponentAbstract, string, error)
func ListRoutesAndIngresses(client kclient.ClientInterface, componentName, appName string) (ings []api.ConnectionData, routes []api.ConnectionData, err error)
ListRoutesAndIngresses lists routes and ingresses created by a component; it only returns the resources created with Deploy mode; it fetches resources from the cluster that match label and return.
func Log(platformClient platform.Client, componentName string, appName string, follow bool, command v1alpha2.Command) (io.ReadCloser, error)
Log returns log from component
func NewRunHandler( ctx context.Context, platformClient platform.Client, execClient exec.Client, configAutomountClient configAutomount.Client, fs filesystem.Filesystem, imageBackend image.Backend, options HandlerOptions, ) *runHandler
func ValidateResourcesExist(client kclient.ClientInterface, devfileObj parser.DevfileObj, k8sComponents []devfile.Component, context string) error
ValidateResourcesExist validates if the Kubernetes inlined components are installed on the cluster
func ValidateResourcesExistInK8sComponent(client kclient.ClientInterface, devfileObj parser.DevfileObj, k8sComponent devfile.Component, context string) (kindErr string, err error)
ValidateResourcesExistInK8sComponent validates if resources defined inside a Kubernetes inlined component are installed on the cluster
type HandlerOptions struct { PodName string ComponentExists bool ContainersRunning []string Msg string DirectRun bool // For apply Kubernetes / Openshift Devfile parser.DevfileObj Path string }
NoComponentFoundError is returned when no component of the specified name was found.
type NoComponentFoundError struct {
// contains filtered or unexported fields
}
func NewNoComponentFoundError(name string, namespace string) NoComponentFoundError
func (e NoComponentFoundError) Error() string
PushedComponent is an abstraction over the cluster representation of the component
type PushedComponent interface { GetApplication() string GetType() (string, error) GetStorage() ([]storage.Storage, error) // contains filtered or unexported methods }
SecretMount describes a Secret mount (either as environment variables with envFrom or as a volume)
type SecretMount struct { ServiceName string SecretName string MountVolume bool MountPath string }