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 NewREST(generator *BuildGenerator) (*CloneREST, *InstantiateREST)
- type BuildGenerator
- func (g *BuildGenerator) Clone(ctx kapi.Context, request *buildapi.BuildRequest) (*buildapi.Build, error)
- func (g *BuildGenerator) FetchServiceAccountSecrets(namespace string) ([]kapi.Secret, error)
- func (g *BuildGenerator) Instantiate(ctx kapi.Context, request *buildapi.BuildRequest) (*buildapi.Build, error)
- type Client
- func (c Client) CreateBuild(ctx kapi.Context, build *buildapi.Build) error
- func (c Client) GetBuild(ctx kapi.Context, name string) (*buildapi.Build, error)
- func (c Client) GetBuildConfig(ctx kapi.Context, name string) (*buildapi.BuildConfig, error)
- func (c Client) GetImageStream(ctx kapi.Context, name string) (*imageapi.ImageStream, error)
- func (c Client) GetImageStreamImage(ctx kapi.Context, name string) (*imageapi.ImageStreamImage, error)
- func (c Client) GetImageStreamTag(ctx kapi.Context, name string) (*imageapi.ImageStreamTag, error)
- func (c Client) UpdateBuildConfig(ctx kapi.Context, buildConfig *buildapi.BuildConfig) error
- type CloneREST
- type GeneratorClient
- type InstantiateREST
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewREST ¶
func NewREST(generator *BuildGenerator) (*CloneREST, *InstantiateREST)
NewREST creates a new storage object for build generation
Types ¶
type BuildGenerator ¶
type BuildGenerator struct { Client GeneratorClient DefaultServiceAccountName string ServiceAccounts kclient.ServiceAccountsNamespacer Secrets kclient.SecretsNamespacer }
BuildGenerator is a central place responsible for generating new Build objects from BuildConfigs and other Builds.
func (*BuildGenerator) Clone ¶
func (g *BuildGenerator) Clone(ctx kapi.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 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 kapi.Context, request *buildapi.BuildRequest) (*buildapi.Build, error)
Instantiate returns new Build object based on a BuildRequest object
type Client ¶
type Client struct { GetBuildConfigFunc func(ctx kapi.Context, name string) (*buildapi.BuildConfig, error) UpdateBuildConfigFunc func(ctx kapi.Context, buildConfig *buildapi.BuildConfig) error GetBuildFunc func(ctx kapi.Context, name string) (*buildapi.Build, error) CreateBuildFunc func(ctx kapi.Context, build *buildapi.Build) error GetImageStreamFunc func(ctx kapi.Context, name string) (*imageapi.ImageStream, error) GetImageStreamImageFunc func(ctx kapi.Context, name string) (*imageapi.ImageStreamImage, error) GetImageStreamTagFunc func(ctx kapi.Context, name string) (*imageapi.ImageStreamTag, error) }
Client is an implementation of the GeneratorClient interface
func (Client) CreateBuild ¶
CreateBuild creates a new build
func (Client) GetBuildConfig ¶
GetBuildConfig retrieves a named build config
func (Client) GetImageStream ¶ added in v0.4.3
GetImageStream retrieves a named image stream
func (Client) GetImageStreamImage ¶ added in v0.5.1
func (c Client) GetImageStreamImage(ctx kapi.Context, name string) (*imageapi.ImageStreamImage, error)
GetImageStreamImage retrieves an image stream image
func (Client) GetImageStreamTag ¶ added in v0.5.1
GetImageStreamTag retrieves and image stream tag
func (Client) UpdateBuildConfig ¶
UpdateBuildConfig updates a named build config
type CloneREST ¶
type CloneREST struct {
// contains filtered or unexported fields
}
CloneREST is a RESTStorage implementation for a BuildGenerator which supports only the Get operation (as the generator has no underlying storage object).
type GeneratorClient ¶
type GeneratorClient interface { GetBuildConfig(ctx kapi.Context, name string) (*buildapi.BuildConfig, error) UpdateBuildConfig(ctx kapi.Context, buildConfig *buildapi.BuildConfig) error GetBuild(ctx kapi.Context, name string) (*buildapi.Build, error) CreateBuild(ctx kapi.Context, build *buildapi.Build) error GetImageStream(ctx kapi.Context, name string) (*imageapi.ImageStream, error) GetImageStreamImage(ctx kapi.Context, name string) (*imageapi.ImageStreamImage, error) GetImageStreamTag(ctx kapi.Context, name string) (*imageapi.ImageStreamTag, error) }
GeneratorClient is the API client used by the generator
type InstantiateREST ¶
type InstantiateREST struct {
// contains filtered or unexported fields
}
InstantiateREST is a RESTStorage implementation for a BuildGenerator which supports only the Get operation (as the generator has no underlying storage object).
func (*InstantiateREST) New ¶
func (s *InstantiateREST) New() runtime.Object
New creates a new build generation request