Documentation ¶
Index ¶
- Constants
- Variables
- func GetE2EImages(e2eRegistryConfig, version string) ([]string, error)
- type Client
- type Config
- type ConformanceImageVersion
- type DockerClient
- func (i DockerClient) DeleteImages(images []string, retries int) []error
- func (i DockerClient) DownloadImages(images []string, version string) (string, error)
- func (i DockerClient) PullImages(images []string, retries int) []error
- func (i DockerClient) PushImages(images []TagPair, retries int) []error
- type DryRunClient
- func (i DryRunClient) DeleteImages(images []string, retries int) []error
- func (i DryRunClient) DownloadImages(images []string, version string) (string, error)
- func (i DryRunClient) PullImages(images []string, retries int) []error
- func (i DryRunClient) PushImages(images []TagPair, retries int) []error
- type RegistryList
- type TagPair
Constants ¶
const ( // ConformanceImageVersionAuto represents detecting the server's kubernetes version. ConformanceImageVersionAuto = "auto" // ConformanceImageVersionLatest represents always using the server's latest version. ConformanceImageVersionLatest = "latest" )
Variables ¶
var ( //ErrImageVersionNoClient is the error returned when we need a client but didn't get on ErrImageVersionNoClient = errors.New(`can't use nil client with "auto" image version`) )
Functions ¶
func GetE2EImages ¶ added in v0.17.1
GetE2EImages gets a list of E2E image names
Types ¶
type Client ¶ added in v0.17.1
type Client interface { PullImages(images []string, retries int) []error PushImages(images []TagPair, retries int) []error DownloadImages(images []string, version string) (string, error) DeleteImages(images []string, retries int) []error }
Client is the interface for interacting with images.
func NewDockerClient ¶ added in v0.17.1
func NewDockerClient() Client
NewDockerClient returns a DockerClient that can interact with the local docker installation.
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config holds an image's fully qualified name components registry, name, and tag
func (Config) GetFullyQualifiedImageName ¶ added in v0.17.1
GetFullyQualifiedImageName returns the fully qualified URI to an image (including tag)
type ConformanceImageVersion ¶
type ConformanceImageVersion string
ConformanceImageVersion represents the version of a conformance image, or "auto" to detect the version
func (*ConformanceImageVersion) Get ¶
func (c *ConformanceImageVersion) Get(client discovery.ServerVersionInterface) (string, error)
Get retrieves the preset version if there is one, or queries client if the ConformanceImageVersion is set to `auto`. kubernetes.Interface.Discovery() provides ServerVersionInterface. Don't require the entire kubernetes.Interface to simplify the required test mocks
func (*ConformanceImageVersion) Set ¶
func (c *ConformanceImageVersion) Set(str string) error
Set the ImageVersion to either the string "auto" or a version string
func (*ConformanceImageVersion) String ¶
func (c *ConformanceImageVersion) String() string
String needed for pflag.Value.
func (*ConformanceImageVersion) Type ¶
func (c *ConformanceImageVersion) Type() string
Type needed for pflag.Value.
type DockerClient ¶ added in v0.17.1
type DockerClient struct {
// contains filtered or unexported fields
}
DockerClient is an implementation of Client that uses the local docker installation to interact with images.
func (DockerClient) DeleteImages ¶ added in v0.17.1
func (i DockerClient) DeleteImages(images []string, retries int) []error
DeleteImages deletes the given list of images from the local machine. It will retry for the provided number of retries on failure.
func (DockerClient) DownloadImages ¶ added in v0.17.1
func (i DockerClient) DownloadImages(images []string, version string) (string, error)
DownloadImages exports the list of images to a tar file. The provided version will be included in the resulting file name.
func (DockerClient) PullImages ¶ added in v0.17.1
func (i DockerClient) PullImages(images []string, retries int) []error
PullImages pulls the given list of images, skipping if they are already present on the machine. It will retry for the provided number of retries on failure.
func (DockerClient) PushImages ¶ added in v0.17.1
func (i DockerClient) PushImages(images []TagPair, retries int) []error
PushImages will tag each of the source images as the destination image and push. It will skip the operation if the image source and destination are equal. It will retry for the provided number of retries on failure.
type DryRunClient ¶ added in v0.17.1
type DryRunClient struct{}
DryRunClient is an implementation of Client that logs the image operations that would be performed rather than performing them.
func (DryRunClient) DeleteImages ¶ added in v0.17.1
func (i DryRunClient) DeleteImages(images []string, retries int) []error
DeleteImages logs which images would be deleted.
func (DryRunClient) DownloadImages ¶ added in v0.17.1
func (i DryRunClient) DownloadImages(images []string, version string) (string, error)
DownloadImages logs that the images would be saved and returns the tarball name.
func (DryRunClient) PullImages ¶ added in v0.17.1
func (i DryRunClient) PullImages(images []string, retries int) []error
PullImages logs the images that would be pulled.
func (DryRunClient) PushImages ¶ added in v0.17.1
func (i DryRunClient) PushImages(images []TagPair, retries int) []error
PushImages logs what the images would be tagged and pushed as.
type RegistryList ¶
type RegistryList struct { DockerGluster string `yaml:"dockerGluster,omitempty"` DockerLibraryRegistry string `yaml:"dockerLibraryRegistry,omitempty"` E2eRegistry string `yaml:"e2eRegistry,omitempty"` EtcdRegistry string `yaml:"etcdRegistry,omitempty"` GcAuthenticatedRegistry string `yaml:"gcAuthenticatedRegistry,omitempty"` GcRegistry string `yaml:"gcRegistry,omitempty"` GcrReleaseRegistry string `yaml:"gcrReleaseRegistry,omitempty"` GoogleContainerRegistry string `yaml:"googleContainerRegistry,omitempty"` InvalidRegistry string `yaml:"invalidRegistry,omitempty"` PrivateRegistry string `yaml:"privateRegistry,omitempty"` PromoterE2eRegistry string `yaml:"promoterE2eRegistry"` QuayIncubator string `yaml:"quayIncubator,omitempty"` QuayK8sCSI string `yaml:"quayK8sCSI,omitempty"` SampleRegistry string `yaml:"sampleRegistry,omitempty"` K8sVersion *version.Version `yaml:"-"` Images map[int]Config `yaml:"-"` }
RegistryList holds public and private image registries
func GetDefaultImageRegistries ¶ added in v0.16.5
func GetDefaultImageRegistries(version string) (*RegistryList, error)
GetDefaultImageRegistries returns the default default image registries used for a given version of the Kubernetes E2E tests
func NewRegistryList ¶
func NewRegistryList(repoConfig, k8sVersion string) (*RegistryList, error)
NewRegistryList returns a default registry or one that matches a config file passed
type TagPair ¶ added in v0.17.1
TagPair represents a source image and a destination image that it will be tagged and pushed as.
func GetE2EImageTagPairs ¶ added in v0.17.1
GetE2EImagePairs gets a list of E2E image tag pairs from the default src to custom destination