Documentation ¶
Overview ¶
Package generator contains the code to generate Build from BuildConfig as well as REST support to help expose the generator from an API.
Index ¶
- func IsFatal(err error) bool
- type BuildGenerator
- func (g *BuildGenerator) Clone(ctx apirequest.Context, request *buildapi.BuildRequest) (*buildapi.Build, error)
- func (g *BuildGenerator) FetchServiceAccountSecrets(namespace, serviceAccount string) ([]kapi.Secret, error)
- func (g *BuildGenerator) Instantiate(ctx apirequest.Context, request *buildapi.BuildRequest) (*buildapi.Build, error)
- type Client
- func (c Client) CreateBuild(ctx apirequest.Context, build *buildapi.Build) error
- func (c Client) GetBuild(ctx apirequest.Context, name string, options *metav1.GetOptions) (*buildapi.Build, error)
- func (c Client) GetBuildConfig(ctx apirequest.Context, name string, options *metav1.GetOptions) (*buildapi.BuildConfig, error)
- func (c Client) GetImageStream(ctx apirequest.Context, name string, options *metav1.GetOptions) (*imageapi.ImageStream, error)
- func (c Client) GetImageStreamImage(ctx apirequest.Context, name string, options *metav1.GetOptions) (*imageapi.ImageStreamImage, error)
- func (c Client) GetImageStreamTag(ctx apirequest.Context, name string, options *metav1.GetOptions) (*imageapi.ImageStreamTag, error)
- func (c Client) UpdateBuild(ctx apirequest.Context, build *buildapi.Build) error
- func (c Client) UpdateBuildConfig(ctx apirequest.Context, buildConfig *buildapi.BuildConfig) error
- type GeneratorClient
- type GeneratorFatalError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BuildGenerator ¶
type BuildGenerator struct { Client GeneratorClient DefaultServiceAccountName string ServiceAccounts kcoreclient.ServiceAccountsGetter Secrets kcoreclient.SecretsGetter }
BuildGenerator is a central place responsible for generating new Build objects from BuildConfigs and other Builds.
func (*BuildGenerator) Clone ¶
func (g *BuildGenerator) Clone(ctx apirequest.Context, request *buildapi.BuildRequest) (*buildapi.Build, error)
Clone returns clone of a Build
func (*BuildGenerator) FetchServiceAccountSecrets ¶ added in v0.5.4
func (g *BuildGenerator) FetchServiceAccountSecrets(namespace, serviceAccount string) ([]kapi.Secret, error)
FetchServiceAccountSecrets retrieves the Secrets used for pushing and pulling images from private Docker registries.
func (*BuildGenerator) Instantiate ¶
func (g *BuildGenerator) Instantiate(ctx apirequest.Context, request *buildapi.BuildRequest) (*buildapi.Build, error)
Instantiate returns a new Build object based on a BuildRequest object
type Client ¶
type Client struct { GetBuildConfigFunc func(ctx apirequest.Context, name string, options *metav1.GetOptions) (*buildapi.BuildConfig, error) UpdateBuildConfigFunc func(ctx apirequest.Context, buildConfig *buildapi.BuildConfig) error GetBuildFunc func(ctx apirequest.Context, name string, options *metav1.GetOptions) (*buildapi.Build, error) CreateBuildFunc func(ctx apirequest.Context, build *buildapi.Build) error UpdateBuildFunc func(ctx apirequest.Context, build *buildapi.Build) error GetImageStreamFunc func(ctx apirequest.Context, name string, options *metav1.GetOptions) (*imageapi.ImageStream, error) GetImageStreamImageFunc func(ctx apirequest.Context, name string, options *metav1.GetOptions) (*imageapi.ImageStreamImage, error) GetImageStreamTagFunc func(ctx apirequest.Context, name string, options *metav1.GetOptions) (*imageapi.ImageStreamTag, error) }
Client is an implementation of the GeneratorClient interface
func (Client) CreateBuild ¶
CreateBuild creates a new build
func (Client) GetBuild ¶
func (c Client) GetBuild(ctx apirequest.Context, name string, options *metav1.GetOptions) (*buildapi.Build, error)
GetBuild retrieves a build
func (Client) GetBuildConfig ¶
func (c Client) GetBuildConfig(ctx apirequest.Context, name string, options *metav1.GetOptions) (*buildapi.BuildConfig, error)
GetBuildConfig retrieves a named build config
func (Client) GetImageStream ¶ added in v0.4.3
func (c Client) GetImageStream(ctx apirequest.Context, name string, options *metav1.GetOptions) (*imageapi.ImageStream, error)
GetImageStream retrieves a named image stream
func (Client) GetImageStreamImage ¶ added in v0.5.1
func (c Client) GetImageStreamImage(ctx apirequest.Context, name string, options *metav1.GetOptions) (*imageapi.ImageStreamImage, error)
GetImageStreamImage retrieves an image stream image
func (Client) GetImageStreamTag ¶ added in v0.5.1
func (c Client) GetImageStreamTag(ctx apirequest.Context, name string, options *metav1.GetOptions) (*imageapi.ImageStreamTag, error)
GetImageStreamTag retrieves and image stream tag
func (Client) UpdateBuild ¶ added in v1.5.0
UpdateBuild updates a build
func (Client) UpdateBuildConfig ¶
func (c Client) UpdateBuildConfig(ctx apirequest.Context, buildConfig *buildapi.BuildConfig) error
UpdateBuildConfig updates a named build config
type GeneratorClient ¶
type GeneratorClient interface { GetBuildConfig(ctx apirequest.Context, name string, options *metav1.GetOptions) (*buildapi.BuildConfig, error) UpdateBuildConfig(ctx apirequest.Context, buildConfig *buildapi.BuildConfig) error GetBuild(ctx apirequest.Context, name string, options *metav1.GetOptions) (*buildapi.Build, error) CreateBuild(ctx apirequest.Context, build *buildapi.Build) error UpdateBuild(ctx apirequest.Context, build *buildapi.Build) error GetImageStream(ctx apirequest.Context, name string, options *metav1.GetOptions) (*imageapi.ImageStream, error) GetImageStreamImage(ctx apirequest.Context, name string, options *metav1.GetOptions) (*imageapi.ImageStreamImage, error) GetImageStreamTag(ctx apirequest.Context, name string, options *metav1.GetOptions) (*imageapi.ImageStreamTag, error) }
GeneratorClient is the API client used by the generator
type GeneratorFatalError ¶ added in v1.1.2
type GeneratorFatalError struct { // Reason the fatal error occurred Reason string }
GeneratorFatalError represents a fatal error while generating a build. An operation that fails because of a fatal error should not be retried.
func (*GeneratorFatalError) Error ¶ added in v1.1.2
func (e *GeneratorFatalError) Error() string
Error returns the error string for this fatal error