|
16 | 16 | - [Risks and Mitigations](#risks-and-mitigations)
|
17 | 17 | - [Design Details](#design-details)
|
18 | 18 | - [Test Plan](#test-plan)
|
| 19 | + - [Testing Strategy](#testing-strategy) |
| 20 | + - [Prerequisite testing updates](#prerequisite-testing-updates) |
| 21 | + - [Unit tests](#unit-tests) |
| 22 | + - [Integration tests](#integration-tests) |
| 23 | + - [e2e tests](#e2e-tests) |
19 | 24 | - [Graduation Criteria](#graduation-criteria)
|
20 | 25 | - [Alpha -> Beta Graduation](#alpha---beta-graduation)
|
21 | 26 | - [Beta -> GA Graduation](#beta---ga-graduation)
|
@@ -179,13 +184,37 @@ metadata:
|
179 | 184 | ```
|
180 | 185 |
|
181 | 186 | ### Test Plan
|
| 187 | + |
| 188 | +#### Testing Strategy |
| 189 | + |
182 | 190 | Add a unit test for each command, testing the behavior with the annotation, without the annotation, and with the --container flag
|
183 | 191 |
|
| 192 | +##### Prerequisite testing updates |
| 193 | + |
| 194 | +##### Unit tests |
| 195 | + |
| 196 | +The main unit test is in package under `vendor/k8s.io/kubectl/pkg/`. |
| 197 | + |
| 198 | +- vendor/k8s.io/kubectl/pkg/cmd/exec:2023-01-13 - 68.9% |
| 199 | +- vendor/k8s.io/kubectl/pkg/cmd/util/helpers.go:2023-01-13 - 38.1% |
| 200 | +- vendor/k8s.io/kubectl/pkg/polymorphichelpers/logsforobject.go:2023-01-13 - 79% |
| 201 | + |
| 202 | +See details in <https://testgrid.k8s.io/sig-testing-canaries#ci-kubernetes-coverage-unit&include-filter-by-regex=kubectl>. |
| 203 | + |
| 204 | +##### Integration tests |
| 205 | + |
| 206 | +N/A |
| 207 | + |
| 208 | +##### e2e tests |
| 209 | + |
| 210 | +[Kubectl logs default container logs](https://github.com/kubernetes/kubernetes/blob/02f893b6e28549a1008d4fc65c40990b87c07830/test/e2e/kubectl/logs.go#L163): <https://storage.googleapis.com/k8s-triage/index.html?sig=cli&test=default%20container%20logs> |
| 211 | + |
184 | 212 | ### Graduation Criteria
|
185 | 213 |
|
186 | 214 | #### Alpha -> Beta Graduation
|
187 | 215 |
|
188 | 216 | As this is an opt-in feature, no gate is expected.
|
| 217 | + |
189 | 218 | - At least 2 release cycles pass to gather feedback and bug reports during
|
190 | 219 | - Documentations, add it to [well-known annotations docs](https://kubernetes.io/docs/reference/kubernetes-api/labels-annotations-taints/)
|
191 | 220 | - Add a warning deprecation message when using the annotation `kubectl.kubernetes.io/default-logs-container`
|
@@ -310,11 +339,26 @@ resource usage (CPU, RAM, disk, IO, ...) in any components?**
|
310 | 339 |
|
311 | 340 | ## Implementation History
|
312 | 341 |
|
313 |
| -2021-03-10: Alpha implementation completion in 1.21 |
314 |
| -- https://github.com/kubernetes/kubernetes/pull/97099 |
315 |
| -- https://github.com/kubernetes/kubernetes/pull/99615 |
316 |
| -- https://github.com/kubernetes/kubernetes/pull/99581 |
317 |
| -- https://github.com/kubernetes/kubernetes/pull/99833 |
| 342 | +2021-03-10(v1.21) Alpha: implementation completion |
| 343 | + |
| 344 | +- <https://github.com/kubernetes/kubernetes/pull/97099> |
| 345 | +- <https://github.com/kubernetes/kubernetes/pull/99615> |
| 346 | +- <https://github.com/kubernetes/kubernetes/pull/99581> |
| 347 | +- <https://github.com/kubernetes/kubernetes/pull/99833> |
| 348 | + |
| 349 | +2021-10-28(v1.24) Beta: make 'kubectl logs' default to the first container when default container cannot be |
| 350 | +determined or found by annotations |
| 351 | + |
| 352 | +- <https://github.com/kubernetes/kubernetes/pull/105964> |
| 353 | + |
| 354 | +2022-04-05(v1.25): remove deprecated message of `kubectl.kubernetes.io/default-logs-container` |
| 355 | + |
| 356 | +- <https://github.com/kubernetes/kubernetes/pull/109254> |
| 357 | + |
| 358 | +2023-01-13(v1.27): add an e2e test case |
| 359 | + |
| 360 | +- <https://github.com/kubernetes/kubernetes/pull/115046> |
| 361 | + |
318 | 362 |
|
319 | 363 | ## Drawbacks
|
320 | 364 |
|
|
0 commit comments