kubernetes/pkg/kubectl
Kubernetes Submit Queue 8ceb0c4025 Merge pull request #41151 from ahakanbaba/tpr-unit-tests
Automatic merge from submit-queue (batch tested with PRs 41937, 41151, 42092, 40269, 42135)

Add a unit test for idempotent applys to the TPR entries.

The test in apply_test follows the general pattern of other tests.
We load from a file in test/fixtures and mock the API server in the
function closure in the HttpClient call.
The apply operation expects a last-modified-configuration annotation.
That is written verbatim in the test/fixture file.

References #40841



**What this PR does / why we need it**:
Adds one unit test for TPR's using applies. 

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
References: 
https://github.com/kubernetes/features/issues/95
https://github.com/kubernetes/kubernetes/issues/40841#issue-204769102


**Special notes for your reviewer**:

I am not super proud of the tpr-entry name. 
But I feel like we need to call the two objects differently. 
The one which has Kind:ThirdPartyResource 
and the one has Kind:Foo. 

Is the name "ThirdPartyResource" used interchangeably for both ? I used tpr-entry for the Kind:Foo object.

Also I !assume! this is testing an idempotent apply because the last-applied-configuration annotation is the same as the object itself. 

This is the state I see in the logs of kubectl if I do a proper idempotent apply of a third party resource entry. 

I guess I will know more once I start playing around with apply command that change TPR objects. 

**Release note**:

```release-note
```
2017-02-28 01:24:06 -08:00
..
cmd Merge pull request #41151 from ahakanbaba/tpr-unit-tests 2017-02-28 01:24:06 -08:00
metricsutil generated: bazel 2017-02-23 00:28:32 -05:00
resource kubectl should always set orphanDependents=false for cascading deletion 2017-02-23 12:04:13 -08:00
testing refactor: use metav1.ObjectMeta in other types 2017-01-17 16:17:19 -05:00
apply.go start the apimachinery repo 2017-01-11 09:09:48 -05:00
autoscale.go Update kubectl to work with new HPA objects 2017-02-07 22:25:28 -05:00
bash_comp_utils.go Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
BUILD generated: bazel 2017-02-23 00:28:32 -05:00
cluster.go refactor: use metav1.ObjectMeta in other types 2017-01-17 16:17:19 -05:00
cluster_test.go refactor: use metav1.ObjectMeta in other types 2017-01-17 16:17:19 -05:00
clusterrolebinding.go Switch RBAC subject apiVersion to apiGroup in v1beta1 2017-02-13 15:33:09 -05:00
configmap.go start the apimachinery repo 2017-01-11 09:09:48 -05:00
configmap_test.go refactor: use metav1.ObjectMeta in other types 2017-01-17 16:17:19 -05:00
deployment.go Fix comment for struct DeploymentBasicGeneratorV1 2017-02-21 20:47:06 +08:00
deployment_test.go refactor: use metav1.ObjectMeta in other types 2017-01-17 16:17:19 -05:00
doc.go Use Go canonical import paths 2016-07-16 13:48:21 -04:00
explain.go start the apimachinery repo 2017-01-11 09:09:48 -05:00
generate.go start the apimachinery repo 2017-01-11 09:09:48 -05:00
generate_test.go Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
history.go Refactor commands to use new factory method 2017-02-23 00:28:32 -05:00
interfaces.go find and replace 2017-01-20 08:04:53 -05:00
kubectl.go Refactor commands to use new factory method 2017-02-23 00:28:32 -05:00
kubectl_test.go Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
namespace.go start the apimachinery repo 2017-01-11 09:09:48 -05:00
namespace_test.go refactor: use metav1.ObjectMeta in other types 2017-01-17 16:17:19 -05:00
OWNERS Revert "update kubectl approvers" 2017-01-25 17:32:22 -08:00
pdb.go move util/intstr to apimachinery 2017-01-30 12:46:59 -05:00
proxy_server.go find and replace 2017-01-20 08:04:53 -05:00
proxy_server_test.go Merge pull request #38789 from jessfraz/cleanup-temp-dirs 2017-01-20 12:34:58 -08:00
quota.go start the apimachinery repo 2017-01-11 09:09:48 -05:00
quota_test.go refactor: use metav1.ObjectMeta in other types 2017-01-17 16:17:19 -05:00
resource_filter.go Refactor commands to use new factory method 2017-02-23 00:28:32 -05:00
rolebinding.go Switch RBAC subject apiVersion to apiGroup in v1beta1 2017-02-13 15:33:09 -05:00
rollback.go Refactor commands to use new factory method 2017-02-23 00:28:32 -05:00
rolling_updater.go Remove redundant pod helper 2017-02-10 17:58:59 +01:00
rolling_updater_test.go move util/intstr to apimachinery 2017-01-30 12:46:59 -05:00
rollout_status.go Moved tests and fixed typs 2017-02-27 09:15:56 +01:00
rollout_status_test.go refactor: use metav1.ObjectMeta in other types 2017-01-17 16:17:19 -05:00
run.go pkg/api/resource: move to apimachinery 2017-01-29 21:41:44 +01:00
run_test.go pkg/api/resource: move to apimachinery 2017-01-29 21:41:44 +01:00
scale.go Fix references to PetSet 2017-02-13 13:40:34 -08:00
scale_test.go move testing/core to client-go 2017-01-26 13:54:40 -05:00
secret.go start the apimachinery repo 2017-01-11 09:09:48 -05:00
secret_for_docker_registry.go start the apimachinery repo 2017-01-11 09:09:48 -05:00
secret_for_docker_registry_test.go refactor: use metav1.ObjectMeta in other types 2017-01-17 16:17:19 -05:00
secret_for_tls.go start the apimachinery repo 2017-01-11 09:09:48 -05:00
secret_for_tls_test.go move authoritative client-go utils out of pkg 2017-01-24 08:59:18 -05:00
secret_test.go refactor: use metav1.ObjectMeta in other types 2017-01-17 16:17:19 -05:00
service.go Merge pull request #38183 from tianshapjq/remove-create-external-load-balancer 2017-02-07 11:33:41 -08:00
service_basic.go move util/intstr to apimachinery 2017-01-30 12:46:59 -05:00
service_basic_test.go move util/intstr to apimachinery 2017-01-30 12:46:59 -05:00
service_test.go Merge pull request #38183 from tianshapjq/remove-create-external-load-balancer 2017-02-07 11:33:41 -08:00
serviceaccount.go start the apimachinery repo 2017-01-11 09:09:48 -05:00
serviceaccount_test.go refactor: use metav1.ObjectMeta in other types 2017-01-17 16:17:19 -05:00
sorting_printer.go Refactor commands to use new factory method 2017-02-23 00:28:32 -05:00
sorting_printer_test.go Fix sorting printer with missing fields 2017-01-28 19:56:53 -02:00
stop.go Merge pull request #40576 from nikhiljindal/kubectlcascDel 2017-02-26 12:58:01 -08:00
stop_test.go move testing/core to client-go 2017-01-26 13:54:40 -05:00
versioned_client.go run hack/update-codegen.sh 2016-12-14 12:39:49 -08:00