I cannot find the restart count in KubernetesClient C#

10/17/2020

item.Status.ContainerStatuses.RestartCount doesn't exist. I cannot find the command. Reinstalling the nuget-package or updating it did not work either.

Down there I added the problem I have and the package I use. Sorry if my english is kinda rusty.

the package I use

the problem I have

-- Lukas Zauner
c#
kubernetes

1 Answer

10/17/2020

ContainerStatuses is a collection of ContainerStatus, not a ContainerStatus itself. You must choose from which container you want the RestartCount, per example:

 int restarts = item.Status.ContainerStatuses[0].RestartCount;
-- Gusman
Source: StackOverflow