Documentation ¶
Index ¶
- Constants
- func AssertDeletedStorageFiles(deleted, expected *RegistryStorageFiles) error
- func BuildAndPushChildImage(oc *exutil.CLI, dClient *dockerclient.Client, parent string, name, tag string, ...) (string, string, error)
- func BuildAndPushImageOfSizeWithBuilder(oc *exutil.CLI, dClient *dockerclient.Client, namespace, name, tag string, ...) error
- func BuildAndPushImageOfSizeWithDocker(oc *exutil.CLI, dClient *dockerclient.Client, name, tag string, size uint64, ...) (string, string, error)
- func ConfigureRegistry(oc *exutil.CLI, desiredState RegistryConfiguration) (bool, error)
- func DoesRegistryAcceptSchema2(oc *exutil.CLI) (bool, error)
- func EnsureRegistryAcceptsSchema2(oc *exutil.CLI, accept bool) (bool, error)
- func GetDockerRegistryURL(oc *exutil.CLI) (string, error)
- func GetImageLabels(c imagetypedclientset.ImageStreamImageInterface, ...) (map[string]string, error)
- func GetRegistryPod(podsGetter kcoreclient.PodsGetter) (*kapiv1.Pod, error)
- func GetRegistryStorageSize(oc *exutil.CLI) (int64, error)
- func IsBlobStoredInRegistry(oc *exutil.CLI, dgst godigest.Digest, repository string) (bool, bool, error)
- func IsEmptyDigest(dgst godigest.Digest) bool
- func LogRegistryPod(oc *exutil.CLI) error
- func MirrorBlobInRegistry(oc *exutil.CLI, dgst godigest.Digest, repository string, timeout time.Duration) error
- func RedeployRegistry(oc *exutil.CLI) (bool, error)
- type CleanUpContainer
- type RegistryConfiguration
- type RegistryStorageFiles
- type RepoLinks
Constants ¶
const (
AcceptSchema2EnvVar = "REGISTRY_MIDDLEWARE_REPOSITORY_OPENSHIFT_ACCEPTSCHEMA2"
)
Variables ¶
This section is empty.
Functions ¶
func AssertDeletedStorageFiles ¶
func AssertDeletedStorageFiles(deleted, expected *RegistryStorageFiles) error
AssertDeletedStorageFiles compares lists of deleted files against expected. An error will be generated for each entry present in just one of these sets.
func BuildAndPushChildImage ¶
func BuildAndPushChildImage( oc *exutil.CLI, dClient *dockerclient.Client, parent string, name, tag string, numberOfNewLayers int, outSink io.Writer, removeBuiltImage bool, ) (string, string, error)
BuildAndPushChildImage tries to build and push an image of given name and number of layers. It instructs Docker daemon directly. Built image is stored as an image stream tag <name>:<tag>. Returned is an image digest, its ID (docker daemon's internal representation) and an error if any.
func BuildAndPushImageOfSizeWithBuilder ¶ added in v1.3.0
func BuildAndPushImageOfSizeWithBuilder( oc *exutil.CLI, dClient *dockerclient.Client, namespace, name, tag string, size uint64, numberOfLayers int, shouldSucceed bool, ) error
BuildAndPushImageOfSizeWithBuilder tries to build an image of wanted size and number of layers. Built image is stored as an image stream tag <name>:<tag>. If shouldSucceed is false, a build is expected to fail with a denied error. Note the size is only approximate. Resulting image size will be different depending on used compression algorithm and metadata overhead.
func BuildAndPushImageOfSizeWithDocker ¶ added in v1.3.0
func BuildAndPushImageOfSizeWithDocker( oc *exutil.CLI, dClient *dockerclient.Client, name, tag string, size uint64, numberOfLayers int, outSink io.Writer, shouldSucceed bool, removeBuiltImage bool, ) (string, string, error)
BuildAndPushImageOfSizeWithDocker tries to build an image of wanted size and number of layers. It instructs Docker daemon directly. Built image is stored as an image stream tag <name>:<tag>. If shouldSucceed is false, a push is expected to fail with a denied error. Note the size is only approximate. Resulting image size will be different depending on used compression algorithm and metadata overhead. Returned is an image digest, its ID (docker daemon's internal representation) and an error if any.
func ConfigureRegistry ¶
func ConfigureRegistry(oc *exutil.CLI, desiredState RegistryConfiguration) (bool, error)
ConfigureRegistry re-deploys the registry pod if its configuration doesn't match the desiredState. The function blocks until the registry is ready.
func DoesRegistryAcceptSchema2 ¶
DoesRegistryAcceptSchema2 returns true if the integrated registry is configured to accept manifest V2 schema 2.
func EnsureRegistryAcceptsSchema2 ¶
EnsureRegistryAcceptsSchema2 checks whether the registry is configured to accept manifests V2 schema 2 or not. If the result doesn't match given accept argument, registry's deployment config will be updated accordingly and the function will block until the registry have been re-deployed and ready for new requests.
func GetDockerRegistryURL ¶ added in v1.3.0
GetDockerRegistryURL returns a cluster URL of internal docker registry if available.
func GetImageLabels ¶
func GetImageLabels(c imagetypedclientset.ImageStreamImageInterface, imageRepoName, imageRef string) (map[string]string, error)
GetImageLabels retrieves Docker labels from image from image repository name and image reference
func GetRegistryPod ¶
func GetRegistryPod(podsGetter kcoreclient.PodsGetter) (*kapiv1.Pod, error)
GetRegistryPod returns the youngest registry pod deployed.
func GetRegistryStorageSize ¶
GetRegistryStorageSize returns a number of bytes occupied by registry's data on its filesystem.
func IsBlobStoredInRegistry ¶
func IsBlobStoredInRegistry( oc *exutil.CLI, dgst godigest.Digest, repository string, ) (bool, bool, error)
IsBlobStoredInRegistry verifies a presence of the given blob on registry's storage. The registry must be deployed with a filesystem storage driver. If repository is given, the presence will be verified also for layer link inside the ${repository}/_layers directory. First returned bool says whether the blob is present globally in the registry's storage. The second says whether the blob is linked in the given repository.
func IsEmptyDigest ¶
IsEmptyDigest returns true if the given digest matches one of empty blobs.
func LogRegistryPod ¶
LogRegistryPod attempts to write registry log to a file in artifacts directory.
func MirrorBlobInRegistry ¶
func MirrorBlobInRegistry(oc *exutil.CLI, dgst godigest.Digest, repository string, timeout time.Duration) error
MirrorBlobInRegistry forces a blob of external image to be mirrored in the registry. The function expects the blob not to exist before a GET request is issued. The function blocks until the blob is mirrored or the given timeout passes.
Types ¶
type CleanUpContainer ¶
CleanUpContainer holds names of image names, docker image IDs, imagestreamtags and imagestreams that shall be deleted at the end of the test.
func NewCleanUpContainer ¶
func NewCleanUpContainer(oc *exutil.CLI) *CleanUpContainer
NewCleanUpContainer creates a new instance of CleanUpContainer.
func (*CleanUpContainer) AddImage ¶
func (c *CleanUpContainer) AddImage(name, id, isTag string)
AddImage marks given image name, docker image id and imagestreamtag as candidates for deletion.
func (*CleanUpContainer) AddImageStream ¶
func (c *CleanUpContainer) AddImageStream(isName string)
AddImageStream marks the given image stream name for removal.
type RegistryConfiguration ¶
RegistriConfiguration holds desired configuration options for the integrated registry. *nil* stands for "no change".
type RegistryStorageFiles ¶
type RegistryStorageFiles struct { Repos []string ManifestLinks RepoLinks LayerLinks RepoLinks Blobs []string }
func RunHardPrune ¶
func RunHardPrune(oc *exutil.CLI, dryRun bool) (*RegistryStorageFiles, error)
RunHardPrune executes into a docker-registry pod and runs a garbage collector. The docker-registry is assumed to be in a read-only mode and using filesystem as a storage driver. It returns lists of deleted files.
func (*RegistryStorageFiles) Len ¶
func (sfs *RegistryStorageFiles) Len() int
Len returns a number of files contained in the sfs container.
func (*RegistryStorageFiles) ToPaths ¶
func (sfs *RegistryStorageFiles) ToPaths(root string) []string
ToPaths returns a list of paths of files contained in _sfs_ corresponding to their location in registry pod's storage under _root_ directory.