Documentation ¶
Overview ¶
* Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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 ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromEnvToArgs ¶
FromEnvToArgs converts an EnvVar array into an args string slice. E.g. name=value,name=value
func KanikoSecurityDefaults ¶
func KanikoSecurityDefaults() *corev1.SecurityContext
Types ¶
type Action ¶
type Action interface { client.Injectable // Name returns user-friendly name for the action Name() string // CanHandle returns true if the action can handle the build CanHandle(build *api.ContainerBuild) bool // Handle executes the handling function Handle(ctx context.Context, build *api.ContainerBuild) (*api.ContainerBuild, error) }
type BuilderProperty ¶
type BuilderProperty string
const KanikoCache BuilderProperty = "kaniko-cache"
type ContainerBuilderInfo ¶
type ContainerBuilderInfo struct { FinalImageName string BuildUniqueName string Platform api.PlatformContainerBuild // ContainerBuilderImageTag the image tag used internally to create the pod builder (e.g. Kaniko Executor Builder image) ContainerBuilderImageTag string }
type MountHandler ¶
type MountHandler interface { // AddResource the actual file/resource to add to the build context in the relative root path. Might be called multiple times. AddResource(target string, content []byte) MountHandler // AddConfigMapResource the configMap to add to the build context. Might be called multiple times. // This ConfigMap is a Kubernetes LocalObjectReference, meaning that must be within the Platform namespace. AddConfigMapResource(configMap corev1.LocalObjectReference, path string) MountHandler WithClient(client client.Client) MountHandler Scheduler() Scheduler }
func NewBuild ¶
func NewBuild(info ContainerBuilderInfo) MountHandler
NewBuild is the API entry for the Reconciler. Create a new ContainerBuild instance based on PlatformContainerBuild.
type Reconciler ¶
type Reconciler interface { WithClient(client client.Client) Reconciler CancelBuild() (*api.ContainerBuild, error) Reconcile() (*api.ContainerBuild, error) }
func FromBuild ¶
func FromBuild(build *api.ContainerBuild) Reconciler
type Scheduler ¶
type Scheduler interface { // WithResourceRequirements Kubernetes resource requirements to be passed to the underlying builder if necessary. For example, a builder pod might require specific resources underneath. WithResourceRequirements(res corev1.ResourceRequirements) Scheduler // WithAdditionalArgs array of strings to pass to the underlying builder. For example "--myarg=myvalue" or "MY_ENV=MY_VALUE". The args are passed separated by spaces. WithAdditionalArgs(args []string) Scheduler // WithProperty specialized property known by inner implementations for additional properties to configure the underlying builder WithProperty(property BuilderProperty, object interface{}) Scheduler WithBuildArgs(args []corev1.EnvVar) Scheduler WithEnvs(envs []corev1.EnvVar) Scheduler Schedule() (*api.ContainerBuild, error) }
Scheduler provides an interface to add resources and schedule a new build