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

Commit

Permalink
virtcontainers: remove all the code related to HasCRIContainerType
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Julio Montes committed Apr 28, 2020
1 parent cff5392 commit 5cfae21
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
13 changes: 0 additions & 13 deletions virtcontainers/pkg/oci/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
5 changes: 0 additions & 5 deletions virtcontainers/sandbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5cfae21

Please sign in to comment.