mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 15:25:57 +00:00
Merge pull request #1268 from dchen1107/termination
Proposed ContainerStatus for each individual Container in a Pod.
This commit is contained in:
commit
cc7999c00a
@ -252,7 +252,43 @@ const (
|
||||
PodTerminated PodStatus = "Terminated"
|
||||
)
|
||||
|
||||
type ContainerStateWaiting struct {
|
||||
// Reason could be pulling image,
|
||||
Reason string `json:"reason,omitempty" yaml:"reason,omitempty"`
|
||||
}
|
||||
|
||||
type ContainerStateRunning struct {
|
||||
}
|
||||
|
||||
type ContainerStateTerminated struct {
|
||||
ExitCode int `json:"exitCode,omitempty" yaml:"exitCode,omitempty"`
|
||||
Signal int `json:"signal,omitempty" yaml:"signal,omitempty"`
|
||||
Reason string `json:"reason,omitempty" yaml:"reason,omitempty"`
|
||||
}
|
||||
|
||||
type ContainerState struct {
|
||||
// Only one of the following ContainerState may be specified.
|
||||
// If none of them is specified, the default one is ContainerStateWaiting.
|
||||
Waiting *ContainerStateWaiting `json:"waiting,omitempty" yaml:"waiting,omitempty"`
|
||||
Running *ContainerStateRunning `json:"running,omitempty" yaml:"running,omitempty"`
|
||||
Termination *ContainerStateTerminated `json:"termination,omitempty" yaml:"termination,omitempty"`
|
||||
}
|
||||
|
||||
type ContainerStatus struct {
|
||||
// TODO(dchen1107): Should we rename PodStatus to a more generic name or have a separate states
|
||||
// defined for container?
|
||||
State ContainerState `json:"state,omitempty" yaml:"state,omitempty"`
|
||||
RestartCount int `json:"restartCount" yaml:"restartCount"`
|
||||
// TODO(dchen1107): Introduce our own NetworkSettings struct here?
|
||||
// TODO(dchen1107): Once we have done with integration with cadvisor, resource
|
||||
// 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"`
|
||||
}
|
||||
|
||||
// PodInfo contains one entry for every container with available info.
|
||||
// TODO(dchen1107): Replace docker.Container below with ContainerStatus defined above.
|
||||
type PodInfo map[string]docker.Container
|
||||
|
||||
type RestartPolicyAlways struct{}
|
||||
|
@ -265,6 +265,41 @@ const (
|
||||
PodTerminated PodStatus = "Terminated"
|
||||
)
|
||||
|
||||
type ContainerStateWaiting struct {
|
||||
// Reason could be pulling image,
|
||||
Reason string `json:"reason,omitempty" yaml:"reason,omitempty"`
|
||||
}
|
||||
|
||||
type ContainerStateRunning struct {
|
||||
}
|
||||
|
||||
type ContainerStateTerminated struct {
|
||||
ExitCode int `json:"exitCode,omitempty" yaml:"exitCode,omitempty"`
|
||||
Signal int `json:"signal,omitempty" yaml:"signal,omitempty"`
|
||||
Reason string `json:"reason,omitempty" yaml:"reason,omitempty"`
|
||||
}
|
||||
|
||||
type ContainerState struct {
|
||||
// Only one of the following ContainerState may be specified.
|
||||
// If none of them is specified, the default one is ContainerStateWaiting.
|
||||
Waiting *ContainerStateWaiting `json:"waiting,omitempty" yaml:"waiting,omitempty"`
|
||||
Running *ContainerStateRunning `json:"running,omitempty" yaml:"running,omitempty"`
|
||||
Termination *ContainerStateTerminated `json:"termination,omitempty" yaml:"termination,omitempty"`
|
||||
}
|
||||
|
||||
type ContainerStatus struct {
|
||||
// TODO(dchen1107): Should we rename PodStatus to a more generic name or have a separate states
|
||||
// defined for container?
|
||||
State ContainerState `json:"state,omitempty" yaml:"state,omitempty"`
|
||||
RestartCount int `json:"restartCount" yaml:"restartCount"`
|
||||
// TODO(dchen1107): Introduce our own NetworkSettings struct here?
|
||||
// TODO(dchen1107): Once we have done with integration with cadvisor, resource
|
||||
// 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"`
|
||||
}
|
||||
|
||||
// PodInfo contains one entry for every container with available info.
|
||||
type PodInfo map[string]docker.Container
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user