Skip to content

Commit d29a1bc

Browse files
committed
Move sandbox info to cri types packages
Signed-off-by: Derek McGowan <[email protected]>
1 parent 9795677 commit d29a1bc

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

integration/main_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import (
5151
dialer "github.com/containerd/containerd/v2/integration/remote/util"
5252
criconfig "github.com/containerd/containerd/v2/pkg/cri/config"
5353
"github.com/containerd/containerd/v2/pkg/cri/constants"
54-
"github.com/containerd/containerd/v2/pkg/cri/server/base"
54+
"github.com/containerd/containerd/v2/pkg/cri/types"
5555
"github.com/containerd/containerd/v2/pkg/cri/util"
5656
)
5757

@@ -686,7 +686,7 @@ func CRIConfig() (*criconfig.Config, error) {
686686
}
687687

688688
// SandboxInfo gets sandbox info.
689-
func SandboxInfo(id string) (*runtime.PodSandboxStatus, *base.SandboxInfo, error) {
689+
func SandboxInfo(id string) (*runtime.PodSandboxStatus, *types.SandboxInfo, error) {
690690
client, err := RawRuntimeClient()
691691
if err != nil {
692692
return nil, nil, fmt.Errorf("failed to get raw runtime client: %w", err)
@@ -699,7 +699,7 @@ func SandboxInfo(id string) (*runtime.PodSandboxStatus, *base.SandboxInfo, error
699699
return nil, nil, fmt.Errorf("failed to get sandbox status: %w", err)
700700
}
701701
status := resp.GetStatus()
702-
var info base.SandboxInfo
702+
var info types.SandboxInfo
703703
if err := json.Unmarshal([]byte(resp.GetInfo()["info"]), &info); err != nil {
704704
return nil, nil, fmt.Errorf("failed to unmarshal sandbox info: %w", err)
705705
}

integration/sandbox_run_rollback_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import (
3636
criapiv1 "k8s.io/cri-api/pkg/apis/runtime/v1"
3737

3838
"github.com/containerd/containerd/v2/internal/failpoint"
39-
"github.com/containerd/containerd/v2/pkg/cri/server/base"
39+
"github.com/containerd/containerd/v2/pkg/cri/types"
4040
)
4141

4242
const (
@@ -299,7 +299,7 @@ func TestRunPodSandboxAndTeardownCNISlow(t *testing.T) {
299299
}
300300

301301
// sbserverSandboxInfo gets sandbox info.
302-
func sbserverSandboxInfo(id string) (*criapiv1.PodSandboxStatus, *base.SandboxInfo, error) {
302+
func sbserverSandboxInfo(id string) (*criapiv1.PodSandboxStatus, *types.SandboxInfo, error) {
303303
client, err := RawRuntimeClient()
304304
if err != nil {
305305
return nil, nil, fmt.Errorf("failed to get raw runtime client: %w", err)
@@ -312,7 +312,7 @@ func sbserverSandboxInfo(id string) (*criapiv1.PodSandboxStatus, *base.SandboxIn
312312
return nil, nil, fmt.Errorf("failed to get sandbox status: %w", err)
313313
}
314314
status := resp.GetStatus()
315-
var info base.SandboxInfo
315+
var info types.SandboxInfo
316316
if err := json.Unmarshal([]byte(resp.GetInfo()["info"]), &info); err != nil {
317317
return nil, nil, fmt.Errorf("failed to unmarshal sandbox info: %w", err)
318318
}

pkg/cri/server/podsandbox/sandbox_status.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ import (
2626
containerd "github.com/containerd/containerd/v2/client"
2727
"github.com/containerd/containerd/v2/core/containers"
2828
"github.com/containerd/containerd/v2/core/sandbox"
29-
"github.com/containerd/containerd/v2/pkg/cri/server/base"
3029
"github.com/containerd/containerd/v2/pkg/cri/server/podsandbox/types"
30+
critypes "github.com/containerd/containerd/v2/pkg/cri/types"
3131
"github.com/containerd/errdefs"
3232
)
3333

@@ -63,7 +63,7 @@ func (c *Controller) Status(ctx context.Context, sandboxID string, verbose bool)
6363

6464
// toCRISandboxInfo converts internal container object information to CRI sandbox status response info map.
6565
func toCRISandboxInfo(ctx context.Context, sb *types.PodSandbox) (map[string]string, error) {
66-
si := &base.SandboxInfo{
66+
si := &critypes.SandboxInfo{
6767
Pid: sb.Pid,
6868
Config: sb.Metadata.Config,
6969
RuntimeHandler: sb.Metadata.RuntimeHandler,

pkg/cri/server/sandbox_status.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ import (
2424

2525
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
2626

27-
"github.com/containerd/containerd/v2/pkg/cri/server/base"
2827
sandboxstore "github.com/containerd/containerd/v2/pkg/cri/store/sandbox"
28+
"github.com/containerd/containerd/v2/pkg/cri/types"
2929
"github.com/containerd/errdefs"
3030
)
3131

@@ -152,7 +152,7 @@ func toCRISandboxStatus(meta sandboxstore.Metadata, status string, createdAt tim
152152
// but if controller.Status() returns a NotFound error,
153153
// we should fallback to get SandboxInfo from cached sandbox itself.
154154
func toDeletedCRISandboxInfo(sandbox sandboxstore.Sandbox) (map[string]string, error) {
155-
si := &base.SandboxInfo{
155+
si := &types.SandboxInfo{
156156
Pid: sandbox.Status.Get().Pid,
157157
Config: sandbox.Config,
158158
RuntimeHandler: sandbox.RuntimeHandler,

pkg/cri/types/sandbox_info.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package base
17+
package types
1818

1919
import (
2020
"github.com/containerd/go-cni"

0 commit comments

Comments
 (0)