Documentation ¶
Overview ¶
Package builds provides access to the Kf build process.
Index ¶
- func BuildStatus(build v1alpha1.Build) (finished bool, err error)
- func ConditionDeleted(ctx context.Context, _ *v1alpha1.Build, apiErr error) (bool, error)
- func WithConditionReporter(ctx context.Context, reporter ConditionReporter) context.Context
- type BuildTailer
- type BuildTailerFunc
- type Client
- type ClientExtension
- type ConditionFuncE
- type ConditionReporter
- type Merger
- type Mutator
- type Predicate
- type ResourceInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildStatus ¶
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 ¶
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 ¶
BuildTailerFunc converts a func into a 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 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.