mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-24 14:32:33 +00:00
kata-monitor: minor fixes
fix comment and use literals Signed-off-by: Francesco Giudici <fgiudici@redhat.com>
This commit is contained in:
parent
fff82b4ef5
commit
53ec4df953
@ -117,8 +117,7 @@ func parseEndpoint(endpoint string) (string, string, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// getSandboxes get kata sandbox from the container engine.
|
// getSandboxes gets kata sandboxes from the container engine.
|
||||||
// this will be called only after monitor start.
|
|
||||||
func (km *KataMonitor) getSandboxes() (map[string]struct{}, error) {
|
func (km *KataMonitor) getSandboxes() (map[string]struct{}, error) {
|
||||||
|
|
||||||
sandboxMap := make(map[string]struct{})
|
sandboxMap := make(map[string]struct{})
|
||||||
@ -166,7 +165,11 @@ func (km *KataMonitor) getSandboxes() (map[string]struct{}, error) {
|
|||||||
// get low level container runtime
|
// get low level container runtime
|
||||||
// containerd stores the pod runtime in "/runtimeType" while CRI-O stores it the
|
// containerd stores the pod runtime in "/runtimeType" while CRI-O stores it the
|
||||||
// io.kubernetes.cri-o.RuntimeHandler annotation: check for both.
|
// io.kubernetes.cri-o.RuntimeHandler annotation: check for both.
|
||||||
keys := []string{"/runtimeType", "/runtimeSpec/annotations/io.kubernetes.cri-o.RuntimeHandler"}
|
const (
|
||||||
|
containerdRuntimeMarker = "/runtimeType"
|
||||||
|
crioRuntimeMarker = "/runtimeSpec/annotations/io.kubernetes.cri-o.RuntimeHandler"
|
||||||
|
)
|
||||||
|
keys := []string{containerdRuntimeMarker, crioRuntimeMarker}
|
||||||
for _, key := range keys {
|
for _, key := range keys {
|
||||||
pointer, _ := gojsonpointer.NewJsonPointer(key)
|
pointer, _ := gojsonpointer.NewJsonPointer(key)
|
||||||
rt, _, _ := pointer.Get(res)
|
rt, _, _ := pointer.Get(res)
|
||||||
|
Loading…
Reference in New Issue
Block a user