From e6aac8390efb11b84e095bd945b364fe7548f3f7 Mon Sep 17 00:00:00 2001 From: Julio Montes Date: Tue, 26 May 2020 00:32:58 -0700 Subject: [PATCH] virtcontainers: remove all the code related to HasCRIContainerType All the code related to HasCRIContainerType is useless and no longer needed since the CRIContainerType annotation is not considered for constraining or not the sandbox Signed-off-by: Julio Montes Signed-off-by: Peng Tao --- src/runtime/virtcontainers/pkg/oci/utils.go | 13 ------------- src/runtime/virtcontainers/sandbox.go | 5 ----- 2 files changed, 18 deletions(-) diff --git a/src/runtime/virtcontainers/pkg/oci/utils.go b/src/runtime/virtcontainers/pkg/oci/utils.go index cb656ad9b8..40fdb94467 100644 --- a/src/runtime/virtcontainers/pkg/oci/utils.go +++ b/src/runtime/virtcontainers/pkg/oci/utils.go @@ -843,8 +843,6 @@ func SandboxConfig(ocispec specs.Spec, runtime RuntimeConfig, bundlePath, cid, c // Spec: &ocispec, Experimental: runtime.Experimental, - - HasCRIContainerType: HasCRIContainerType(ocispec.Annotations), } if err := addAnnotations(ocispec, &sandboxConfig); err != nil { @@ -1013,14 +1011,3 @@ func GetOCIConfig(status vc.ContainerStatus) (specs.Spec, error) { return *status.Spec, nil } - -// HasCRIContainerType returns true if annottations contain -// a CRI container type annotation -func HasCRIContainerType(annotations map[string]string) bool { - for _, key := range CRIContainerTypeKeyList { - if _, ok := annotations[key]; ok { - return true - } - } - return false -} diff --git a/src/runtime/virtcontainers/sandbox.go b/src/runtime/virtcontainers/sandbox.go index 5b65da3c1c..41439cc36d 100644 --- a/src/runtime/virtcontainers/sandbox.go +++ b/src/runtime/virtcontainers/sandbox.go @@ -123,9 +123,6 @@ type SandboxConfig struct { DisableGuestSeccomp bool - // HasCRIContainerType specifies whether container type was set explicitly through annotations or not. - HasCRIContainerType bool - // Experimental features enabled Experimental []exp.Feature @@ -2135,8 +2132,6 @@ func (s *Sandbox) setupSandboxCgroup() error { return nil } - s.Logger().WithField("hasCRIContainerType", s.config.HasCRIContainerType).Debug("Setting sandbox cgroup") - s.state.CgroupPath, err = vccgroups.ValidCgroupPath(spec.Linux.CgroupsPath, s.config.SystemdCgroup) if err != nil { return fmt.Errorf("Invalid cgroup path: %v", err)