Pass runtimehandler from CRI pull image request
Starting with k8s cri-api v0.29.1, CRI supports new runtime handler flag Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
This commit is contained in:
@@ -140,7 +140,7 @@ type ImageManagerService interface {
|
||||
// ImageStatus returns the status of the image.
|
||||
ImageStatus(image *runtimeapi.ImageSpec, opts ...grpc.CallOption) (*runtimeapi.Image, error)
|
||||
// PullImage pulls an image with the authentication config.
|
||||
PullImage(image *runtimeapi.ImageSpec, auth *runtimeapi.AuthConfig, podSandboxConfig *runtimeapi.PodSandboxConfig, opts ...grpc.CallOption) (string, error)
|
||||
PullImage(image *runtimeapi.ImageSpec, auth *runtimeapi.AuthConfig, podSandboxConfig *runtimeapi.PodSandboxConfig, runtimeHandler string, opts ...grpc.CallOption) (string, error)
|
||||
// RemoveImage removes the image.
|
||||
RemoveImage(image *runtimeapi.ImageSpec, opts ...grpc.CallOption) error
|
||||
// ImageFsInfo returns information of the filesystem that is used to store images.
|
||||
|
||||
@@ -92,7 +92,7 @@ func testCRIImagePullTimeoutBySlowCommitWriter(t *testing.T) {
|
||||
|
||||
ctx := namespaces.WithNamespace(logtest.WithT(context.Background(), t), k8sNamespace)
|
||||
|
||||
_, err = criService.PullImage(ctx, pullProgressTestImageName, nil, nil)
|
||||
_, err = criService.PullImage(ctx, pullProgressTestImageName, nil, nil, "")
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ func testCRIImagePullTimeoutByHoldingContentOpenWriter(t *testing.T) {
|
||||
go func() {
|
||||
defer close(errCh)
|
||||
|
||||
_, err := criService.PullImage(ctx, pullProgressTestImageName, nil, nil)
|
||||
_, err := criService.PullImage(ctx, pullProgressTestImageName, nil, nil, "")
|
||||
errCh <- err
|
||||
}()
|
||||
|
||||
@@ -294,7 +294,7 @@ func testCRIImagePullTimeoutByNoDataTransferred(t *testing.T) {
|
||||
dctx, _, err := cli.WithLease(ctx)
|
||||
assert.NoError(t, err)
|
||||
|
||||
_, err = criService.PullImage(dctx, fmt.Sprintf("%s/%s", mirrorURL.Host, "containerd/volume-ownership:2.1"), nil, nil)
|
||||
_, err = criService.PullImage(dctx, fmt.Sprintf("%s/%s", mirrorURL.Host, "containerd/volume-ownership:2.1"), nil, nil, "")
|
||||
|
||||
assert.Equal(t, context.Canceled, errors.Unwrap(err), "[%v] expected canceled error, but got (%v)", idx, err)
|
||||
assert.True(t, mirrorSrv.limiter.clearHitCircuitBreaker(), "[%v] expected to hit circuit breaker", idx)
|
||||
|
||||
@@ -735,7 +735,7 @@ func EnsureImageExists(t *testing.T, imageName string) string {
|
||||
}
|
||||
|
||||
t.Logf("Pull test image %q", imageName)
|
||||
imgID, err := imageService.PullImage(&runtime.ImageSpec{Image: imageName}, nil, nil)
|
||||
imgID, err := imageService.PullImage(&runtime.ImageSpec{Image: imageName}, nil, nil, "")
|
||||
require.NoError(t, err)
|
||||
|
||||
return imgID
|
||||
|
||||
@@ -116,7 +116,7 @@ func shouldRecoverAllThePodsAfterUpgrade(t *testing.T, criRuntimeService cri.Run
|
||||
var busyboxImage = images.Get(images.BusyBox)
|
||||
|
||||
t.Logf("Pulling image %q", busyboxImage)
|
||||
_, err := criImageService.PullImage(&criruntime.ImageSpec{Image: busyboxImage}, nil, nil)
|
||||
_, err := criImageService.PullImage(&criruntime.ImageSpec{Image: busyboxImage}, nil, nil, "")
|
||||
require.NoError(t, err)
|
||||
|
||||
t.Log("Create first sandbox")
|
||||
@@ -195,7 +195,7 @@ func execToExistingContainer(t *testing.T, criRuntimeService cri.RuntimeService,
|
||||
var busyboxImage = images.Get(images.BusyBox)
|
||||
|
||||
t.Logf("Pulling image %q", busyboxImage)
|
||||
_, err := criImageService.PullImage(&criruntime.ImageSpec{Image: busyboxImage}, nil, nil)
|
||||
_, err := criImageService.PullImage(&criruntime.ImageSpec{Image: busyboxImage}, nil, nil, "")
|
||||
require.NoError(t, err)
|
||||
t.Log("Create sandbox")
|
||||
sbConfig := PodSandboxConfig("sandbox", "running")
|
||||
@@ -263,7 +263,7 @@ func shouldManipulateContainersInPodAfterUpgrade(t *testing.T, criRuntimeService
|
||||
var busyboxImage = images.Get(images.BusyBox)
|
||||
|
||||
t.Logf("Pulling image %q", busyboxImage)
|
||||
_, err := criImageService.PullImage(&criruntime.ImageSpec{Image: busyboxImage}, nil, nil)
|
||||
_, err := criImageService.PullImage(&criruntime.ImageSpec{Image: busyboxImage}, nil, nil, "")
|
||||
require.NoError(t, err)
|
||||
|
||||
t.Log("Create a sandbox")
|
||||
@@ -353,7 +353,7 @@ func shouldRecoverExistingImages(t *testing.T, criRuntimeService cri.RuntimeServ
|
||||
expectedRefs := []string{}
|
||||
for _, img := range images {
|
||||
t.Logf("Pulling image %q", img)
|
||||
imgRef, err := criImageService.PullImage(&criruntime.ImageSpec{Image: img}, nil, nil)
|
||||
imgRef, err := criImageService.PullImage(&criruntime.ImageSpec{Image: img}, nil, nil, "")
|
||||
require.NoError(t, err)
|
||||
expectedRefs = append(expectedRefs, imgRef)
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ func (r *ImageService) ImageStatus(image *runtimeapi.ImageSpec, opts ...grpc.Cal
|
||||
}
|
||||
|
||||
// PullImage pulls an image with authentication config.
|
||||
func (r *ImageService) PullImage(image *runtimeapi.ImageSpec, auth *runtimeapi.AuthConfig, podSandboxConfig *runtimeapi.PodSandboxConfig, opts ...grpc.CallOption) (string, error) {
|
||||
func (r *ImageService) PullImage(image *runtimeapi.ImageSpec, auth *runtimeapi.AuthConfig, podSandboxConfig *runtimeapi.PodSandboxConfig, runtimeHandler string, opts ...grpc.CallOption) (string, error) {
|
||||
ctx, cancel := getContextWithCancel()
|
||||
defer cancel()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user