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 <julio.montes@intel.com>
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
Julio Montes 2020-05-26 00:32:58 -07:00 committed by Peng Tao
parent 8f5a69373b
commit e6aac8390e
2 changed files with 0 additions and 18 deletions

View File

@ -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
}

View File

@ -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)