kubernetes/pkg/kubectl/cmd
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
..
auth This change add nonResourceURL to kubectl auth cani 2017-05-31 11:25:29 +08:00
config kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
rollout kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
set kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
templates Introduce visibility rules to kubernetes code. 2017-05-15 12:50:56 -07:00
testdata/edit support setElementOrder 2017-05-31 15:08:25 -07:00
testing fix --local flag for kubectl set commands 2017-06-13 12:57:05 -04:00
util kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
alpha.go Create a kubectl alpha subcommand 2017-06-16 07:09:21 +00:00
annotate_test.go kubectl/cmd: remove a bunch of unused parameters 2017-04-04 10:36:30 +01:00
annotate.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
apiversions.go Fix kubectl api-versions caching 2017-06-24 01:14:31 -04:00
apply_edit_last_applied.go kubectl: fix inaccurate usage messages for --windows-line-endings 2017-06-23 09:49:30 -07:00
apply_set_last_applied.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
apply_test.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
apply_view_last_applied.go Merge pull request #45611 from atombender/issue-45608 2017-06-28 12:55:21 -07:00
apply.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
attach_test.go clean up: put test description in head to locate quickly 2017-05-19 02:04:59 +08:00
attach.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
autoscale.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
BUILD Merge pull request #47471 from crimsonfaith91/drain 2017-06-23 05:08:30 -07:00
certificates.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
clusterinfo_dump_test.go Move the common test functions from cmd_test.go to cmd/testing/fake.go 2016-10-19 08:53:26 +10:00
clusterinfo_dump.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
clusterinfo.go fix --local flag for kubectl set commands 2017-06-13 12:57:05 -04:00
cmd_test.go Move more printers to TablePrinter 2017-06-26 11:38:36 -04:00
cmd.go Merge pull request #46151 from verb/kubectl-featuregate 2017-06-23 05:00:35 -07:00
completion.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
convert.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
cp_test.go add kubectl cp 2016-10-29 20:24:54 -07:00
cp.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
create_clusterrole_test.go Merge pull request #46265 from waseem/printers-genericity 2017-06-02 19:53:40 -07:00
create_clusterrole.go support NonResourceURL for kubectl create clusterrole 2017-05-26 10:07:44 +08:00
create_clusterrolebinding.go cmd: refactor common err expr into helper function 2017-06-23 09:49:30 -07:00
create_configmap_test.go client/restclient/fake move to client-go 2017-01-25 08:29:48 -05:00
create_configmap.go cmd: refactor common err expr into helper function 2017-06-23 09:49:30 -07:00
create_deployment_test.go cmd/create_deployment: refactor & test long function 2017-06-26 11:17:53 -07:00
create_deployment.go cmd/create_deployment: refactor & test long function 2017-06-26 11:17:53 -07:00
create_namespace_test.go client/restclient/fake move to client-go 2017-01-25 08:29:48 -05:00
create_namespace.go cmd: refactor common err expr into helper function 2017-06-23 09:49:30 -07:00
create_pdb_test.go add test for kubectl create pdb 2017-05-26 17:38:26 +08:00
create_pdb.go cmd: refactor common err expr into helper function 2017-06-23 09:49:30 -07:00
create_quota_test.go Fix test not use test flags 2017-05-24 10:14:00 +08:00
create_quota.go cmd: refactor common err expr into helper function 2017-06-23 09:49:30 -07:00
create_role_test.go Merge pull request #46706 from CaoShuFeng/unit-create-role 2017-06-03 18:30:40 -07:00
create_role.go Remove redirect verb parsing 2017-06-21 11:17:24 -04:00
create_rolebinding_test.go Supplement unit tests to kubectl create rolebinding command. 2017-03-29 16:36:22 +08:00
create_rolebinding.go cmd: refactor common err expr into helper function 2017-06-23 09:49:30 -07:00
create_secret_test.go client/restclient/fake move to client-go 2017-01-25 08:29:48 -05:00
create_secret.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
create_service_test.go add test to cover more in kubectl create service 2017-05-16 18:45:38 +08:00
create_service.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
create_serviceaccount_test.go client/restclient/fake move to client-go 2017-01-25 08:29:48 -05:00
create_serviceaccount.go cmd: refactor common err expr into helper function 2017-06-23 09:49:30 -07:00
create_test.go Distinguish between client and unstructuredclient in fake factory 2017-01-26 19:59:16 -05:00
create.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
delete_test.go orphan when kubectl delete --cascade=false 2017-05-11 09:11:07 -04:00
delete.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
describe_test.go describe: use unstructured objects 2017-01-26 19:59:25 -05:00
describe.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
drain_test.go deprecate created-by annotation for pod drain 2017-06-16 13:33:26 -07:00
drain.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
edit_test.go kubectl: simplify code with help of linter 2017-06-23 09:49:30 -07:00
edit.go kubectl: fix inaccurate usage messages for --windows-line-endings 2017-06-23 09:49:30 -07:00
exec_test.go clean up: put test description in head to locate quickly 2017-05-19 02:04:59 +08:00
exec.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
explain.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
expose_test.go Refactor commands to use new factory method 2017-02-23 00:28:32 -05:00
expose.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
get_test.go kubectl: simplify code with help of linter 2017-06-23 09:49:30 -07:00
get.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
help.go Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn> 2017-04-25 15:07:01 +08:00
label_test.go kubectl/cmd: remove a bunch of unused parameters 2017-04-04 10:36:30 +01:00
label.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
logs_test.go client/restclient/fake move to client-go 2017-01-25 08:29:48 -05:00
logs.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
options.go cmd/options: kubectl options writes to out stream 2017-05-28 11:23:44 -07:00
patch_test.go Denote if a printer is generic. 2017-05-31 13:02:23 +05:30
patch.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
plugin_test.go kubectl plugins have access config, global flags and environment 2017-05-19 19:17:43 -03:00
plugin.go kubectl plugins have access config, global flags and environment 2017-05-19 19:17:43 -03:00
portforward_test.go kubectl/cmd: remove a bunch of unused parameters 2017-04-04 10:36:30 +01:00
portforward.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
proxy.go kubectl: fixes issues #45736 and #45737 2017-05-22 18:57:11 -04:00
replace_test.go Distinguish between client and unstructuredclient in fake factory 2017-01-26 19:59:16 -05:00
replace.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
rollingupdate_test.go small change to clear 2017-05-11 20:09:31 +08:00
rollingupdate.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
run_test.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
run.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
scale.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
stop.go fix --local flag for kubectl set commands 2017-06-13 12:57:05 -04:00
taint_test.go run hack/update-all 2017-06-22 11:31:03 -07:00
taint.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
top_node_test.go hack/update-bazal.sh 2017-05-15 13:51:39 -07:00
top_node.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
top_pod_test.go run hack/update-all 2017-06-22 11:31:03 -07:00
top_pod.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00
top_test.go run hack/update-all 2017-06-22 11:31:03 -07:00
top.go Extract a bunch more strings from kubectl 2017-04-06 20:12:50 -07:00
version.go kubectl/cmd: many small refactors 2017-06-27 16:25:20 -07:00