generator

package
v1.0.0-alpha.0...-0be9a8d Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DevfileSourceVolumeMount is the default directory to mount the volume in the container
	DevfileSourceVolumeMount = "/projects"

	// EnvProjectsRoot is the env defined for project mount in a component container when component's mountSources=true
	EnvProjectsRoot = "PROJECTS_ROOT"

	// EnvProjectsSrc is the env defined for path to the project source in a component container
	EnvProjectsSrc = "PROJECT_SOURCE"
)

Variables

This section is empty.

Functions

func GetBuildConfig

func GetBuildConfig(buildConfigParams BuildConfigParams) *buildv1.BuildConfig

GetBuildConfig gets a build config

func GetContainers

func GetContainers(devfileObj parser.DevfileObj, options common.DevfileOptions) ([]corev1.Container, error)

GetContainers iterates through the devfile components and returns a slice of the corresponding containers

func GetDeployment

func GetDeployment(deployParams DeploymentParams) *appsv1.Deployment

GetDeployment gets a deployment object

func GetDockerBuildStrategy

func GetDockerBuildStrategy(dockerfilePath string, env []corev1.EnvVar) buildv1.BuildStrategy

GetDockerBuildStrategy gets the docker build strategy

func GetImageStream

func GetImageStream(imageStreamParams ImageStreamParams) imagev1.ImageStream

GetImageStream is a function to return the image stream

func GetIngress

func GetIngress(ingressParams IngressParams) *extensionsv1.Ingress

GetIngress gets an ingress

func GetObjectMeta

func GetObjectMeta(name, namespace string, labels, annotations map[string]string) metav1.ObjectMeta

GetObjectMeta gets an object meta with the parameters

func GetOwnerReference

func GetOwnerReference(deployment *appsv1.Deployment) metav1.OwnerReference

GetOwnerReference generates an ownerReference from the deployment which can then be set as owner for various Kubernetes objects and ensure that when the owner object is deleted from the cluster, all other objects are automatically removed by Kubernetes garbage collector

func GetPVC

func GetPVC(pvcParams PVCParams) *corev1.PersistentVolumeClaim

GetPVC returns a PVC

func GetRoute

func GetRoute(routeParams RouteParams) *routev1.Route

GetRoute gets a route

func GetService

func GetService(devfileObj parser.DevfileObj, serviceParams ServiceParams, options common.DevfileOptions) (*corev1.Service, error)

GetService gets the service

func GetSourceBuildStrategy

func GetSourceBuildStrategy(imageName, imageNamespace string) buildv1.BuildStrategy

GetSourceBuildStrategy gets the source build strategy

func GetTypeMeta

func GetTypeMeta(kind string, APIVersion string) metav1.TypeMeta

GetTypeMeta gets a type meta of the specified kind and version

func GetVolumeMountPath

func GetVolumeMountPath(volumeMount v1.VolumeMount) string

GetVolumeMountPath gets the volume mount's path.

func GetVolumesAndVolumeMounts

func GetVolumesAndVolumeMounts(devfileObj parser.DevfileObj, volumeParams VolumeParams, options common.DevfileOptions) ([]corev1.Volume, error)

GetVolumesAndVolumeMounts gets the PVC volumes and updates the containers with the volume mounts.

Types

type BuildConfigParams

type BuildConfigParams struct {
	TypeMeta              metav1.TypeMeta
	ObjectMeta            metav1.ObjectMeta
	BuildConfigSpecParams BuildConfigSpecParams
}

BuildConfigParams is a struct that contains the required data to create a build config object

type BuildConfigSpecParams

type BuildConfigSpecParams struct {
	ImageStreamTagName string
	GitURL             string
	GitRef             string
	ContextDir         string
	BuildStrategy      buildv1.BuildStrategy
}

BuildConfigSpecParams is a struct to create build config spec

type DeploymentParams

type DeploymentParams struct {
	TypeMeta          metav1.TypeMeta
	ObjectMeta        metav1.ObjectMeta
	InitContainers    []corev1.Container
	Containers        []corev1.Container
	Volumes           []corev1.Volume
	PodSelectorLabels map[string]string
}

DeploymentParams is a struct that contains the required data to create a deployment object

type ImageStreamParams

type ImageStreamParams struct {
	TypeMeta   metav1.TypeMeta
	ObjectMeta metav1.ObjectMeta
}

ImageStreamParams is a struct that contains the required data to create an image stream object

type IngressParams

type IngressParams struct {
	TypeMeta          metav1.TypeMeta
	ObjectMeta        metav1.ObjectMeta
	IngressSpecParams IngressSpecParams
}

IngressParams is a struct that contains the required data to create an ingress object

type IngressSpecParams

type IngressSpecParams struct {
	ServiceName   string
	IngressDomain string
	PortNumber    intstr.IntOrString
	TLSSecretName string
	Path          string
}

IngressSpecParams struct for function GenerateIngressSpec serviceName is the name of the service for the target reference ingressDomain is the ingress domain to use for the ingress portNumber is the target port of the ingress Path is the path of the ingress TLSSecretName is the target TLS Secret name of the ingress

type PVCParams

type PVCParams struct {
	TypeMeta   metav1.TypeMeta
	ObjectMeta metav1.ObjectMeta
	Quantity   resource.Quantity
}

PVCParams is a struct to create PVC

type RouteParams

type RouteParams struct {
	TypeMeta        metav1.TypeMeta
	ObjectMeta      metav1.ObjectMeta
	RouteSpecParams RouteSpecParams
}

RouteParams is a struct that contains the required data to create a route object

type RouteSpecParams

type RouteSpecParams struct {
	ServiceName string
	PortNumber  intstr.IntOrString
	Path        string
	Secure      bool
}

RouteSpecParams struct for function GenerateRouteSpec serviceName is the name of the service for the target reference portNumber is the target port of the ingress Path is the path of the route

type ServiceParams

type ServiceParams struct {
	TypeMeta       metav1.TypeMeta
	ObjectMeta     metav1.ObjectMeta
	SelectorLabels map[string]string
}

ServiceParams is a struct that contains the required data to create a service object

type VolumeInfo

type VolumeInfo struct {
	PVCName    string
	VolumeName string
}

VolumeInfo is a struct to hold the pvc name and the volume name to create a volume.

type VolumeParams

type VolumeParams struct {
	// Containers is a list of containers that needs to be updated for the volume mounts
	Containers []corev1.Container

	// VolumeNameToVolumeInfo is a map of the devfile volume name to the volume info containing the pvc name and the volume name.
	VolumeNameToVolumeInfo map[string]VolumeInfo
}

VolumeParams is a struct that contains the required data to create Kubernetes Volumes and mount Volumes in Containers

Jump to

Keyboard shortcuts

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