kubernetes/pkg/kubectl/cmd
Kubernetes Submit Queue ce8a6285df
Merge pull request #67635 from nikhita/customresource-subresource-patch-04
Automatic merge from submit-queue (batch tested with PRs 67298, 67518, 67635, 67673). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix unstructured metadata accessors to respect omitempty semantics

Fixes #67541
Fixes #48211 
Fixes #49075
Follow up of #67562

`ObjectMeta` has fields with `omitempty` json tags. This means that when the fields have zero values, they should not be persisted in the object.

Before this PR, some of the metadata accessors for unstructured objects did not respect these semantics i.e they would persist a field even if it had a zero value.

This PR updates the accessors so that the field is removed from the unstructured object map if it contains a zero value.

/sig api-machinery
/kind bug
/area custom-resources
/cc sttts liggitt yue9944882 roycaihw 
/assign sttts liggitt 

**Release note**:

```release-note
NONE
```
2018-08-21 18:33:07 -07:00
..
auth Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
config Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
create Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
get Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
rollout Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
scalejob moved dependency within kubernetes core to staging 2018-08-10 13:45:17 -07:00
set Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
templates Filter unavailable commands in help 2018-04-20 16:52:26 +02:00
testdata Fix tests to support ObjectMeta omitempty semantics 2018-08-21 13:17:25 +05:30
testing Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
util Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
wait Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
alpha.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
annotate_test.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
annotate.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
apiresources.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
apiversions.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
apply_edit_last_applied.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
apply_set_last_applied.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
apply_test.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
apply_view_last_applied.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
apply.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
attach_test.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
attach.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
autoscale.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
BUILD Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
certificates.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
clusterinfo_dump_test.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
clusterinfo_dump.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
clusterinfo.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
cmd_printing_test.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
cmd_test.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
cmd.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
completion.go improve kubectl completion help 2018-06-21 14:42:33 +08:00
convert_test.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
convert.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
cp_test.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
cp.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
delete_flags.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
delete_test.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
delete.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
describe_test.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
describe.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
diff_test.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
diff.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
drain_test.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
drain.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
edit_test.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
edit.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
exec_test.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
exec.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
explain.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
expose_test.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
expose.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
help.go some code change 2017-12-25 16:23:38 +08:00
label_test.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
label.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
logs_test.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
logs.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
options.go move i18n to kubectl/util 2017-08-16 12:27:36 -07:00
patch_test.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
patch.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
plugin.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
portforward_test.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
portforward.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
proxy.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
replace_test.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
replace.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
rollingupdate_test.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
rollingupdate.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
run_test.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
run.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
scale.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
taint_test.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
taint.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
top_node_test.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
top_node.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
top_pod_test.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
top_pod.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
top_test.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
top.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
version.go Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00