kubectl/pkg/polymorphichelpers
Jian Li 3f7abd9859 cmd/kubectl: make 'kubectl logs' default to the first container when default container cannot be determined or found by annotations (#105964)
* cmd/kubectl: make 'kubectl logs' default to the first container.

While running 'kubectl logs <pod>', If '-c' is omited and the pod has more than one container, and no default container can be determined from annotations, this command shows an error message and exits. With this fix, it defaults to the first container in such scenarios and show its logs. This aligns behavior with what 'kubectl exec' does currently, and is more in line with KEP SIG-CLI 2227 design.

* fix unit test(forgotten)

* fix spelling typo

Kubernetes-commit: 0977a5d7cda59d5bd324bf2730846905e072fbbf
2022-01-07 09:40:41 +08:00
..
attachablepodforobject.go Move pkg/kubectl/polymorphichelpers staging 2019-07-27 19:48:15 -07:00
canbeexposed.go Move pkg/kubectl/polymorphichelpers staging 2019-07-27 19:48:15 -07:00
canbeexposed_test.go Move pkg/kubectl/polymorphichelpers staging 2019-07-27 19:48:15 -07:00
helpers.go generated: run refactor 2020-02-07 18:16:47 -08:00
helpers_test.go Move pkg/kubectl/polymorphichelpers staging 2019-07-27 19:48:15 -07:00
history.go Add commend for printHistory function 2020-09-05 21:43:22 +05:30
history_test.go Add tests for daemonset view history 2020-09-05 22:10:28 +05:30
historyviewer.go Move pkg/kubectl/polymorphichelpers staging 2019-07-27 19:48:15 -07:00
interface.go Adds --prefix flag to the kubectl log command 2019-09-04 16:23:02 +01:00
logsforobject.go cmd/kubectl: make 'kubectl logs' default to the first container when default container cannot be determined or found by annotations (#105964) 2022-01-07 09:40:41 +08:00
logsforobject_test.go cmd/kubectl: make 'kubectl logs' default to the first container when default container cannot be determined or found by annotations (#105964) 2022-01-07 09:40:41 +08:00
mapbasedselectorforobject.go Move pkg/kubectl/polymorphichelpers staging 2019-07-27 19:48:15 -07:00
mapbasedselectorforobject_test.go Move pkg/kubectl/polymorphichelpers staging 2019-07-27 19:48:15 -07:00
objectpauser.go Move pkg/kubectl/polymorphichelpers staging 2019-07-27 19:48:15 -07:00
objectpauser_test.go Move pkg/kubectl/polymorphichelpers staging 2019-07-27 19:48:15 -07:00
objectrestarter.go Move pkg/kubectl/polymorphichelpers staging 2019-07-27 19:48:15 -07:00
objectresumer.go Move pkg/kubectl/polymorphichelpers staging 2019-07-27 19:48:15 -07:00
objectresumer_test.go Move pkg/kubectl/polymorphichelpers staging 2019-07-27 19:48:15 -07:00
portsforobject.go Move pkg/kubectl/polymorphichelpers staging 2019-07-27 19:48:15 -07:00
portsforobject_test.go Move pkg/kubectl/polymorphichelpers staging 2019-07-27 19:48:15 -07:00
protocolsforobject.go Move pkg/kubectl/polymorphichelpers staging 2019-07-27 19:48:15 -07:00
protocolsforobject_test.go Move pkg/kubectl/polymorphichelpers staging 2019-07-27 19:48:15 -07:00
rollback.go generated: run refactor 2020-02-08 12:30:21 -05:00
rollback_test.go Fix(kubectl): the field of history controllerrevision will be covered by daemonset 2019-12-12 23:14:47 +08:00
rollbacker.go Move pkg/kubectl/polymorphichelpers staging 2019-07-27 19:48:15 -07:00
rollout_status.go Fix kubectl conversions 2019-11-17 18:35:55 +01:00
rollout_status_test.go Fix kubectl conversions 2019-11-17 18:35:55 +01:00
statusviewer.go Move pkg/kubectl/polymorphichelpers staging 2019-07-27 19:48:15 -07:00
updatepodspec.go Fix batch/v1 CronJob support in create, describe and polymorphichelpers 2021-03-09 09:44:02 +01:00
updatepodspec_test.go Fix batch/v1 CronJob support in create, describe and polymorphichelpers 2021-03-09 09:44:02 +01:00