mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-02 03:08:15 +00:00
Merge pull request #90061 from marosset/runtimehandler-image-spec-annotations
Add annotations to CRI ImageSpec objects
This commit is contained in:
@@ -17,7 +17,7 @@ limitations under the License.
|
||||
package kuberuntime
|
||||
|
||||
import (
|
||||
"k8s.io/api/core/v1"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
utilerrors "k8s.io/apimachinery/pkg/util/errors"
|
||||
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
|
||||
"k8s.io/klog/v2"
|
||||
@@ -40,7 +40,8 @@ func (m *kubeGenericRuntimeManager) PullImage(image kubecontainer.ImageSpec, pul
|
||||
return "", err
|
||||
}
|
||||
|
||||
imgSpec := &runtimeapi.ImageSpec{Image: img}
|
||||
imgSpec := toRuntimeAPIImageSpec(image)
|
||||
|
||||
creds, withCredentials := keyring.Lookup(repoToPull)
|
||||
if !withCredentials {
|
||||
klog.V(3).Infof("Pulling image %q without credentials", img)
|
||||
@@ -80,7 +81,7 @@ func (m *kubeGenericRuntimeManager) PullImage(image kubecontainer.ImageSpec, pul
|
||||
// GetImageRef gets the ID of the image which has already been in
|
||||
// the local storage. It returns ("", nil) if the image isn't in the local storage.
|
||||
func (m *kubeGenericRuntimeManager) GetImageRef(image kubecontainer.ImageSpec) (string, error) {
|
||||
status, err := m.imageService.ImageStatus(&runtimeapi.ImageSpec{Image: image.Image})
|
||||
status, err := m.imageService.ImageStatus(toRuntimeAPIImageSpec(image))
|
||||
if err != nil {
|
||||
klog.Errorf("ImageStatus for image %q failed: %v", image, err)
|
||||
return "", err
|
||||
@@ -107,6 +108,7 @@ func (m *kubeGenericRuntimeManager) ListImages() ([]kubecontainer.Image, error)
|
||||
Size: int64(img.Size_),
|
||||
RepoTags: img.RepoTags,
|
||||
RepoDigests: img.RepoDigests,
|
||||
Spec: toKubeContainerImageSpec(img),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user