gcp

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTimeOut = errors.New("Operation timed out")
)

Functions

func AddBuildTags added in v0.0.2

func AddBuildTags(build *cbpb.Build, sourceCommit string, version string) error

AddBuildTags passes various values as build flags to the build

func AddImages added in v0.0.2

func AddImages(build *cbpb.Build, images []string) error

AddImages adds images to the build

func AddKanikoArgs added in v0.0.2

func AddKanikoArgs(build *cbpb.Build, buildArgs []string) error

AddKanikoArgs adds a build arg to the build null-op if its already added

func BuildImage added in v0.0.2

func BuildImage(project string, build *cbpb.Build) (*longrunningpb.Operation, error)

BuildImage builds a docker image using GCB Blocks until the build is complete

func DefaultBuild added in v0.0.2

func DefaultBuild() *cbpb.Build

DefaultBuild constructs a default BuildFile image should be the URI of the image with out the tag

func IsArtifactRegistry

func IsArtifactRegistry(url string) bool

IsArtifactRegistry returns true if the URL is a valid artifact registry URL

func OPNameToBuildID added in v0.0.2

func OPNameToBuildID(name string) (string, error)

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

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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL