Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.
This repository was archived by the owner on May 12, 2021. It is now read-only.

Refactoring code to extract shim related operations to a separate package #890

@zsc-hw

Description

@zsc-hw

Description of problem

Code refactoring: extract code from shim related functions from virtcontainers package to shim package

  1. extract basic structure types to "virtcontainers/pkg/types".
    For example, the "Cmd", "EnvVar", "Linux Capabilities" structure types in the virtcontainers/pkg/types/sandbox.go file are extracted from the virtcontainers/sandbox.go file as common structure types.
  2. "virtcontainers/shim" package is used to store shim related function code. include ccShim、kataBuiltInShim、kataShim、noopShim

Expected result

Reduce the code coupling of "virtcontainers" package and extract the shim related code to an independent package.

Actual result

1.The shim related function code is extracted to the independent package(virtcontainers/shim).
2."Cmd", "EnvVar", "Linux Capabilities","Process"structure types is extracted to the "virtcontainers/pkg/types" package
3.Shim related unit tests are still in the “virtcontainers” directory(include kata_shim_test.go, noop_shim_test.go, shim_test.go, cc_shim_test.go). If put these unit test files in the "virtcontainers/shim" directory, there will be circular dependencies, so keep these files in the "virtcontainers" directory for the time being.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions