Documentation
¶
Index ¶
- Constants
- type Application
- type ArgoCDResources
- type BuildConfig
- type ContainerBuild
- type ContainerBuildArtifactTypeValue
- type ContainerBuildTypeValue
- type ContainerImage
- type DeploymentType
- type EnhancedIR
- type EventListener
- type IR
- type Pipeline
- type PodSpec
- type PolicyRule
- type Role
- type RoleBinding
- type Service
- type ServiceAccount
- type ServiceToPodPortForwarding
- type Storage
- type StorageKindType
- type TektonResources
- type TriggerBinding
- type TriggerTemplate
Constants ¶
const IRArtifactType transformertypes.ArtifactType = "IR"
IRArtifactType represents artifact type of IR
const IRConfigType transformertypes.ConfigType = "IR"
IRConfigType represents config type of IR
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶ added in v0.3.3
type Application struct {
Name string
RepoURL string
RepoPath string
RepoRef string
ClusterServer string
DestNamespace string
}
Application holds the data for an ArgoCD application.
type ArgoCDResources ¶ added in v0.3.3
type ArgoCDResources struct {
Applications []Application
}
ArgoCDResources holds all the ArgoCD specific resources.
type BuildConfig ¶
type BuildConfig struct {
Name string
ImageStreamName string
ImageStreamTag string
SourceSecretName string
WebhookSecretName string
ContainerBuild ContainerBuild
}
BuildConfig contains the resources needed to create a BuildConfig
type ContainerBuild ¶
type ContainerBuild struct {
ContainerBuildType ContainerBuildTypeValue `yaml:"-"`
ContextPath string `yaml:"-"`
Artifacts map[ContainerBuildArtifactTypeValue][]string `yaml:"-"` //[artifacttype]value
}
ContainerBuild stores information about the container build
func (*ContainerBuild) Merge ¶
func (c *ContainerBuild) Merge(newc ContainerBuild) bool
Merge merges two container build structs
type ContainerBuildArtifactTypeValue ¶
type ContainerBuildArtifactTypeValue string
ContainerBuildArtifactTypeValue stores the container build artifact type
const ( // DockerfileContainerBuildArtifactTypeValue represents dockerfile container build type artifact DockerfileContainerBuildArtifactTypeValue ContainerBuildArtifactTypeValue = "Dockerfile" // RelDockerfileContainerBuildArtifactTypeValue represents dockerfile container build type artifact RelDockerfileContainerBuildArtifactTypeValue ContainerBuildArtifactTypeValue = "RelDockerfilePath" // RelDockerfileContextContainerBuildArtifactTypeValue represents dockerfile container build type artifact RelDockerfileContextContainerBuildArtifactTypeValue ContainerBuildArtifactTypeValue = "RelDockerfileContextPath" )
type ContainerBuildTypeValue ¶
type ContainerBuildTypeValue string
ContainerBuildTypeValue stores the container build type
const ( // DockerfileContainerBuildType represents dockerfile container build type DockerfileContainerBuildType ContainerBuildTypeValue = "Dockerfile" // S2IContainerBuildTypeValue represents s2i container build type S2IContainerBuildTypeValue ContainerBuildTypeValue = "S2I" // CNBContainerBuildTypeValue represents CNB container build type CNBContainerBuildTypeValue ContainerBuildTypeValue = "CNB" )
type ContainerImage ¶
type ContainerImage struct {
ExposedPorts []int32 `yaml:"ports"`
UserID int `yaml:"userID"`
AccessedDirs []string `yaml:"accessedDirs"`
Build ContainerBuild
}
ContainerImage defines images that need to be built or reused.
func (*ContainerImage) AddAccessedDirs ¶
func (c *ContainerImage) AddAccessedDirs(dirname string)
AddAccessedDirs adds accessed directories to container
func (*ContainerImage) AddExposedPort ¶
func (c *ContainerImage) AddExposedPort(port int32)
AddExposedPort adds an exposed port to a container
func (*ContainerImage) Merge ¶
func (c *ContainerImage) Merge(newc ContainerImage) bool
Merge merges containers
type DeploymentType ¶ added in v0.3.12
type DeploymentType string
DeploymentType represents the type of deployment artifact generated by Move2Kube
const ( // DeploymentTypeDeployment represents a Kubernetes Deployment DeploymentTypeDeployment DeploymentType = "Deployment" // DeploymentTypeStatefulSet represents a Kubernetes StatefulSet DeploymentTypeStatefulSet DeploymentType = "StatefulSet" // DeploymentTypeArgoRollout represents an Argo CD Rollout DeploymentTypeArgoRollout DeploymentType = "ArgoRollout" )
type EnhancedIR ¶
type EnhancedIR struct {
IR
Roles []Role
RoleBindings []RoleBinding
ServiceAccounts []ServiceAccount
BuildConfigs []BuildConfig
TektonResources TektonResources
ArgoCDResources ArgoCDResources
}
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 EventListener ¶
type EventListener struct {
Name string
ServiceAccountName string
TriggerBindingName string
TriggerTemplateName string
}
EventListener holds the details about the git event listener resource
type IR ¶
type IR struct {
Name string
ContainerImages map[string]ContainerImage // [imageName]
Services map[string]Service
Storages []Storage
}
IR is the intermediate representation filled by source transformers
func (*IR) AddContainer ¶
func (ir *IR) AddContainer(imageName string, container ContainerImage)
AddContainer adds a conatainer to IR
func (*IR) AddService ¶
AddService adds a service to the IR if it does not already exist. Else it merges with existing service.
func (*IR) GetAllServicePorts ¶
GetAllServicePorts returns all ports with a serviceport mapping
type PodSpec ¶ added in v0.3.3
PodSpec is type alias for core.PodSpec
func (PodSpec) MarshalYAML ¶ added in v0.3.3
MarshalYAML for the PodSpec type
type PolicyRule ¶
PolicyRule holds the details about the policy rules for the service account resources
type Role ¶
type Role struct {
Name string
PolicyRules []PolicyRule
}
Role holds the details about the role resource
type RoleBinding ¶
RoleBinding holds the details about the role binding resource
type Service ¶
type Service struct {
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
OnlyIngress bool
Daemon bool //Gets converted to DaemonSet
DeploymentType DeploymentType // The type of Deployment this service gets converted to (Rollout/StatefulSet/Deployment)
}
Service defines structure of an IR service
func NewServiceWithName ¶
NewServiceWithName initializes a service with just the name.
func (*Service) AddPortForwarding ¶
func (service *Service) AddPortForwarding(servicePort networking.ServiceBackendPort, podPort networking.ServiceBackendPort, relPath string) error
AddPortForwarding adds a new port forwarding to the service.
func (*Service) HasValidAnnotation ¶
HasValidAnnotation returns if an annotation is set for the service
func (Service) MarshalYAML ¶ added in v0.3.3
MarshalYAML for the Service type
type ServiceAccount ¶
ServiceAccount holds the details about the service account resource
type ServiceToPodPortForwarding ¶
type ServiceToPodPortForwarding struct {
ServicePort networking.ServiceBackendPort
PodPort networking.ServiceBackendPort
ServiceRelPath string
ServiceType core.ServiceType
Headless bool // Whether this port forwarding is for a headless service
}
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
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" )
type TektonResources ¶
type TektonResources struct {
EventListeners []EventListener
TriggerBindings []TriggerBinding
TriggerTemplates []TriggerTemplate
Pipelines []Pipeline
}
TektonResources contains the resources for CI/CD
type TriggerBinding ¶
type TriggerBinding struct {
Name string
}
TriggerBinding holds the details about the git event trigger binding resource