Documentation ¶
Index ¶
- func CloneRetryableClient(retryClient *rhttp.Client) *rhttp.Client
- func ParseAlphaAuth(auth *runtime_alpha.AuthConfig, host string) (string, string, error)
- func ParseAuth(auth *runtime.AuthConfig, host string) (string, string, error)
- type AuthConfig
- type Credential
- type Mirror
- type Registry
- type RegistryConfig
- type RegistryHosts
- type RegistryManager
- type TLSConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloneRetryableClient ¶ added in v0.5.0
CloneRetryableClient returns a clone of a given retryable client with the same set of retry policies and a new concrete http.Client.
func ParseAlphaAuth ¶ added in v0.5.0
func ParseAlphaAuth(auth *runtime_alpha.AuthConfig, host string) (string, string, error)
ParseAlphaAuth parses AuthConfig and returns username and password/secret required by containerd. Ported from https://github.com/containerd/containerd/blob/v1.5.2/pkg/cri/server/image_pull.go#L176-L214 TODO: import this from CRI package once we drop support to continerd v1.4.x
func ParseAuth ¶
ParseAuth parses AuthConfig and returns username and password/secret required by containerd. Ported from https://github.com/containerd/containerd/blob/v1.5.2/pkg/cri/server/image_pull.go#L176-L214 TODO: import this from CRI package once we drop support to continerd v1.4.x
Types ¶
type AuthConfig ¶
type AuthConfig struct { // Username is the username to login the registry. Username string `toml:"username" json:"username"` // Password is the password to login the registry. Password string `toml:"password" json:"password"` // Auth is a base64 encoded string from the concatenation of the username, // a colon, and the password. Auth string `toml:"auth" json:"auth"` // IdentityToken is used to authenticate the user and get // an access token for the registry. IdentityToken string `toml:"identitytoken" json:"identitytoken"` }
AuthConfig contains the config related to authentication to a specific registry
type Credential ¶
Credential returns a set of credentials for a given image.
type Mirror ¶
type Mirror struct { // Endpoints are endpoints for a namespace. CRI plugin will try the endpoints // one by one until a working one is found. The endpoint must be a valid url // with host specified. // The scheme, host and path from the endpoint URL will be used. Endpoints []string `toml:"endpoint" json:"endpoint"` }
Mirror contains the config related to the registry mirror
type Registry ¶
type Registry struct { // ConfigPath is a path to the root directory containing registry-specific // configurations. // If ConfigPath is set, the rest of the registry specific options are ignored. ConfigPath string `toml:"config_path" json:"configPath"` // Mirrors are namespace to mirror mapping for all namespaces. // This option will not be used when ConfigPath is provided. // DEPRECATED: Use ConfigPath instead. Remove in containerd 1.7. Mirrors map[string]Mirror `toml:"mirrors" json:"mirrors"` // Configs are configs for each registry. // The key is the domain name or IP of the registry. // This option will be fully deprecated for ConfigPath in the future. Configs map[string]RegistryConfig `toml:"configs" json:"configs"` }
Registry is registry settings configured
type RegistryConfig ¶
type RegistryConfig struct { // Auth contains information to authenticate to the registry. Auth *AuthConfig `toml:"auth" json:"auth"` // TLS is a pair of CA/Cert/Key which then are used when creating the transport // that communicates with the registry. // This field will not be used when ConfigPath is provided. // DEPRECATED: Use ConfigPath instead. Remove in containerd 1.7. TLS *TLSConfig `toml:"tls" json:"tls"` }
RegistryConfig contains configuration used to communicate with the registry.
type RegistryHosts ¶ added in v0.5.0
type RegistryHosts func(imgRefSpec reference.Spec) ([]docker.RegistryHost, error)
RegistryHosts returns configurations for registry hosts that provide a given image.
func RegistryHostsFromCRIConfig ¶
func RegistryHostsFromCRIConfig(ctx context.Context, config Registry, credsFuncs ...Credential) RegistryHosts
RegistryHostsFromCRIConfig creates RegistryHosts (a set of registry configuration) from CRI-plugin-compatible config. NOTE: ported from https://github.com/containerd/containerd/blob/v1.5.2/pkg/cri/server/image_pull.go#L332-L405 TODO: import this from CRI package once we drop support to continerd v1.4.x
type RegistryManager ¶ added in v0.5.0
type RegistryManager struct {
// contains filtered or unexported fields
}
RegistryManager contains the configurations that outline how remote registry operations should behave. It contains a global retryable client that will be used for all registry requests.
func NewRegistryManager ¶ added in v0.5.0
func NewRegistryManager(httpConfig config.RetryableHTTPClientConfig, registryConfig config.ResolverConfig, credsFuncs []Credential) *RegistryManager
NewRegistryManager returns a new RegistryManager
func (*RegistryManager) AsRegistryHosts ¶ added in v0.5.0
func (rm *RegistryManager) AsRegistryHosts() RegistryHosts
AsRegistryHosts returns a RegistryHosts type responsible for returning configurations for registries that contain a given image with respect to the configurations present in RegistryManager.
type TLSConfig ¶
type TLSConfig struct { InsecureSkipVerify bool `toml:"insecure_skip_verify" json:"insecure_skip_verify"` CAFile string `toml:"ca_file" json:"caFile"` CertFile string `toml:"cert_file" json:"certFile"` KeyFile string `toml:"key_file" json:"keyFile"` }
TLSConfig contains the CA/Cert/Key used for a registry