mirror of
				https://github.com/k3s-io/kubernetes.git
				synced 2025-10-30 05:14:54 +00:00 
			
		
		
		
	Move deps from _workspace/ to vendor/
godep restore pushd $GOPATH/src/github.com/appc/spec git co master popd go get go4.org/errorutil rm -rf Godeps godep save ./... git add vendor git add -f $(git ls-files --other vendor/) git co -- Godeps/LICENSES Godeps/.license_file_state Godeps/OWNERS
This commit is contained in:
		
							
								
								
									
										64
									
								
								vendor/github.com/opencontainers/runc/libcontainer/cgroups/cgroups.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										64
									
								
								vendor/github.com/opencontainers/runc/libcontainer/cgroups/cgroups.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,64 @@ | ||||
| // +build linux | ||||
|  | ||||
| package cgroups | ||||
|  | ||||
| import ( | ||||
| 	"fmt" | ||||
|  | ||||
| 	"github.com/opencontainers/runc/libcontainer/configs" | ||||
| ) | ||||
|  | ||||
| type Manager interface { | ||||
| 	// Apply cgroup configuration to the process with the specified pid | ||||
| 	Apply(pid int) error | ||||
|  | ||||
| 	// Returns the PIDs inside the cgroup set | ||||
| 	GetPids() ([]int, error) | ||||
|  | ||||
| 	// Returns the PIDs inside the cgroup set & all sub-cgroups | ||||
| 	GetAllPids() ([]int, error) | ||||
|  | ||||
| 	// Returns statistics for the cgroup set | ||||
| 	GetStats() (*Stats, error) | ||||
|  | ||||
| 	// Toggles the freezer cgroup according with specified state | ||||
| 	Freeze(state configs.FreezerState) error | ||||
|  | ||||
| 	// Destroys the cgroup set | ||||
| 	Destroy() error | ||||
|  | ||||
| 	// NewCgroupManager() and LoadCgroupManager() require following attributes: | ||||
| 	// 	Paths   map[string]string | ||||
| 	// 	Cgroups *cgroups.Cgroup | ||||
| 	// Paths maps cgroup subsystem to path at which it is mounted. | ||||
| 	// Cgroups specifies specific cgroup settings for the various subsystems | ||||
|  | ||||
| 	// Returns cgroup paths to save in a state file and to be able to | ||||
| 	// restore the object later. | ||||
| 	GetPaths() map[string]string | ||||
|  | ||||
| 	// Set the cgroup as configured. | ||||
| 	Set(container *configs.Config) error | ||||
| } | ||||
|  | ||||
| type NotFoundError struct { | ||||
| 	Subsystem string | ||||
| } | ||||
|  | ||||
| func (e *NotFoundError) Error() string { | ||||
| 	return fmt.Sprintf("mountpoint for %s not found", e.Subsystem) | ||||
| } | ||||
|  | ||||
| func NewNotFoundError(sub string) error { | ||||
| 	return &NotFoundError{ | ||||
| 		Subsystem: sub, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func IsNotFound(err error) bool { | ||||
| 	if err == nil { | ||||
| 		return false | ||||
| 	} | ||||
| 	_, ok := err.(*NotFoundError) | ||||
| 	return ok | ||||
| } | ||||
		Reference in New Issue
	
	Block a user