Documentation
¶
Index ¶
- Constants
- func EnsureDevicePermission(path string, perm int) error
- func GetAllDeviceIdsFromKubeletCheckpoint(filePath string) ([]string, error)
- func GetPodUIDByDeviceID(deviceID string, filePath string) (string, error)
- func GetSandboxPid(ctx context.Context, client cri.RuntimeService, sandboxId string) (string, error)
- func GetSandboxes(ctx context.Context, client cri.RuntimeService, podUid string) ([]*runtimeapi.PodSandbox, error)
- type DataV1
- type DataV2
- type FakeFileInfo
- type FileContentV1
- type FileContentV2
- type MockUtils
- type PodDeviceEntryV1
- type PodDeviceEntryV2
Constants ¶
View Source
const ( ResourceNamePrefix = "unifiedbus.com" URMAResource = "ub_net_device" MaxResourceNameLength = 63 ResourceName = ResourceNamePrefix + "/" + URMAResource KubeletCheckpoint = "/var/lib/kubelet/device-plugins/kubelet_internal_checkpoint" RuntimeSock = "/run/containerd/containerd.sock" TidDevicePath = "/dev/ummu/tid" UBCorePath = "/dev/ubcore/ubcore" Permission = 0666 GrpcTimeOut = 30 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func GetAllDeviceIdsFromKubeletCheckpoint ¶
func GetPodUIDByDeviceID ¶
func GetSandboxPid ¶
func GetSandboxes ¶
func GetSandboxes(ctx context.Context, client cri.RuntimeService, podUid string) ([]*runtimeapi.PodSandbox, error)
Types ¶
type DataV1 ¶
type DataV1 struct {
PodDeviceEntries []PodDeviceEntryV1 `json:"PodDeviceEntries"`
}
type DataV2 ¶
type DataV2 struct {
PodDeviceEntries []PodDeviceEntryV2 `json:"PodDeviceEntries"`
}
type FakeFileInfo ¶
type FakeFileInfo struct {
// contains filtered or unexported fields
}
func (*FakeFileInfo) IsDir ¶
func (f *FakeFileInfo) IsDir() bool
func (*FakeFileInfo) ModTime ¶
func (f *FakeFileInfo) ModTime() time.Time
func (*FakeFileInfo) Mode ¶
func (f *FakeFileInfo) Mode() fs.FileMode
func (*FakeFileInfo) Name ¶
func (f *FakeFileInfo) Name() string
func (*FakeFileInfo) Size ¶
func (f *FakeFileInfo) Size() int64
func (*FakeFileInfo) Sys ¶
func (f *FakeFileInfo) Sys() any
type FileContentV1 ¶
type FileContentV2 ¶
type MockUtils ¶
type MockUtils struct {
StatPatches *gomonkey.Patches
ChmodPatches *gomonkey.Patches
GetPodUIDByDeviceIDPatches *gomonkey.Patches
NewRemoteRuntimeServicePatches *gomonkey.Patches
GetSandboxesPatches *gomonkey.Patches
GetSandboxPidPatches *gomonkey.Patches
CombinedOutputPatches *gomonkey.Patches
ResetFunc []func()
// contains filtered or unexported fields
}
type PodDeviceEntryV1 ¶
type PodDeviceEntryV1 struct {
PodUID string `json:"PodUID"`
ContainerName string `json:"ContainerName"`
ResourceName string `json:"ResourceName"`
DeviceIDs []string `json:"DeviceIDs"`
AllocResp string `json:"AllocResp"`
}
In Kubernetes versions 1.19 and earlier, the DevicesIDs field is of type []string.
type PodDeviceEntryV2 ¶
type PodDeviceEntryV2 struct {
PodUID string `json:"PodUID"`
ContainerName string `json:"ContainerName"`
ResourceName string `json:"ResourceName"`
DeviceIDs map[int64][]string `json:"DeviceIDs"`
AllocResp string `json:"AllocResp"`
}
In Kubernetes versions 1.20 and later, the DevicesIDs field is of type map[int64][]string.
Source Files
¶
- consts.go
- mock_utils.go
- utils.go
Click to show internal directories.
Click to hide internal directories.