Documentation ¶
Index ¶
- Variables
- func AddBuildTags(build *cbpb.Build, sourceCommit string, version string) error
- func AddImages(build *cbpb.Build, images []string) error
- func AddKanikoArgs(build *cbpb.Build, buildArgs []string) error
- func BuildImage(project string, build *cbpb.Build) (*longrunningpb.Operation, error)
- func DefaultBuild() *cbpb.Build
- func IsArtifactRegistry(url string) bool
- func OPNameToBuildID(name string) (string, error)
- func WaitForBuild(ctx context.Context, client *cb.Client, project string, buildId string) (*cbpb.Build, error)
- func WaitForOp(ctx context.Context, client *longrunning.OperationsClient, ...) (*longrunningpb.Operation, error)
- type ArtifactImage
- type ImageResolver
Constants ¶
This section is empty.
Variables ¶
var (
ErrTimeOut = errors.New("Operation timed out")
)
Functions ¶
func AddBuildTags ¶ added in v0.0.2
AddBuildTags passes various values as build flags to the build
func AddKanikoArgs ¶ added in v0.0.2
AddKanikoArgs adds a build arg to the build null-op if its already added
func BuildImage ¶ added in v0.0.2
BuildImage builds a docker image using GCB Blocks until the build is complete
func DefaultBuild ¶ added in v0.0.2
DefaultBuild constructs a default BuildFile image should be the URI of the image with out the tag
func IsArtifactRegistry ¶
IsArtifactRegistry returns true if the URL is a valid artifact registry URL
func OPNameToBuildID ¶ added in v0.0.2
OPNameToBuildID converts an operation name to a build id
func WaitForBuild ¶ added in v0.0.2
func WaitForBuild(ctx context.Context, client *cb.Client, project string, buildId string) (*cbpb.Build, error)
WaitForBuild waits for a build to complete. Caller should set the deadline on the context. On timeout error is nil and the last operation is returned but Done won't be true.
func WaitForOp ¶ added in v0.0.2
func WaitForOp(ctx context.Context, client *longrunning.OperationsClient, op *longrunningpb.Operation) (*longrunningpb.Operation, error)
WaitForOp waits for an operation to complete. Caller should set the deadline on the context. On timeout error is nil and the last operation is returned but Done won't be true.
Types ¶
type ArtifactImage ¶
type ArtifactImage struct { Project string Location string Repository string Package string Tag string Sha string }
func FromImageRef ¶
func FromImageRef(r util.DockerImageRef) (ArtifactImage, error)
func (ArtifactImage) NameForTag ¶
func (a ArtifactImage) NameForTag() string
func (ArtifactImage) ToImageRef ¶ added in v0.0.8
func (a ArtifactImage) ToImageRef() (*util.DockerImageRef, error)
type ImageResolver ¶
type ImageResolver struct {
// contains filtered or unexported fields
}
func NewImageResolver ¶
func NewImageResolver(ctx context.Context) (*ImageResolver, error)
func (*ImageResolver) ResolveImageToSha ¶
func (i *ImageResolver) ResolveImageToSha(ref util.DockerImageRef, strategy v1alpha1.Strategy) (util.DockerImageRef, error)
ResolveImageToSha resolves the image to a sha. TODO(jeremy): We need to standardize how not found/doesn't exist errors are returned. We need to support multiple registries and resolvers. Right now it will return a notfound Status wrapped in an error you can check it using status.Code(err) == codes.NotFound