Commit Graph

54 Commits (be04e7c1b1393b895a7da23185d050db27294c4e)

Author SHA1 Message Date
David Eads be04e7c1b1 collapse printing paths 2018-02-21 08:15:22 -05:00
juanvallejo beb5ea641a
remove mapper dependency - PrintSuccess 2018-02-07 10:10:45 -05:00
ymqytw 0b0004e0c0 support openapi in apply 2017-11-21 10:22:43 -08:00
Clayton Coleman 5038eb2a3f
Remove use of VersionedObject and simplify builder in generic methods
Reduce all uses of Unstructured to the simpler form, and avoid asking
for mapper or typer unless it is required. Use Typed() for places that
previously used VersionedObject, and remove paths for versioned objects
from code that is now using unstructured.
2017-11-19 19:16:49 -05:00
Dr. Stefan Schimanski 012b085ac8 pkg/apis/core: mechanical import fixes in dependencies 2017-11-09 12:14:08 +01:00
Kubernetes Submit Queue 7efc6c83f0
Merge pull request #54046 from hzxuzhonghu/kubectl-apply
Automatic merge from submit-queue (batch tested with PRs 54326, 54046). 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>.

kubectl apply does not send empty patch request

**What this PR does / why we need it**:
`kubectl apply -f filename` always send patch request to apiserver, whether the file changed or not.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #54010

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-10-31 14:13:20 -07:00
Kubernetes Submit Queue a7a0a63f16
Merge pull request #54820 from sjevs/test/issue-54645-kubectl-apply-view-last-applied
Automatic merge from submit-queue (batch tested with PRs 54774, 54820, 52192, 54827). 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>.

Added a test for proper `%s` handling when display last applied confi…

**What this PR does / why we need it**:
Added missing tests which checks proper handling of `%s` in arguments for command `kubectl apply view-last-applied`

**Which issue this PR fixes**
#54645

**Special notes for your reviewer**:
Added a test case to cover specific issue described. 
It fails on version `v1.7.3`..`v1.7.9` and passes since `v1.8.0`. 

P.S. Not sure if there is already a lower level test which covers this case in the k8s test suite. I would recommend to add this test, so the issue would not reoccur.

**Release note**:
```release-note
NONE
```
2017-10-31 13:22:18 -07:00
Sergej Jevsejev c5bdd1da15 Added a test for proper `%s` handling when display last applied configuration 2017-10-30 23:03:10 +01:00
ymqytw 4487cc5e15 switch some commands to use its own scheme 2017-10-27 18:31:42 -07:00
hzxuzhonghu c5c56dcf35 kubectl apply does not send empty patch request 2017-10-28 09:12:57 +08:00
Solly Ross eac2049fc9 [client-go] avoid Registry in fake REST client
Previously, the fake RESTClient in client-go required a Registry.  It
used the Registry to fetch the GroupVersion for the fake client.
However, the way it did so was dubious in some cases (it hard-coded the
default API group in places), and not strictly necssary.

This updates the fake client to just recieve the GroupVersion and
internal group name directly, instead of requiring a Registry, so that
it can be consumed in unit tests where a Registry isn't necessarily
readily available (e.g. elsewhere in client-go).
2017-10-19 11:01:44 -04:00
Dr. Stefan Schimanski 7773a30f67 pkg/api/legacyscheme: fixup imports 2017-10-18 17:23:55 +02:00
Fabiano Franz 183ff5237d Protect against nil panic in apply 2017-07-18 12:55:34 -03:00
juanvallejo f28ffdb5e9
replace hardcoded use of "kubectl" in apply warning msg 2017-07-13 16:19:19 -04:00
Alexander Campbell 6fd36c10ad kubectl/cmd: many small refactors
* Rename variables and functions to match Go convention.
   For example, UsageError --> UsageErrorf.
 * Remove redundant or unreachable code.
 * Simplify some utility functions (no functionality changes).
 * Fix hanging 'if { return } else { return }' constructs.
 * Fix several incorrect printf verbs.
2017-06-27 16:25:20 -07:00
Kubernetes Submit Queue e837c3bbc2 Merge pull request #46388 from lavalamp/whitlockjc-generic-webhook-admission
Automatic merge from submit-queue (batch tested with PRs 46239, 46627, 46346, 46388, 46524)

Dynamic webhook admission control plugin

Unit tests pass.

Needs plumbing:
* [ ] service resolver (depends on @wfender PR)
* [x] client cert (depends on ????)
* [ ] hook source (depends on @caesarxuchao PR)

Also at least one thing will need to be renamed after Chao's PR merges.

```release-note
Allow remote admission controllers to be dynamically added and removed by administrators.  External admission controllers make an HTTP POST containing details of the requested action which the service can approve or reject.
```
2017-06-02 23:37:42 -07:00
Daniel Smith d6e1140b5d Implement dynamic admission webhooks
Also fix a bug in rest client
2017-05-31 16:38:46 -07:00
Waseem Ahmad 8442a118ea Denote if a printer is generic.
This fixes #38779.

