本文整理匯總了Golang中k8s/io/kubernetes/pkg/kubelet/api/v1alpha1/runtime.ContainerFilter.GetPodSandboxId方法的典型用法代碼示例。如果您正苦於以下問題:Golang ContainerFilter.GetPodSandboxId方法的具體用法?Golang ContainerFilter.GetPodSandboxId怎麽用?Golang ContainerFilter.GetPodSandboxId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類k8s/io/kubernetes/pkg/kubelet/api/v1alpha1/runtime.ContainerFilter
的用法示例。
在下文中一共展示了ContainerFilter.GetPodSandboxId方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: ListContainers
func (r *FakeRuntimeService) ListContainers(filter *runtimeApi.ContainerFilter) ([]*runtimeApi.Container, error) {
r.Lock()
defer r.Unlock()
r.Called = append(r.Called, "ListContainers")
result := make([]*runtimeApi.Container, 0)
for _, s := range r.Containers {
if filter != nil {
if filter.Id != nil && filter.GetId() != s.GetId() {
continue
}
if filter.PodSandboxId != nil && filter.GetPodSandboxId() != s.SandboxID {
continue
}
if filter.State != nil && filter.GetState() != s.GetState() {
continue
}
if filter.LabelSelector != nil && !filterInLabels(filter.LabelSelector, s.GetLabels()) {
continue
}
}
result = append(result, &runtimeApi.Container{
Id: s.Id,
Metadata: s.Metadata,
State: s.State,
Image: s.Image,
ImageRef: s.ImageRef,
Labels: s.Labels,
})
}
return result, nil
}