Documentation
¶
Overview ¶
Copyright 2020 The Tekton Authors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func AppendInstalled(ctx context.Context, manifest *mf.Manifest, instance v1alpha1.TektonComponent) error
- func AppendManifest(manifest *mf.Manifest, yamlLocation string) error
- func AppendTarget(ctx context.Context, manifest *mf.Manifest, instance v1alpha1.TektonComponent) error
- func ApplyProxySettings(u *unstructured.Unstructured) error
- func CheckDeployments(ctx context.Context, manifest *mf.Manifest, instance v1alpha1.TektonComponent) error
- func ComponentDir(instance v1alpha1.TektonComponent) string
- func DeploymentImages(images map[string]string) mf.Transformer
- func Fetch(path string) (mf.Manifest, error)
- func ImagesFromEnv(prefix string) map[string]string
- func InjectLabelOnNamespace() mf.Transformer
- func Install(ctx context.Context, manifest *mf.Manifest, instance v1alpha1.TektonComponent) error
- func InstalledManifest(instance v1alpha1.TektonComponent) (mf.Manifest, error)
- func JobImages(images map[string]string) mf.Transformer
- func NoOp(context.Context, *mf.Manifest, v1alpha1.TektonComponent) error
- func PipelineReady(informer informer.TektonPipelineInformer) (*v1alpha1.TektonPipeline, error)
- func TargetManifest(instance v1alpha1.TektonComponent) (mf.Manifest, error)
- func TargetVersion(instance v1alpha1.TektonComponent) string
- func TaskImages(images map[string]string) mf.Transformer
- func ToLowerCaseKeys(keyValues map[string]string) map[string]string
- func Transform(ctx context.Context, manifest *mf.Manifest, instance v1alpha1.TektonComponent, ...) error
- func TriggerReady(informer informer.TektonTriggerInformer) (*v1alpha1.TektonTrigger, error)
- func Uninstall(ctx context.Context, manifest *mf.Manifest) error
- type Extension
- type ExtensionGenerator
- type ManifestFetcher
- type Stage
- type Stages
Constants ¶
const ( PipelineNotReady = "tekton-pipelines not ready" PipelineNotFound = "tekton-pipelines not installed" TriggerNotReady = "tekton-triggers not ready" TriggerNotFound = "tekton-triggers not installed" )
const ( // KoEnvKey is the key of the environment variable to specify the path to the ko data directory KoEnvKey = "KO_DATA_PATH" // VersionVariable is a string, which can be replaced with the value of spec.version VersionVariable = "${VERSION}" // COMMA is the character comma COMMA = "," )
const ( AnnotationPreserveNS = "operator.tekton.dev/preserve-namespace" AnnotationPreserveRBSubjectNS = "operator.tekton.dev/preserve-rb-subject-namespace" PipelinesImagePrefix = "IMAGE_PIPELINES_" TriggersImagePrefix = "IMAGE_TRIGGERS_" AddonsImagePrefix = "IMAGE_ADDONS_" ArgPrefix = "arg_" ParamPrefix = "param_" )
Variables ¶
var ( PipelineResourceName = "pipeline" TriggerResourceName = "trigger" DashboardResourceName = "dashboard" AddonResourceName = "addon" ConfigResourceName = "config" ProfileBasic = "basic" ProfileDefault = "default" ProfileAll = "all" Interval = 10 * time.Second Timeout = 1 * time.Minute )
Functions ¶
func AppendInstalled ¶
func AppendInstalled(ctx context.Context, manifest *mf.Manifest, instance v1alpha1.TektonComponent) error
AppendInstalled mutates the passed manifest by appending one appropriate for the passed TektonComponent, which may not be the one corresponding to status.version
func AppendTarget ¶
func AppendTarget(ctx context.Context, manifest *mf.Manifest, instance v1alpha1.TektonComponent) error
AppendTarget mutates the passed manifest by appending one appropriate for the passed TektonComponent
func ApplyProxySettings ¶
func ApplyProxySettings(u *unstructured.Unstructured) error
ApplyProxySettings is a transformer that propagate any proxy environment variables set on the operator deployment to the underlying deployment.
func CheckDeployments ¶
func CheckDeployments(ctx context.Context, manifest *mf.Manifest, instance v1alpha1.TektonComponent) error
CheckDeployments checks all deployments in the given manifest and updates the given status with the status of the deployments.
func ComponentDir ¶
func ComponentDir(instance v1alpha1.TektonComponent) string
func DeploymentImages ¶
func DeploymentImages(images map[string]string) mf.Transformer
DeploymentImages replaces container and args images.
func ImagesFromEnv ¶
ImagesFromEnv will provide map of key value.
func InjectLabelOnNamespace ¶
func InjectLabelOnNamespace() mf.Transformer
InjectLabelOnNamespace will add a label on tekton-pipelines and openshift-pipelines namespace to disable proxy in these namespace
func Install ¶
Install applies the manifest resources for the given version and updates the given status accordingly.
func InstalledManifest ¶
func InstalledManifest(instance v1alpha1.TektonComponent) (mf.Manifest, error)
InstalledManifest returns the version currently installed, which is harder than it sounds, since status.version isn't set until the target version is successfully installed, which can take some time. So we return the target manifest if status.version is empty.
func JobImages ¶
func JobImages(images map[string]string) mf.Transformer
JobImages replaces container and args images.
func PipelineReady ¶
func PipelineReady(informer informer.TektonPipelineInformer) (*v1alpha1.TektonPipeline, error)
func TargetManifest ¶
func TargetManifest(instance v1alpha1.TektonComponent) (mf.Manifest, error)
TargetManifest returns the manifest for the TargetVersion
func TargetVersion ¶
func TargetVersion(instance v1alpha1.TektonComponent) string
TargetVersion returns the version of the manifest to be installed per the spec in the component. If spec.version is empty, the latest version known to the operator is returned.
func TaskImages ¶
func TaskImages(images map[string]string) mf.Transformer
TaskImages replaces step and params images.
func ToLowerCaseKeys ¶
ToLowerCaseKeys converts key value to lower cases.
func Transform ¶
func Transform(ctx context.Context, manifest *mf.Manifest, instance v1alpha1.TektonComponent, extra ...mf.Transformer) error
Transform will mutate the passed-by-reference manifest with one transformed by platform, common, and any extra passed in
func TriggerReady ¶
func TriggerReady(informer informer.TektonTriggerInformer) (*v1alpha1.TektonTrigger, error)
Types ¶
type Extension ¶
type Extension interface {
Transformers(v1alpha1.TektonComponent) []mf.Transformer
PreReconcile(context.Context, v1alpha1.TektonComponent) error
PostReconcile(context.Context, v1alpha1.TektonComponent) error
Finalize(context.Context, v1alpha1.TektonComponent) error
}
Extension enables platform-specific features
func NoExtension ¶
NoPlatform "generates" a NilExtension
type ExtensionGenerator ¶
ExtensionGenerator creates an Extension from a Context
type ManifestFetcher ¶
type ManifestFetcher func(ctx context.Context, instance v1alpha1.TektonComponent) (*mf.Manifest, error)
ManifestFetcher returns a manifest appropriate for the instance
type Stage ¶
Stage represents a step in the reconcile process
func DeleteObsoleteResources ¶
func DeleteObsoleteResources(ctx context.Context, instance v1alpha1.TektonComponent, fetch ManifestFetcher) Stage
DeleteObsoleteResources returns a Stage after calculating the installed manifest from the instance. This is meant to be called *before* executing the reconciliation stages so that the proper manifest is captured in a closure before any stage might mutate the instance status, e.g. Install.