Пример #1
0
// PullImage pulls an image with authentication config.
func (ds *dockerService) PullImage(image *runtimeapi.ImageSpec, auth *runtimeapi.AuthConfig) error {
	return ds.client.PullImage(image.GetImage(),
		dockertypes.AuthConfig{
			Username:      auth.GetUsername(),
			Password:      auth.GetPassword(),
			ServerAddress: auth.GetServerAddress(),
			IdentityToken: auth.GetIdentityToken(),
			RegistryToken: auth.GetRegistryToken(),
		},
		dockertypes.ImagePullOptions{},
	)
}
Пример #2
0
// PullImage pulls a image with authentication config.
func (ds *dockerService) PullImage(image *runtimeApi.ImageSpec, auth *runtimeApi.AuthConfig) error {
	// TODO: add default tags for images or should this be done by kubelet?
	return ds.client.PullImage(image.GetImage(),
		dockertypes.AuthConfig{
			Username:      auth.GetUsername(),
			Password:      auth.GetPassword(),
			ServerAddress: auth.GetServerAddress(),
			IdentityToken: auth.GetIdentityToken(),
			RegistryToken: auth.GetRegistryToken(),
		},
		dockertypes.ImagePullOptions{},
	)
}
Пример #3
0
// PullImage pulls an image with authentication config.
func (ds *dockerService) PullImage(image *runtimeapi.ImageSpec, auth *runtimeapi.AuthConfig) (string, error) {
	err := ds.client.PullImage(image.GetImage(),
		dockertypes.AuthConfig{
			Username:      auth.GetUsername(),
			Password:      auth.GetPassword(),
			ServerAddress: auth.GetServerAddress(),
			IdentityToken: auth.GetIdentityToken(),
			RegistryToken: auth.GetRegistryToken(),
		},
		dockertypes.ImagePullOptions{},
	)
	if err != nil {
		return "", err
	}

	return dockertools.GetImageRef(ds.client, image.GetImage())
}