mirror of https://github.com/k3s-io/k3s
Introduce ContainerStates. Currently keep it has the same set as PodStatus:
Waiting, Running, Termination. For each state, there are some meaningful status associated with it.pull/6/head
parent
ee129cd440
commit
3faf393e7b
|
@ -253,6 +253,8 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
type ContainerStateWaiting struct {
|
type ContainerStateWaiting struct {
|
||||||
|
// Reason could be pulling image,
|
||||||
|
Reason string `json:"reason,omitempty" yaml:"reason,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ContainerStateRunning struct {
|
type ContainerStateRunning struct {
|
||||||
|
@ -276,10 +278,12 @@ type ContainerStatus struct {
|
||||||
// TODO(dchen1107): Should we rename PodStatus to a more generic name or have a separate states
|
// TODO(dchen1107): Should we rename PodStatus to a more generic name or have a separate states
|
||||||
// defined for container?
|
// defined for container?
|
||||||
State ContainerState `json:"state,omitempty" yaml:"state,omitempty"`
|
State ContainerState `json:"state,omitempty" yaml:"state,omitempty"`
|
||||||
RestartCount int `json:"restartCount,omitempty" yaml:"restartCount,omitempty"`
|
RestartCount int `json:"restartCount" yaml:"restartCount"`
|
||||||
// TODO(dchen1107): In long run, I think we should replace this with our own struct to remove
|
// TODO(dchen1107): Introduce our own NetworkSettings struct here?
|
||||||
// the dependency on docker. Also once we have done with integration with cadvisor, resource
|
// TODO(dchen1107): Once we have done with integration with cadvisor, resource
|
||||||
// usage should be included.
|
// usage should be included.
|
||||||
|
// TODO(dchen1107): In long run, I think we should replace this with our own struct to remove
|
||||||
|
// the dependency on docker.
|
||||||
DetailInfo docker.Container `json:"detailInfo,omitempty" yaml:"detailInfo,omitempty"`
|
DetailInfo docker.Container `json:"detailInfo,omitempty" yaml:"detailInfo,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -287,6 +291,8 @@ type ContainerStatus struct {
|
||||||
// TODO(dchen1107): Replace docker.Container below with ContainerStatus defined above.
|
// TODO(dchen1107): Replace docker.Container below with ContainerStatus defined above.
|
||||||
type PodInfo map[string]docker.Container
|
type PodInfo map[string]docker.Container
|
||||||
|
|
||||||
|
//type PodInfo map[string]docker.Container
|
||||||
|
|
||||||
type RestartPolicyAlways struct{}
|
type RestartPolicyAlways struct{}
|
||||||
|
|
||||||
// TODO(dchen1107): Define what kinds of failures should restart.
|
// TODO(dchen1107): Define what kinds of failures should restart.
|
||||||
|
|
Loading…
Reference in New Issue