Documentation ¶
Index ¶
- Constants
- func RegistryReaderAccountEmail() string
- func WriteObjectYAMLFile(nt *nomostest.NT, path string, obj client.Object) error
- type CraneImage
- type HelmChart
- type Image
- func (r *Image) Address() string
- func (r *Image) AddressWithTag() string
- func (r *Image) CleanBuildPath() error
- func (r *Image) ConfigureAuthHelper() error
- func (r *Image) CopyLocalPackage(pkgPath string) error
- func (r *Image) CreateRepository() error
- func (r *Image) Delete() error
- func (r *Image) RegistryHost() string
- func (r *Image) RepositoryAddress() string
- func (r *Image) RepositoryOCI() string
- func (r *Image) SetName(nt *nomostest.NT, name string)
- func (r *Image) SetVersion(version string) error
Constants ¶
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.
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.
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 ¶
PushHelmChart pushes a new helm chart for use during an e2e test. Returns a reference to the RemoteHelmChart object and any errors.
func SetupHelmChart ¶
SetupHelmChart creates a new HelmChart for use during an e2e test. Returns a reference to the Image object and any errors.
func (*HelmChart) CopyLocalPackage ¶
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 ¶
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 ¶
RegistryLogin will log into the registry with helm using a gcloud auth token.
func (*HelmChart) SetVersion ¶
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 ¶
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) AddressWithTag ¶
AddressWithTag returns the domain, path, name, and tag of the image
func (*Image) CleanBuildPath ¶
CleanBuildPath creates the r.BuildPath if it doesn't exist and deletes all contents if it does.
func (*Image) ConfigureAuthHelper ¶
ConfigureAuthHelper configures the local docker client to use gcloud for image registry authorization. Helm uses the docker config.
func (*Image) CopyLocalPackage ¶
CopyLocalPackage accepts a local path to a package and recursively copies it to r.BuildPath.
func (*Image) CreateRepository ¶
CreateRepository uses gcloud to create the repository, if it doesn't exist.
func (*Image) Delete ¶
Delete the package from the remote registry, including all versions and tags.
func (*Image) RegistryHost ¶
RegistryHost returns the domain of the artifact registry
func (*Image) RepositoryAddress ¶
RepositoryAddress returns the domain and path to the chart repository
func (*Image) RepositoryOCI ¶
RepositoryOCI returns the repository address with the oci:// scheme prefix.
func (*Image) SetName ¶
SetName updates the local name of the image to the specified name with a random suffix
func (*Image) SetVersion ¶
SetVersion updates the local version of the image to the specified tag with a random suffix