Documentation ¶
Index ¶
- Variables
- func FindImageDigest(imageID string) (image string, err error)
- func GetHTTPTransport() (transport http.RoundTripper)
- func GetImage(ref name.Reference) (v1.Image, error)
- func ImageDigest(ref name.Reference) (string, error)
- func IsValidImageDigest(imageID string) bool
- func LoadDockerRegistrySecret(bytes []byte) error
- func NewKeychain() authn.Keychain
- func ParseReferenceOptions() []name.Option
- type DockerConfig
- type DockerConfigEntry
- type DockerConfigJSON
- type DockerRegistryWatcher
Constants ¶
This section is empty.
Variables ¶
var AnonymousAuth = DockerConfigEntry{}
AnonymousAuth is an empty entry for unknown registries
var DockerCfgAuths = DockerConfig{}
DockerCfgAuths stores all available registries and their auths
var DockerImageDigestRe = regexp.MustCompile("(sha256:?)?[a-fA-F0-9]{64}")
DockerImageDigestRe regexp extracts docker image digest from string
var DockerPullableDigestRe = regexp.MustCompile("docker-pullable://.*@sha256:[a-fA-F0-9]{64}")
DockerPullableDigestRe detects if imageId field contains image digest
var KubeDigestRe = regexp.MustCompile(".*@sha256:[a-fA-F0-9]{64}")
KubeDigestRe detects if imageId field sha256 digest
Functions ¶
func FindImageDigest ¶
Поиск digest в строке. Учитывается специфика kubernetes — если есть префикс docker-pullable://, то в строке digest. Если префикс docker:// или нет префикса, то скорее всего там imageId, который нельзя применить для обновления, поэтому возвращается ошибка Пример строки с digest из kubernetes: docker-pullable://registry/repo:tag@sha256:DIGEST-HASH
func GetHTTPTransport ¶
func GetHTTPTransport() (transport http.RoundTripper)
func IsValidImageDigest ¶
Проверка, что строка это docker digest
func NewKeychain ¶
func ParseReferenceOptions ¶
Types ¶
type DockerConfig ¶
type DockerConfig map[string]DockerConfigEntry
DockerConfig represents the config file used by the docker CLI. This config that represents the credentials that should be used when pulling images from specific image repositories.
type DockerConfigEntry ¶
type DockerConfigEntry struct { Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` Auth string `json:"auth,omitempty"` // Email is an optional value associated with the username. // This field is deprecated and will be removed in a later // version of docker. Email string `json:"email,omitempty"` ServerAddress string `json:"serveraddress,omitempty"` // IdentityToken is used to authenticate the user and get // an access token for the registry. IdentityToken string `json:"identitytoken,omitempty"` // RegistryToken is a bearer token to be sent to a registry RegistryToken string `json:"registrytoken,omitempty"` }
type DockerConfigJSON ¶
type DockerConfigJSON struct { Auths DockerConfig `json:"auths"` XXX map[string]interface{} `yaml:",inline"` }
DockerConfigJSON represents a local docker auth config file for pulling images.
type DockerRegistryWatcher ¶
type DockerRegistryWatcher interface { WithContext(ctx context.Context) WithRegistrySecretPath(string) WithErrorCallback(errorCb func()) WithFatalCallback(fatalCb func()) WithSuccessCallback(successCb func()) WithImageInfoCallback(imageInfoCb func() (string, string)) WithImageUpdatedCallback(imageUpdatedCb func(string)) Init() error Start() Stop() }
func NewDockerRegistryWatcher ¶
func NewDockerRegistryWatcher() DockerRegistryWatcher
InitRegistryManager получает имя образа по имени пода и запрашивает id этого образа.