github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/client/lib/cgutil/cgutil_noop.go (about)

     1  //go:build !linux
     2  
     3  package cgutil
     4  
     5  import (
     6  	"github.com/hashicorp/go-hclog"
     7  )
     8  
     9  const (
    10  	// DefaultCgroupParent does not apply to non-Linux operating systems.
    11  	DefaultCgroupParent = ""
    12  )
    13  
    14  // UseV2 is always false on non-Linux systems.
    15  //
    16  // This is a read-only value.
    17  var UseV2 = false
    18  
    19  // CreateCPUSetManager creates a no-op CpusetManager for non-Linux operating systems.
    20  func CreateCPUSetManager(string, []uint16, hclog.Logger) CpusetManager {
    21  	return new(NoopCpusetManager)
    22  }
    23  
    24  // FindCgroupMountpointDir returns nothing for non-Linux operating systems.
    25  func FindCgroupMountpointDir() (string, error) {
    26  	return "", nil
    27  }
    28  
    29  // GetCgroupParent returns nothing for non-Linux operating systems.
    30  func GetCgroupParent(string) string {
    31  	return DefaultCgroupParent
    32  }
    33  
    34  // GetCPUsFromCgroup returns nothing for non-Linux operating systems.
    35  func GetCPUsFromCgroup(string) ([]uint16, error) {
    36  	return nil, nil
    37  }
    38  
    39  // CgroupScope returns nothing for non-Linux operating systems.
    40  func CgroupScope(allocID, task string) string {
    41  	return ""
    42  }