types

package
v0.2.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildConfig

type BuildConfig struct {
	RepoInfo          plantypes.RepoInfo
	Name              string
	ImageStreamName   string
	ImageStreamTag    string
	SourceSecretName  string
	WebhookSecretName string
}

BuildConfig contains the resources needed to create a BuildConfig

type Container

type Container struct {
	ContainerBuildType plantypes.ContainerBuildTypeValue // Method to use to build the image or "Reuse" if reusing an existing image.
	RepoInfo           plantypes.RepoInfo
	ImageNames         []string
	New                bool              // true if this is a new image that needs to be built
	NewFiles           map[string]string //[filename][filecontents] This contains the build scripts, new Dockerfiles, etc.
	ExposedPorts       []int
	UserID             int
	AccessedDirs       []string
}

Container defines images that need to be built or reused.

func NewContainer

func NewContainer(containerBuildType plantypes.ContainerBuildTypeValue, imagename string, new bool) Container

NewContainer creates a new container

func NewContainerFromImageInfo

func NewContainerFromImageInfo(i collecttypes.ImageInfo) Container

NewContainerFromImageInfo creates a new container from image info

func (*Container) AddAccessedDirs

func (c *Container) AddAccessedDirs(dirname string)

AddAccessedDirs adds accessed directories to container

func (*Container) AddExposedPort

func (c *Container) AddExposedPort(port int)

AddExposedPort adds an exposed port to a container

func (*Container) AddFile

func (c *Container) AddFile(path string, newcontents string)

AddFile adds a file to a container

func (*Container) AddImageName

func (c *Container) AddImageName(imagename string)

AddImageName adds image name to a container

func (*Container) Merge

func (c *Container) Merge(newc Container) bool

Merge merges containers

type EnhancedIR

type EnhancedIR struct {
	IR
	Roles           []Role
	RoleBindings    []RoleBinding
	ServiceAccounts []ServiceAccount
	BuildConfigs    []BuildConfig
	TektonResources tekton.Resources
}

EnhancedIR is IR with extra data specific to API resource sets

func NewEnhancedIRFromIR

func NewEnhancedIRFromIR(ir IR) EnhancedIR

NewEnhancedIRFromIR returns a new EnhancedIR given an IR It makes a deep copy of the IR before embedding it in the EnhancedIR.

type IR

type IR struct {
	RootDir    string
	Name       string
	Containers []Container // Images to be built
	Services   map[string]Service
	Storages   []Storage

	Kubernetes plan.KubernetesOutput

	TargetClusterSpec collecttypes.ClusterMetadataSpec
	CachedObjects     []runtime.Object

	Values outputtypes.HelmValues

	IngressTLSSecretName string
}

IR is the intermediate representation filled by source translators

func NewIR

func NewIR(p plan.Plan) IR

NewIR creates a new IR

func (*IR) AddContainer

func (ir *IR) AddContainer(container Container)

AddContainer adds a conatainer to IR

func (*IR) AddStorage

func (ir *IR) AddStorage(st Storage)

AddStorage adds a storage to IR

func (*IR) GetContainer

func (ir *IR) GetContainer(imagename string) (con Container, exists bool)

GetContainer returns container which has the imagename

func (*IR) GetFullImageName

func (ir *IR) GetFullImageName(imageName string) string

GetFullImageName returns the full image name including registry url and namespace

func (*IR) IsIngressTLSEnabled

func (ir *IR) IsIngressTLSEnabled() bool

IsIngressTLSEnabled checks if TLS is enabled for the ingress.

func (*IR) Merge

func (ir *IR) Merge(newir IR)

Merge merges IRs

type PolicyRule

type PolicyRule struct {
	APIGroups []string
	Resources []string
	Verbs     []string
}

PolicyRule holds the details about the policy rules for the service account resources

type Port

Port is a port number with an optional port name.

type Role

type Role struct {
	Name        string
	PolicyRules []PolicyRule
}

Role holds the details about the role resource

type RoleBinding

type RoleBinding struct {
	Name               string
	RoleName           string
	ServiceAccountName string
}

RoleBinding holds the details about the role binding resource

type Service

type Service struct {
	core.PodSpec

	Name                        string
	BackendServiceName          string // Optional field when ingress name is not the same as backend service name
	Annotations                 map[string]string
	Labels                      map[string]string
	ServiceToPodPortForwardings []ServiceToPodPortForwarding
	Replicas                    int
	Networks                    []string
	ServiceRelPath              string //Ingress fan-out path
	OnlyIngress                 bool
	Daemon                      bool //Gets converted to DaemonSet
}

Service defines structure of an IR service

func NewServiceFromPlanService

func NewServiceFromPlanService(service plantypes.Service) Service

NewServiceFromPlanService initializes a service with just the plan object parameters.

func NewServiceWithName

func NewServiceWithName(serviceName string) Service

NewServiceWithName initializes a service with just the name.

func (*Service) AddPortForwarding

func (service *Service) AddPortForwarding(servicePort Port, podPort Port) error

AddPortForwarding adds a new port forwarding to the service.

func (*Service) AddVolume

func (service *Service) AddVolume(volume core.Volume)

AddVolume adds a volume to a service

func (*Service) HasValidAnnotation

func (service *Service) HasValidAnnotation(annotation string) bool

HasValidAnnotation returns if an annotation is set for the service

type ServiceAccount

type ServiceAccount struct {
	Name        string
	SecretNames []string
}

ServiceAccount holds the details about the service account resource

type ServiceToPodPortForwarding

type ServiceToPodPortForwarding struct {
	ServicePort Port
	PodPort     Port
}

ServiceToPodPortForwarding forwards a k8s service port to a k8s pod port

type Storage

type Storage struct {
	Name                           string
	Annotations                    map[string]string // Optional field to store arbitrary metadata
	core.PersistentVolumeClaimSpec                   //This promotion contains the volumeName which is used by configmap, secrets and pvc.
	StorageType                    StorageKindType   //Type of storage cfgmap, secret, pvc
	SecretType                     core.SecretType   // Optional field to store the type of secret data
	Content                        map[string][]byte //Optional field meant to store content for cfgmap or secret
}

Storage defines structure of a storage

func (*Storage) Merge

func (s *Storage) Merge(newst Storage) bool

Merge merges storage

type StorageKindType

type StorageKindType string

StorageKindType defines storage type kind

const (
	// SecretKind defines storage type of Secret
	SecretKind StorageKindType = "Secret"
	// ConfigMapKind defines storage type of ConfigMap
	ConfigMapKind StorageKindType = "ConfigMap"
	// PVCKind defines storage type of PersistentVolumeClaim
	PVCKind StorageKindType = "PersistentVolumeClaim"
	// PullSecretKind defines storage type of pull secret
	PullSecretKind StorageKindType = "PullSecret"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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