diff --git a/internal/cri/server/container_checkpoint_linux.go b/internal/cri/server/container_checkpoint_linux.go index 4884e15ab0..0e207d6c66 100644 --- a/internal/cri/server/container_checkpoint_linux.go +++ b/internal/cri/server/container_checkpoint_linux.go @@ -42,6 +42,7 @@ import ( containerstore "github.com/containerd/containerd/v2/internal/cri/store/container" imagestore "github.com/containerd/containerd/v2/internal/cri/store/image" "github.com/containerd/containerd/v2/internal/cri/store/sandbox" + critypes "github.com/containerd/containerd/v2/internal/cri/types" "github.com/containerd/containerd/v2/pkg/archive" "github.com/containerd/containerd/v2/pkg/protobuf/proto" ptypes "github.com/containerd/containerd/v2/pkg/protobuf/types" @@ -56,7 +57,6 @@ import ( v1 "github.com/opencontainers/image-spec/specs-go/v1" spec "github.com/opencontainers/runtime-spec/specs-go" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" - kubetypes "k8s.io/kubelet/pkg/types" ) // checkIfCheckpointOCIImage returns checks if the input refers to a checkpoint image. @@ -258,11 +258,11 @@ func (c *criService) CRImportCheckpoint( sandboxUID := sandboxConfig.GetMetadata().GetUid() if sandboxUID != "" { - if _, ok := originalLabels[kubetypes.KubernetesPodUIDLabel]; ok { - originalLabels[kubetypes.KubernetesPodUIDLabel] = sandboxUID + if _, ok := originalLabels[critypes.KubernetesPodUIDLabel]; ok { + originalLabels[critypes.KubernetesPodUIDLabel] = sandboxUID } - if _, ok := originalAnnotations[kubetypes.KubernetesPodUIDLabel]; ok { - originalAnnotations[kubetypes.KubernetesPodUIDLabel] = sandboxUID + if _, ok := originalAnnotations[critypes.KubernetesPodUIDLabel]; ok { + originalAnnotations[critypes.KubernetesPodUIDLabel] = sandboxUID } } @@ -270,11 +270,11 @@ func (c *criService) CRImportCheckpoint( fixupLabels := []string{ // Update the container name. It has already been update in metadata.Name. // It also needs to be updated in the container labels. - kubetypes.KubernetesContainerNameLabel, + critypes.KubernetesContainerNameLabel, // Update pod name in the labels. - kubetypes.KubernetesPodNameLabel, + critypes.KubernetesPodNameLabel, // Also update namespace. - kubetypes.KubernetesPodNamespaceLabel, + critypes.KubernetesPodNamespaceLabel, } for _, annotation := range fixupLabels { diff --git a/vendor/k8s.io/kubelet/pkg/types/labels.go b/internal/cri/types/labels.go similarity index 74% rename from vendor/k8s.io/kubelet/pkg/types/labels.go rename to internal/cri/types/labels.go index 79f80b1e62..3ac123733e 100644 --- a/vendor/k8s.io/kubelet/pkg/types/labels.go +++ b/internal/cri/types/labels.go @@ -1,3 +1,19 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + /* Copyright 2016 The Kubernetes Authors. diff --git a/vendor/modules.txt b/vendor/modules.txt index 3a5feb851f..56ce891776 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -872,7 +872,6 @@ k8s.io/klog/v2/internal/sloghandler k8s.io/kubelet/pkg/cri/streaming k8s.io/kubelet/pkg/cri/streaming/portforward k8s.io/kubelet/pkg/cri/streaming/remotecommand -k8s.io/kubelet/pkg/types # k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 ## explicit; go 1.18 k8s.io/utils/clock