This allows us to avoid case in which printers.GetStandardPrinter
returns nil for both printer and err removing any potential panics that
may arise throughout kubectl commands.

Please see #38779 and #38112 for complete context.

Add comment explaining adding handlers to printers.HumanReadablePrinter
also remove an unnecessary conversion of printers.HumanReadablePrinter
to printers.ResourcePrinter.
2017-05-31 13:02:23 +05:30
Zihong Zheng c0920f75cf Move API annotations into annotation_key_constants and remove api/annotations package 2017-05-16 21:55:23 -07:00
Kubernetes Submit Queue 34b31c8f32 Merge pull request #41699 from liggitt/apply-output-result
Automatic merge from submit-queue (batch tested with PRs 40746, 41699, 42108, 42174, 42093)

Output result of apply operation

Fixes #41690 

Plumbs the resulting object from patch operations back to the top level so it can be output when printing
2017-02-28 07:51:22 -08:00
Hakan Baba 1cc30bdfb2 Add a unit test for applies and idempotent applys to the TPR entries.
The tests 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.
In PATCH request rount-tripper we check that the kubectl apply
implementation worked as expected.

References #40841
2017-02-27 10:22:12 -08:00
Jordan Liggitt 4592c47ad4
Output result of apply operation 2017-02-27 09:28:28 -05:00
Shiyang Wang 9bace3e379 add apply-set-last-applied subcommand
update

update code

update unit tests

hack/update

remove spew

update bazel

updated

add comments

remove unused parameter

remove hardcode

bump unit tests

add new flags

add unit tests

add bazel

genreate doc
2017-02-24 11:11:39 +08:00
shiywang 557c18694a Add apply view last-applied subcommand
change to GetOriginalConfiguration

add bazel

refactor apply view-last-applied command

update some changes

minor change

add unit tests, update

update some codes and genreate docs

update LongDesc
2017-02-21 20:08:25 +08:00
Jordan Liggitt cf74abd892
fixup apply null tests 2017-01-31 15:00:23 -05:00
Anastasis Andronidis 4bdcc03c0b
test for explicit null value propagation in apply 2017-01-31 14:22:24 -05:00
Jordan Liggitt aaf96a1048
apply: use unstructured objects 2017-01-26 19:59:26 -05:00
deads2k 502bfdf944 client/restclient/fake move to client-go 2017-01-25 08:29:48 -05:00
deads2k 77b4d55982 mechanical 2017-01-16 09:35:12 -05:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
ymqytw b6cfa9aa98 warn user if they try to apply on an object without the annotation 2016-12-09 17:29:31 -08:00
Clayton Coleman 35a6bfbcee
generated: refactor 2016-11-23 22:30:47 -06:00
ymqytw 3cc294b1e0 Revert "support patch list of primitives"
This reverts commit 34891ad9f6.
2016-11-22 21:06:36 -08: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
ymqytw 34891ad9f6 support patch list of primitives 2016-11-09 11:46:59 -08:00
Chao Xu fd2fdfba89 move client/unversioned/fake to client/restclient/fake 2016-10-29 14:22:02 -07: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
Kubernetes Submit Queue 35e9f4d07f Merge pull request #31235 from ping035627/ping035627-patch-0823-1
Automatic merge from submit-queue

Implement replace with a call to testapi.Codec()

Implement replace with a call to testapi.Codec().
2016-09-26 18:02:49 -07:00
Brendan Burns 23c7c2e3e7 Add namespace error checking if a resource is not found. 2016-09-14 06:51:36 -07:00
Piotr Skamruk dc3674c8d0 Ensure that we are closing files. 2016-09-12 09:33:24 +02:00
PingWang 5a9848207a implement replace with a call to testapi.Codec()
Signed-off-by: PingWang <wang.ping5@zte.com.cn>

delete comments

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

update annotateRuntimeObject

Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-09-01 17:34:54 +08:00
Wojciech Tyczynski 7403564366 Remove Codec from ContentConfig. 2016-07-08 13:53:09 +02:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
AdoHe 69bcdc20ff kubectl apply retry stale resource version 2016-06-09 00:14:17 -04:00
Wojciech Tyczynski 5d046fed41 Fix tests for renegotiation 2016-05-12 08:21:11 +02:00
jianhuiz 441e206671 move server client shared annotations to new api/annotations package 2016-05-09 11:10:44 -07:00
Wojciech Tyczynski 2699be2e7e Switch api.ObjetaMetaFor to meta.Accessor 2016-03-31 17:52:31 +02:00
Sam Ghods fd5747f89c Fix reference to versioned object in kubectl apply
Fixes #19639
2016-02-10 14:11:44 -08:00
Brendan Burns 4123a61df7 Add the client side bits of kubectl export 2015-12-22 10:41:59 -08:00