mirror of https://github.com/k3s-io/k3s
commit
b2d2432291
|
@ -191,8 +191,6 @@ pkg/kubelet/checkpointmanager/checksum
|
||||||
pkg/kubelet/checkpointmanager/testing/example_checkpoint_formats/v1
|
pkg/kubelet/checkpointmanager/testing/example_checkpoint_formats/v1
|
||||||
pkg/kubelet/client
|
pkg/kubelet/client
|
||||||
pkg/kubelet/cm
|
pkg/kubelet/cm
|
||||||
pkg/kubelet/cm/devicemanager/checkpoint
|
|
||||||
pkg/kubelet/cm/util
|
|
||||||
pkg/kubelet/config
|
pkg/kubelet/config
|
||||||
pkg/kubelet/configmap
|
pkg/kubelet/configmap
|
||||||
pkg/kubelet/container
|
pkg/kubelet/container
|
||||||
|
|
|
@ -23,11 +23,13 @@ import (
|
||||||
"k8s.io/kubernetes/pkg/kubelet/checkpointmanager/checksum"
|
"k8s.io/kubernetes/pkg/kubelet/checkpointmanager/checksum"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// DeviceManagerCheckpoint defines the operations to retrieve pod devices
|
||||||
type DeviceManagerCheckpoint interface {
|
type DeviceManagerCheckpoint interface {
|
||||||
checkpointmanager.Checkpoint
|
checkpointmanager.Checkpoint
|
||||||
GetData() ([]PodDevicesEntry, map[string][]string)
|
GetData() ([]PodDevicesEntry, map[string][]string)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PodDevicesEntry connects pod information to devices
|
||||||
type PodDevicesEntry struct {
|
type PodDevicesEntry struct {
|
||||||
PodUID string
|
PodUID string
|
||||||
ContainerName string
|
ContainerName string
|
||||||
|
@ -44,6 +46,7 @@ type checkpointData struct {
|
||||||
RegisteredDevices map[string][]string
|
RegisteredDevices map[string][]string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Data holds checkpoint data and its checksum
|
||||||
type Data struct {
|
type Data struct {
|
||||||
Data checkpointData
|
Data checkpointData
|
||||||
Checksum checksum.Checksum
|
Checksum checksum.Checksum
|
||||||
|
@ -76,6 +79,7 @@ func (cp *Data) VerifyChecksum() error {
|
||||||
return cp.Checksum.Verify(cp.Data)
|
return cp.Checksum.Verify(cp.Data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetData returns device entries and registered devices
|
||||||
func (cp *Data) GetData() ([]PodDevicesEntry, map[string][]string) {
|
func (cp *Data) GetData() ([]PodDevicesEntry, map[string][]string) {
|
||||||
return cp.Data.PodDeviceEntries, cp.Data.RegisteredDevices
|
return cp.Data.PodDeviceEntries, cp.Data.RegisteredDevices
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ import (
|
||||||
libcontainerutils "github.com/opencontainers/runc/libcontainer/utils"
|
libcontainerutils "github.com/opencontainers/runc/libcontainer/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// GetPids gets pids of the desired cgroup
|
||||||
// Forked from opencontainers/runc/libcontainer/cgroup/fs.Manager.GetPids()
|
// Forked from opencontainers/runc/libcontainer/cgroup/fs.Manager.GetPids()
|
||||||
func GetPids(cgroupPath string) ([]int, error) {
|
func GetPids(cgroupPath string) ([]int, error) {
|
||||||
dir, err := getCgroupPath(cgroupPath)
|
dir, err := getCgroupPath(cgroupPath)
|
||||||
|
|
|
@ -18,6 +18,7 @@ limitations under the License.
|
||||||
|
|
||||||
package util
|
package util
|
||||||
|
|
||||||
|
// GetPids gets pids of the desired cgroup
|
||||||
func GetPids(cgroupPath string) ([]int, error) {
|
func GetPids(cgroupPath string) ([]int, error) {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue