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 ¶
- type BuildGenerator
- func (g *BuildGenerator) Clone(ctx context.Context, request *buildv1.BuildRequest) (*buildv1.Build, error)
- func (g *BuildGenerator) CloneInternal(ctx context.Context, request *buildapi.BuildRequest) (*buildapi.Build, error)
- func (g *BuildGenerator) Instantiate(ctx context.Context, request *buildv1.BuildRequest) (*buildv1.Build, error)
- func (g *BuildGenerator) InstantiateInternal(ctx context.Context, request *buildapi.BuildRequest) (*buildapi.Build, error)
- type Client
- func (c Client) CreateBuild(ctx context.Context, build *buildv1.Build) error
- func (c Client) GetBuild(ctx context.Context, name string, options *metav1.GetOptions) (*buildv1.Build, error)
- func (c Client) GetBuildConfig(ctx context.Context, name string, options *metav1.GetOptions) (*buildv1.BuildConfig, error)
- func (c Client) GetImageStream(ctx context.Context, name string, options *metav1.GetOptions) (*imagev1.ImageStream, error)
- func (c Client) GetImageStreamImage(ctx context.Context, name string, options *metav1.GetOptions) (*imagev1.ImageStreamImage, error)
- func (c Client) GetImageStreamTag(ctx context.Context, name string, options *metav1.GetOptions) (*imagev1.ImageStreamTag, error)
- func (c Client) UpdateBuild(ctx context.Context, build *buildv1.Build) error
- func (c Client) UpdateBuildConfig(ctx context.Context, buildConfig *buildv1.BuildConfig) error
- type GeneratorClient
- type TestingClient
- func (c TestingClient) CreateBuild(ctx context.Context, build *buildv1.Build) error
- func (c TestingClient) GetBuild(ctx context.Context, name string, options *metav1.GetOptions) (*buildv1.Build, error)
- func (c TestingClient) GetBuildConfig(ctx context.Context, name string, options *metav1.GetOptions) (*buildv1.BuildConfig, error)
- func (c TestingClient) GetImageStream(ctx context.Context, name string, options *metav1.GetOptions) (*imagev1.ImageStream, error)
- func (c TestingClient) GetImageStreamImage(ctx context.Context, name string, options *metav1.GetOptions) (*imagev1.ImageStreamImage, error)
- func (c TestingClient) GetImageStreamTag(ctx context.Context, name string, options *metav1.GetOptions) (*imagev1.ImageStreamTag, error)
- func (c TestingClient) UpdateBuild(ctx context.Context, build *buildv1.Build) error
- func (c TestingClient) UpdateBuildConfig(ctx context.Context, buildConfig *buildv1.BuildConfig) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildGenerator ¶
type BuildGenerator struct { Client GeneratorClient ServiceAccounts corev1client.ServiceAccountsGetter Secrets corev1client.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 context.Context, request *buildv1.BuildRequest) (*buildv1.Build, error)
Clone returns clone of a Build
func (*BuildGenerator) CloneInternal ¶ added in v3.11.0
func (g *BuildGenerator) CloneInternal(ctx context.Context, request *buildapi.BuildRequest) (*buildapi.Build, error)
Clone returns clone of a Build DEPRECATED: Use only in apiserver
func (*BuildGenerator) Instantiate ¶
func (g *BuildGenerator) Instantiate(ctx context.Context, request *buildv1.BuildRequest) (*buildv1.Build, error)
Instantiate returns a new Build object based on a BuildRequest object
func (*BuildGenerator) InstantiateInternal ¶ added in v3.11.0
func (g *BuildGenerator) InstantiateInternal(ctx context.Context, request *buildapi.BuildRequest) (*buildapi.Build, error)
DEPRECATED: Use only by apiserver
type Client ¶
type Client struct { BuildConfigs buildv1clienttyped.BuildConfigsGetter Builds buildv1clienttyped.BuildsGetter ImageStreams imagev1clienttyped.ImageStreamsGetter ImageStreamImages imagev1clienttyped.ImageStreamImagesGetter ImageStreamTags imagev1clienttyped.ImageStreamTagsGetter }
Client is an implementation of the GeneratorClient interface
func (Client) CreateBuild ¶
CreateBuild creates a new build
func (Client) GetBuild ¶
func (c Client) GetBuild(ctx context.Context, name string, options *metav1.GetOptions) (*buildv1.Build, error)
GetBuild retrieves a build
func (Client) GetBuildConfig ¶
func (c Client) GetBuildConfig(ctx context.Context, name string, options *metav1.GetOptions) (*buildv1.BuildConfig, error)
GetBuildConfig retrieves a named build config
func (Client) GetImageStream ¶
func (c Client) GetImageStream(ctx context.Context, name string, options *metav1.GetOptions) (*imagev1.ImageStream, error)
GetImageStream retrieves a named image stream
func (Client) GetImageStreamImage ¶
func (c Client) GetImageStreamImage(ctx context.Context, name string, options *metav1.GetOptions) (*imagev1.ImageStreamImage, error)
GetImageStreamImage retrieves an image stream image
func (Client) GetImageStreamTag ¶
func (c Client) GetImageStreamTag(ctx context.Context, name string, options *metav1.GetOptions) (*imagev1.ImageStreamTag, error)
GetImageStreamTag retrieves and image stream tag
func (Client) UpdateBuild ¶
UpdateBuild updates a build
func (Client) UpdateBuildConfig ¶
UpdateBuildConfig updates a named build config
type GeneratorClient ¶
type GeneratorClient interface { GetBuildConfig(ctx context.Context, name string, options *metav1.GetOptions) (*buildv1.BuildConfig, error) UpdateBuildConfig(ctx context.Context, buildConfig *buildv1.BuildConfig) error GetBuild(ctx context.Context, name string, options *metav1.GetOptions) (*buildv1.Build, error) CreateBuild(ctx context.Context, build *buildv1.Build) error UpdateBuild(ctx context.Context, build *buildv1.Build) error GetImageStream(ctx context.Context, name string, options *metav1.GetOptions) (*imagev1.ImageStream, error) GetImageStreamImage(ctx context.Context, name string, options *metav1.GetOptions) (*imagev1.ImageStreamImage, error) GetImageStreamTag(ctx context.Context, name string, options *metav1.GetOptions) (*imagev1.ImageStreamTag, error) }
GeneratorClient is the API client used by the generator
type TestingClient ¶ added in v3.7.0
type TestingClient struct { GetBuildConfigFunc func(ctx context.Context, name string, options *metav1.GetOptions) (*buildv1.BuildConfig, error) UpdateBuildConfigFunc func(ctx context.Context, buildConfig *buildv1.BuildConfig) error GetBuildFunc func(ctx context.Context, name string, options *metav1.GetOptions) (*buildv1.Build, error) CreateBuildFunc func(ctx context.Context, build *buildv1.Build) error UpdateBuildFunc func(ctx context.Context, build *buildv1.Build) error GetImageStreamFunc func(ctx context.Context, name string, options *metav1.GetOptions) (*imagev1.ImageStream, error) GetImageStreamImageFunc func(ctx context.Context, name string, options *metav1.GetOptions) (*imagev1.ImageStreamImage, error) GetImageStreamTagFunc func(ctx context.Context, name string, options *metav1.GetOptions) (*imagev1.ImageStreamTag, error) }
TestingClient is an implementation of the GeneratorClient interface
func (TestingClient) CreateBuild ¶ added in v3.7.0
CreateBuild creates a new build
func (TestingClient) GetBuild ¶ added in v3.7.0
func (c TestingClient) GetBuild(ctx context.Context, name string, options *metav1.GetOptions) (*buildv1.Build, error)
GetBuild retrieves a build
func (TestingClient) GetBuildConfig ¶ added in v3.7.0
func (c TestingClient) GetBuildConfig(ctx context.Context, name string, options *metav1.GetOptions) (*buildv1.BuildConfig, error)
GetBuildConfig retrieves a named build config
func (TestingClient) GetImageStream ¶ added in v3.7.0
func (c TestingClient) GetImageStream(ctx context.Context, name string, options *metav1.GetOptions) (*imagev1.ImageStream, error)
GetImageStream retrieves a named image stream
func (TestingClient) GetImageStreamImage ¶ added in v3.7.0
func (c TestingClient) GetImageStreamImage(ctx context.Context, name string, options *metav1.GetOptions) (*imagev1.ImageStreamImage, error)
GetImageStreamImage retrieves an image stream image
func (TestingClient) GetImageStreamTag ¶ added in v3.7.0
func (c TestingClient) GetImageStreamTag(ctx context.Context, name string, options *metav1.GetOptions) (*imagev1.ImageStreamTag, error)
GetImageStreamTag retrieves and image stream tag
func (TestingClient) UpdateBuild ¶ added in v3.7.0
UpdateBuild updates a build
func (TestingClient) UpdateBuildConfig ¶ added in v3.7.0
func (c TestingClient) UpdateBuildConfig(ctx context.Context, buildConfig *buildv1.BuildConfig) error
UpdateBuildConfig updates a named build config