Commit Graph

67 Commits (1d633b7fddb3060a0e37f77d4c148257f1060e69)

Author SHA1 Message Date
Clayton Coleman 35a6bfbcee
generated: refactor 2016-11-23 22:30:47 -06:00
ymqytw d178bc76ed Revert "add a unit test"
This reverts commit 11653b11c1.
2016-11-22 21:01:20 -08:00
ymqytw 11653b11c1 add a unit test 2016-11-18 15:35:50 -08:00
Dr. Stefan Schimanski 14ce6f6065 Add caching for discovery info 2016-11-04 21:17:12 +01:00
Kubernetes Submit Queue 5a2c473c1c Merge pull request #36085 from deads2k/cli-05-generic-print
Automatic merge from submit-queue

have basic kubectl crud agnostic of registered types

Makes `kubectl get` agnostic to scheme (baked in API types).  This means that it will now work against generic API servers that are "kube shaped".

This is similar to the work done for `kubectl create` last release.  I'll split out the smaller command.  `kubectl get` looks a lot different, but this eliminates all special casing for TPR in those cases.



@fabianofranz
2016-11-04 08:17:02 -07:00
deads2k 61673c4b39 make kubectl get generic with respect to objects 2016-11-04 09:04:57 -04:00
Madhusudan.C.S 0092cda7ed Need type assertion because RESTClient() is now a method that returns and interface. 2016-11-01 21:59:51 -07:00
Madhusudan.C.S e69475d29e Make the fake command factory return the clientset with appropriate rest clients for all the API groups.
Calling `internalclientset.New()` with a rest client as an argument simply
copies that rest client to all the API group clients irrespective of the
configured GroupVersion or versionedAPIPath in the client. So only one
API group client gets the client configured correctly for that API
group. All the other API group clients get misconfigured rest clients.

On the other hand, `internalclientset.NewForConfigOrDie()` does the right
thing by reconfiguring the passed configs for each API group and
initializes an appropriate rest client for that group.

Now that we are relying on the `NewForConfigOrDie()` method to
initialize the rest clients, we need to swap the underlying http clients
in each of these rest clients with a fake one for testing.
2016-11-01 19:03:04 -07:00
Michal Fojtik 0faa27e62d Use PATCH when pausing/resuming objects and CalculatePatches to get the patch 2016-10-31 13:13:59 +01:00
Kubernetes Submit Queue 71ba8a90f0 Merge pull request #35732 from fabianofranz/run_cant_dryrun_with_attach
Automatic merge from submit-queue

Better kubectl run validations

Adds more validations to flags that must be mutually exclusive in `kubectl run`. For example, `--dry-run` must not be used with `--attach`, `--stdin` or `--tty`. Adds unit tests for these new validations and some previously existing ones.

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
NONE
```
2016-10-30 13:07:28 -07:00
Kubernetes Submit Queue 5f8dc216d1 Merge pull request #35427 from fabianofranz/issues_35426
Automatic merge from submit-queue

kubectl commands must not use the factory out of Run

Fixes https://github.com/kubernetes/kubernetes/issues/35426

@smarterclayton PTAL
2016-10-30 03:17:59 -07:00
Chao Xu fd2fdfba89 move client/unversioned/fake to client/restclient/fake 2016-10-29 14:22:02 -07:00
Clayton Coleman ca2f1b87ad
Replace negotiation with a new method that can extract info
Alter how runtime.SerializeInfo is represented to simplify negotiation
and reduce the need to allocate during negotiation. Simplify the dynamic
client's logic around negotiating type. Add more tests for media type
handling where necessary.
2016-10-28 11:30:11 -04:00
Fabiano Franz bc1a1d7b30 Better kubectl run validations 2016-10-27 20:05:26 -02:00
Fabiano Franz 60fc7b87be kubectl commands must not use the factory out of Run 2016-10-27 15:38:22 -02:00
deads2k 81ae13084d handle non-generated client removal 2016-10-26 16:10:41 -04:00
Angus Salkeld d58554a647 Move the common test functions from cmd_test.go to cmd/testing/fake.go
This is so that we can use NewAPIFactory() from cmd/set/*test.go
Up until now we would get a import loop error.

This commit also adds a basic unit test case for cmd/set/set_image.go
2016-10-19 08:53:26 +10:00