artifactregistry

package
v1.17.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const DefaultLocation = "us"

DefaultLocation is the default location in which to host Artifact Registry repositories. In this case, `us`, which is a multi-region location.

View Source
const RegistryReaderAccountName = "e2e-test-ar-reader"

RegistryReaderAccountName is the name of the google service account with permission to read from Artifact Registry.

Variables

This section is empty.

Functions

func RegistryReaderAccountEmail

func RegistryReaderAccountEmail() string

RegistryReaderAccountEmail returns the email of the google service account with permission to read from Artifact Registry.

func WriteObjectYAMLFile

func WriteObjectYAMLFile(nt *nomostest.NT, path string, obj client.Object) error

WriteObjectYAMLFile formats the objects as YAML and writes it to the specified file. Creates parent directories as needed.

Types

type CraneImage

type CraneImage struct {
	*Image
}

CraneImage represents a remote OCI-based crane-build image

func SetupCraneImage

func SetupCraneImage(nt *nomostest.NT, name, version string) (*CraneImage, error)

SetupCraneImage creates a new CraneImage for use during an e2e test, along with its registry, repository, and login. Returns a reference to the Image object and any errors.

func (*CraneImage) Push

func (r *CraneImage) Push() error

Push will package and push the image located at r.BuildPath to the remote registry.

func (*CraneImage) RegistryLogin

func (r *CraneImage) RegistryLogin() error

RegistryLogin will log into the registry with crane using a gcloud auth token.

type HelmChart

type HelmChart struct {
	Image *Image
}

HelmChart represents a remote OCI-based helm chart

func PushHelmChart

func PushHelmChart(nt *nomostest.NT, name, version string) (*HelmChart, error)

PushHelmChart pushes a new helm chart for use during an e2e test. Returns a reference to the RemoteHelmChart object and any errors.

func SetupHelmChart

func SetupHelmChart(nt *nomostest.NT, name, version string) (*HelmChart, error)

SetupHelmChart creates a new HelmChart for use during an e2e test. Returns a reference to the Image object and any errors.

func (*HelmChart) CopyLocalPackage

func (r *HelmChart) CopyLocalPackage(chartPath string) error

CopyLocalPackage accepts a local path to a helm chart and recursively copies it to r.BuildPath, modifying the name of the copied chart from its original name to r.Name and version to r.Version.

func (*HelmChart) Push

func (r *HelmChart) Push() error

Push will package and push the helm chart located at r.BuildPath to the remote registry. Use helm to push, instead of crane, to better simulate the user workflow.

func (*HelmChart) RegistryLogin

func (r *HelmChart) RegistryLogin() error

RegistryLogin will log into the registry with helm using a gcloud auth token.

func (*HelmChart) SetVersion

func (r *HelmChart) SetVersion(version string) error

SetVersion updates the local version of the helm chart to the specified version with a random suffix

type Image

type Image struct {
	// Shell is a helper utility to execute shell commands in a test.
	Shell *testshell.TestShell

	// Logger to write logs to
	Logger *testlogger.TestLogger

	// Project in which to store the image
	Project string

	// Location to store the image
	Location string

	// RepositoryName in which to store the image
	RepositoryName string

	// name is the name of the image
	Name string

	// version is the version of the image
	Version string

	// BuildPath is a local directory from which Image will read, package, and push the image from
	BuildPath string
}

Image represents a remote OCI image in Artifact Registry

func SetupImage

func SetupImage(nt *nomostest.NT, name, version string) (*Image, error)

SetupImage constructs a new Image for use during an e2e test, along with its repository. Image will be deleted when the test ends. Returns a reference to the Image object and any errors.

func (*Image) Address

func (r *Image) Address() string

Address returns the domain and path to the image

func (*Image) AddressWithTag

func (r *Image) AddressWithTag() string

AddressWithTag returns the domain, path, name, and tag of the image

func (*Image) CleanBuildPath

func (r *Image) CleanBuildPath() error

CleanBuildPath creates the r.BuildPath if it doesn't exist and deletes all contents if it does.

func (*Image) ConfigureAuthHelper

func (r *Image) ConfigureAuthHelper() error

ConfigureAuthHelper configures the local docker client to use gcloud for image registry authorization. Helm uses the docker config.

func (*Image) CopyLocalPackage

func (r *Image) CopyLocalPackage(pkgPath string) error

CopyLocalPackage accepts a local path to a package and recursively copies it to r.BuildPath.

func (*Image) CreateRepository

func (r *Image) CreateRepository() error

CreateRepository uses gcloud to create the repository, if it doesn't exist.

func (*Image) Delete

func (r *Image) Delete() error

Delete the package from the remote registry, including all versions and tags.

func (*Image) RegistryHost

func (r *Image) RegistryHost() string

RegistryHost returns the domain of the artifact registry

func (*Image) RepositoryAddress

func (r *Image) RepositoryAddress() string

RepositoryAddress returns the domain and path to the chart repository

func (*Image) RepositoryOCI

func (r *Image) RepositoryOCI() string

RepositoryOCI returns the repository address with the oci:// scheme prefix.

func (*Image) SetName

func (r *Image) SetName(nt *nomostest.NT, name string)

SetName updates the local name of the image to the specified name with a random suffix

func (*Image) SetVersion

func (r *Image) SetVersion(version string) error

SetVersion updates the local version of the image to the specified tag with a random suffix

Jump to

Keyboard shortcuts

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