builds

package
v2.11.26 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package builds provides access to the Kf build process.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildStatus

func BuildStatus(build v1alpha1.Build) (finished bool, err error)

BuildStatus gets the status of the given build. Complete will be set to true if the build has completed (or doesn't exist). Error will be set if the build completed with an error (or doesn't exist). A successful result is one that completed and error is nil.

func ConditionDeleted

func ConditionDeleted(ctx context.Context, _ *v1alpha1.Build, apiErr error) (bool, error)

ConditionDeleted is a ConditionFuncE that succeeds if the error returned by the cluster was a not found error.

func WithConditionReporter added in v2.11.16

func WithConditionReporter(ctx context.Context, reporter ConditionReporter) context.Context

WithConditionReporter adds a callback to condition waits.

Types

type BuildTailer

type BuildTailer interface {
	Tail(ctx context.Context, out io.Writer, buildName, namespace string) error
}

BuildTailer tails the Build logs.

func TektonLoggingShim

func TektonLoggingShim(ki kubernetes.Interface) BuildTailer

TektonLoggingShim implements BuildTailer for taskrun.LogReader (https://godoc.org/github.com/tektoncd/cli/pkg/cmd/taskrun#LogReader).

TODO: To keep the transition to Tekton small, we'll implement a function here that implements the interface that knative-build expected. We should obviously move away from this at some point.

type BuildTailerFunc

type BuildTailerFunc func(ctx context.Context, out io.Writer, buildName, namespace string) error

BuildTailerFunc converts a func into a BuildTailer.

func (BuildTailerFunc) Tail

func (f BuildTailerFunc) Tail(ctx context.Context, out io.Writer, buildName, namespace string) error

Tail implements BuildTailer.

type Client

type Client interface {
	Create(ctx context.Context, namespace string, obj *v1alpha1.Build) (*v1alpha1.Build, error)
	Transform(ctx context.Context, namespace string, name string, transformer Mutator) (*v1alpha1.Build, error)
	Get(ctx context.Context, namespace string, name string) (*v1alpha1.Build, error)
	Delete(ctx context.Context, namespace string, name string) error
	List(ctx context.Context, namespace string) ([]v1alpha1.Build, error)
	Upsert(ctx context.Context, namespace string, newObj *v1alpha1.Build, merge Merger) (*v1alpha1.Build, error)
	WaitFor(ctx context.Context, namespace string, name string, interval time.Duration, condition Predicate) (*v1alpha1.Build, error)

	// Utility functions
	WaitForDeletion(ctx context.Context, namespace string, name string, interval time.Duration) (*v1alpha1.Build, error)

	// ClientExtension can be used by the developer to extend the client.
	ClientExtension
}

Client is the interface for interacting with v1alpha1.Build types as Build CF style objects.

func NewClient

func NewClient(p *config.KfParams, kclient cv1alpha1.BuildsGetter, buildTailer BuildTailer) Client

NewClient creates a new build client.

type ClientExtension

type ClientExtension interface {
	Tail(ctx context.Context, namespace, name string, writer io.Writer) error
	Status(ctx context.Context, namespace, name string) (bool, error)
}

ClientExtension holds additional functions that should be exposed by client.

type ConditionFuncE

type ConditionFuncE func(ctx context.Context, instance *v1alpha1.Build, apiErr error) (done bool, err error)

ConditionFuncE is a callback used by waitForE. Done should be set to true once the condition succeeds and shouldn't be called anymore. The error will be passed back to the user.

This function MAY retrieve a nil instance and an apiErr. It's up to the function to decide how to handle the apiErr.

type ConditionReporter added in v2.11.16

type ConditionReporter func(message string)

ConditionReporter reports on changes to conditions while waiting.

type Merger

type Merger func(newObj, oldObj *v1alpha1.Build) *v1alpha1.Build

Merger is a type to merge an existing value with a new one.

type Mutator

type Mutator func(*v1alpha1.Build) error

Mutator is a function that changes v1alpha1.Build.

type Predicate

type Predicate func(*v1alpha1.Build) bool

Predicate is a boolean function for a v1alpha1.Build.

type ResourceInfo

type ResourceInfo struct{}

func NewResourceInfo

func NewResourceInfo() *ResourceInfo

NewResourceInfo returns a new instance of ResourceInfo

func (*ResourceInfo) FriendlyName

func (*ResourceInfo) FriendlyName() string

FriendlyName gets the user-facing name of the resource.

func (*ResourceInfo) GroupVersionKind

func (*ResourceInfo) GroupVersionKind(context.Context) schema.GroupVersionKind

GroupVersionKind gets the GVK struct for the resource.

func (*ResourceInfo) GroupVersionResource

func (*ResourceInfo) GroupVersionResource(context.Context) schema.GroupVersionResource

GroupVersionResource gets the GVR struct for the resource.

func (*ResourceInfo) Namespaced

func (*ResourceInfo) Namespaced() bool

Namespaced returns true if the type belongs in a namespace.

Directories

Path Synopsis
Package fake is a generated GoMock package.
Package fake is a generated GoMock package.

Jump to

Keyboard shortcuts

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