kubernetes/pkg/kubectl
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
..
apply Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
apps Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
cmd Merge pull request #67635 from nikhita/customresource-subresource-patch-04 2018-08-21 18:33:07 -07:00
explain Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
metricsutil Move validation dependency from pkg/apis/core/validation to staging 2018-08-09 15:52:59 -07:00
polymorphichelpers Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
proxy Enable kubectl proxy to set tcp keepalive 2018-06-25 11:03:05 +08:00
scheme Handle errors 2018-07-17 20:47:14 +10:00
util Log real file's name and line 2018-08-11 14:57:45 +02:00
validation Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
.import-restrictions fix verify about import error 2018-07-28 07:54:16 +08:00
apply.go remove confusing flexibility for metadata interpretation 2018-04-23 13:31:55 -04:00
autoscale_test.go update the import file for move util/pointer to k8s.io/utils 2018-07-27 19:47:02 +08:00
autoscale.go
BUILD Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
clusterrolebinding_test.go use subtest for table units (pkg/kubectl) 2018-05-27 10:04:55 +08:00
clusterrolebinding.go
conditions.go switching rolling update to external clients 2018-08-03 13:18:14 -04:00
configmap_test.go use subtest for table units (pkg/kubectl) 2018-05-27 10:04:55 +08:00
configmap.go
deployment_test.go use subtest for table units (pkg/kubectl) 2018-05-27 10:04:55 +08:00
deployment.go Add basic generator for apps/v1 deployment 2018-04-11 00:44:29 +05:30
doc.go
env_file_test.go use subtest for table units (pkg/kubectl) 2018-05-27 10:04:55 +08:00
env_file.go
generate_test.go use subtest for table units (pkg/kubectl) 2018-05-27 10:04:55 +08:00
generate.go
history_test.go
history.go kubectl: Use apps/v1 Deployment/ReplicaSet. 2018-05-22 13:43:06 -07:00
interfaces.go
namespace_test.go use subtest for table units (pkg/kubectl) 2018-05-27 10:04:55 +08:00
namespace.go
OWNERS Add Labels to various OWNERS files 2018-08-21 13:59:08 -04:00
pdb_test.go use subtest for table units (pkg/kubectl) 2018-05-27 10:04:55 +08:00
pdb.go
priorityclass_test.go fix kubectl create priorityclass failure bug 2018-07-02 15:03:22 +08:00
priorityclass.go fix kubectl create priorityclass failure bug 2018-07-02 15:03:22 +08:00
quota_test.go use subtest for table units (pkg/kubectl) 2018-05-27 10:04:55 +08:00
quota.go
rolebinding_test.go use subtest for table units (pkg/kubectl) 2018-05-27 10:04:55 +08:00
rolebinding.go
rollback_test.go
rollback.go kubectl: Use apps/v1 Deployment/ReplicaSet. 2018-05-22 13:43:06 -07:00
rolling_updater_test.go switching rolling update to external clients 2018-08-03 13:18:14 -04:00
rolling_updater.go switching rolling update to external clients 2018-08-03 13:18:14 -04:00
rollout_status_test.go Merge pull request #63747 from wgliang/master.test.kubectl 2018-06-20 12:39:21 -07:00
rollout_status.go kubectl: Remove an extra character from rollout error message 2018-07-04 14:24:14 -04:00
run_test.go Merge pull request #64938 from brendandburns/todo2 2018-06-21 04:15:08 -07:00
run.go Remove an old TODO. 2018-06-11 13:04:32 -07:00
scale_test.go Move dependency from k/k/pkg/apis/core to staging 2018-08-10 12:56:03 -07:00
scale.go Adding scale error retries 2018-06-12 11:23:16 +02:00
secret_for_docker_registry_test.go use subtest for table units (pkg/kubectl) 2018-05-27 10:04:55 +08:00
secret_for_docker_registry.go
secret_for_tls_test.go use subtest for table units (pkg/kubectl) 2018-05-27 10:04:55 +08:00
secret_for_tls.go
secret_test.go use subtest for table units (pkg/kubectl) 2018-05-27 10:04:55 +08:00
secret.go remove versioned printer 2018-05-17 17:20:54 -04:00
service_basic_test.go
service_basic.go
service_test.go use subtest for table units (pkg/kubectl) 2018-05-27 10:04:55 +08:00
service.go
serviceaccount_test.go use subtest for table units (pkg/kubectl) 2018-05-27 10:04:55 +08:00
serviceaccount.go
sorter_test.go use subtest for table units (pkg/kubectl) 2018-05-27 10:04:55 +08:00
sorter.go Merge pull request #62025 from hanxiaoshuai/bugfix0402 2018-05-22 08:40:16 -07:00