mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 18:00:08 +00:00
Merge pull request #15454 from feihujiang/describePodsShowCommandAndArgs
Auto commit by PR queue bot
This commit is contained in:
commit
80838ff86a
@ -725,6 +725,19 @@ func describeContainers(pod *api.Pod, out io.Writer) {
|
|||||||
fmt.Fprintf(out, " Image:\t%s\n", container.Image)
|
fmt.Fprintf(out, " Image:\t%s\n", container.Image)
|
||||||
fmt.Fprintf(out, " Image ID:\t%s\n", status.ImageID)
|
fmt.Fprintf(out, " Image ID:\t%s\n", status.ImageID)
|
||||||
|
|
||||||
|
if len(container.Command) > 0 {
|
||||||
|
fmt.Fprintf(out, " Command:\n")
|
||||||
|
for _, c := range container.Command {
|
||||||
|
fmt.Fprintf(out, " %s\n", c)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(container.Args) > 0 {
|
||||||
|
fmt.Fprintf(out, " Args:\n")
|
||||||
|
for _, arg := range container.Args {
|
||||||
|
fmt.Fprintf(out, " %s\n", arg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
resourceToQoS := qosutil.GetQoS(&container)
|
resourceToQoS := qosutil.GetQoS(&container)
|
||||||
if len(resourceToQoS) > 0 {
|
if len(resourceToQoS) > 0 {
|
||||||
fmt.Fprintf(out, " QoS Tier:\n")
|
fmt.Fprintf(out, " QoS Tier:\n")
|
||||||
|
@ -206,7 +206,7 @@ func TestDescribeContainers(t *testing.T) {
|
|||||||
},
|
},
|
||||||
expectedElements: []string{"test", "State", "Waiting", "Ready", "True", "Restart Count", "7", "Image", "image"},
|
expectedElements: []string{"test", "State", "Waiting", "Ready", "True", "Restart Count", "7", "Image", "image"},
|
||||||
},
|
},
|
||||||
//env
|
// Env
|
||||||
{
|
{
|
||||||
container: api.Container{Name: "test", Image: "image", Env: []api.EnvVar{{Name: "envname", Value: "xyz"}}},
|
container: api.Container{Name: "test", Image: "image", Env: []api.EnvVar{{Name: "envname", Value: "xyz"}}},
|
||||||
status: api.ContainerStatus{
|
status: api.ContainerStatus{
|
||||||
@ -216,6 +216,26 @@ func TestDescribeContainers(t *testing.T) {
|
|||||||
},
|
},
|
||||||
expectedElements: []string{"test", "State", "Waiting", "Ready", "True", "Restart Count", "7", "Image", "image", "envname", "xyz"},
|
expectedElements: []string{"test", "State", "Waiting", "Ready", "True", "Restart Count", "7", "Image", "image", "envname", "xyz"},
|
||||||
},
|
},
|
||||||
|
// Command
|
||||||
|
{
|
||||||
|
container: api.Container{Name: "test", Image: "image", Command: []string{"sleep", "1000"}},
|
||||||
|
status: api.ContainerStatus{
|
||||||
|
Name: "test",
|
||||||
|
Ready: true,
|
||||||
|
RestartCount: 7,
|
||||||
|
},
|
||||||
|
expectedElements: []string{"test", "State", "Waiting", "Ready", "True", "Restart Count", "7", "Image", "image", "sleep", "1000"},
|
||||||
|
},
|
||||||
|
// Args
|
||||||
|
{
|
||||||
|
container: api.Container{Name: "test", Image: "image", Args: []string{"time", "1000"}},
|
||||||
|
status: api.ContainerStatus{
|
||||||
|
Name: "test",
|
||||||
|
Ready: true,
|
||||||
|
RestartCount: 7,
|
||||||
|
},
|
||||||
|
expectedElements: []string{"test", "State", "Waiting", "Ready", "True", "Restart Count", "7", "Image", "image", "time", "1000"},
|
||||||
|
},
|
||||||
// Using limits.
|
// Using limits.
|
||||||
{
|
{
|
||||||
container: api.Container{
|
container: api.Container{
|
||||||
|
Loading…
Reference in New Issue
Block a user