k3s/pkg/kubectl
Kubernetes Submit Queue 7c656ab4d2 Merge pull request #45611 from atombender/issue-45608
Automatic merge from submit-queue (batch tested with PRs 48183, 45611, 48065)

kubectl: 'apply view-last-applied' must not use printf() semantics

**What this PR does / why we need it**:
This fixes `kubectl apply view-last-applied` to not use `fmt.Fprintf()`, as this will cause format codes in the YAML/JSON to be interpreted. For example, if a resource manifest contains `%r`, this would cause `view-last-applied` so print `%!r(MISSING)`.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #45608.

**Special notes for your reviewer**:

**Release note**:

```release-note
Fixes an edge case where "kubectl apply view-last-applied" would emit garbage if the data contained Go format codes.
```
2017-06-28 12:55:21 -07:00
..
cmd Merge pull request #45611 from atombender/issue-45608 2017-06-28 12:55:21 -07:00
metricsutil
plugins
resource run hack/update-all 2017-06-22 11:31:03 -07:00
testing
util
BUILD kubectl: refactor addFromEnvFile, write tests 2017-06-23 09:49:30 -07:00
OWNERS
apply.go kubectl: simplify code with help of linter 2017-06-23 09:49:30 -07:00
autoscale.go
bash_comp_utils.go
cluster.go run hack/update-all 2017-06-22 11:31:03 -07:00
cluster_test.go run hack/update-all 2017-06-22 11:31:03 -07:00
clusterrolebinding.go
configmap.go fix comment of isDir 2017-06-02 09:26:13 +08:00
configmap_test.go
deployment.go run hack/update-all 2017-06-22 11:31:03 -07:00
deployment_test.go run hack/update-all 2017-06-22 11:31:03 -07:00
doc.go kubectl: rewrite docstrings in several files 2017-06-23 09:49:30 -07:00
env_file.go kubectl: refactor addFromEnvFile, write tests 2017-06-23 09:49:30 -07:00
env_file_test.go kubectl: refactor addFromEnvFile, write tests 2017-06-23 09:49:30 -07:00
explain.go
generate.go kubectl: rewrite docstrings in several files 2017-06-23 09:49:30 -07:00
generate_test.go
history.go run hack/update-all 2017-06-22 11:31:03 -07:00
interfaces.go
kubectl.go kubectl: rewrite docstrings in several files 2017-06-23 09:49:30 -07:00
kubectl_test.go
namespace.go
namespace_test.go Add test case for namespace 2017-06-03 14:35:49 +08:00
pdb.go
proxy_server.go kubectl: rewrite docstrings in several files 2017-06-23 09:49:30 -07:00
proxy_server_test.go
quota.go
quota_test.go
resource_filter.go run hack/update-all 2017-06-22 11:31:03 -07:00
rolebinding.go
rolebinding_test.go
rollback.go run hack/update-all 2017-06-22 11:31:03 -07:00
rolling_updater.go kubectl: simplify code with help of linter 2017-06-23 09:49:30 -07:00
rolling_updater_test.go
rollout_status.go Update StatefulSet rollout status for parameterized RollingUpdate 2017-06-12 10:07:07 -07:00
rollout_status_test.go Update StatefulSet rollout status for parameterized RollingUpdate 2017-06-12 10:07:07 -07:00
run.go kubectl: simplify code with help of linter 2017-06-23 09:49:30 -07:00
run_test.go run hack/update-all 2017-06-22 11:31:03 -07:00
scale.go
scale_test.go
secret.go
secret_for_docker_registry.go
secret_for_docker_registry_test.go
secret_for_tls.go
secret_for_tls_test.go
secret_test.go
service.go
service_basic.go
service_basic_test.go
service_test.go
serviceaccount.go
serviceaccount_test.go
sorting_printer.go run hack/update-all 2017-06-22 11:31:03 -07:00
sorting_printer_test.go run hack/update-all 2017-06-22 11:31:03 -07:00
stop.go kubectl: note a bug with a comment 2017-06-23 09:49:30 -07:00
stop_test.go
versioned_client.go Update kubectl rollout to consume `.data` of DaemonSet history 2017-06-10 10:52:33 -07:00