Commit Graph

29 Commits (284e8182a402cfd545fc000fedaea071fed873b0)

Author SHA1 Message Date
juanvallejo 27bd4ded04 wire printflags through additional cmds 2018-04-25 16:07:32 -04:00
David Eads e2a5c39b23 use record flags 2018-04-18 13:56:59 -04:00
Di Xu a08cb5b531 include file name in the error when visiting files 2018-03-09 10:19:20 +08:00
David Eads be04e7c1b1 collapse printing paths 2018-02-21 08:15:22 -05:00
Jeff Grafton ef56a8d6bb Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
juanvallejo beb5ea641a
remove mapper dependency - PrintSuccess 2018-02-07 10:10:45 -05:00
Jeff Grafton efee0704c6 Autogenerate BUILD files 2017-12-23 13:12:11 -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
Clayton Coleman f8cc69cafe
kubectl apply edit-last-applied should fail when version is missing
If a user edits last-applied-configuration and it doesn't have an
apiVersion or kind, the command should error out. Now that we check for
kind and version on the unstructured object typer, the previously
passing test now correctly fails. Add a new explicit failure test and
make the existing test pass.
2017-11-16 18:02:41 -05:00
Jeff Grafton aee5f457db update BUILD files 2017-10-15 18:18:13 -07:00
Kubernetes Submit Queue 577fdf91c2 Merge pull request #50205 from dixudx/fix_kubectl_edit_panic_nil_list
Automatic merge from submit-queue (batch tested with PRs 50537, 49699, 50160, 49025, 50205)

not allowing "kubectl edit <resource>" when you got an empty list

**What this PR does / why we need it**:
`kubectl edit` will panic when adding an empty list.

> panic: runtime error: index out of range

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

**Special notes for your reviewer**:
/assign @errordeveloper @mengqiy @janetkuo @fabianofranz
/cc @rootfs @soltysh @sttts

**Release note**:

```release-note
not allowing "kubectl edit <resource>" when you got an empty list
```
2017-08-11 19:44:04 -07:00
Jeff Grafton a7f49c906d Use buildozer to delete licenses() rules except under third_party/ 2017-08-11 09:32:39 -07:00
Jeff Grafton 33276f06be Use buildozer to remove deprecated automanaged tags 2017-08-11 09:31:50 -07:00
Jeff Grafton cf55f9ed45 Autogenerate BUILD files 2017-08-11 09:30:23 -07:00
Di Xu 6b2f3c81e2 forbid kubectl edit an empty list 2017-08-11 08:44:13 +08:00
Di Xu 2235d8d6cc update related files 2017-07-25 12:56:50 +08:00
Kubernetes Submit Queue 8ce6378512 Merge pull request #46091 from xilabao/new-output-in-edit
Automatic merge from submit-queue (batch tested with PRs 46091, 48280)

allow output patch string in edit command

**What this PR does / why we need it**:
allow user to get the patch from edit command if user is not familiar with the patch format.

```
# ./cluster/kubectl.sh create role a --verb=get,list --resource=no
role "a" created

# ./cluster/kubectl.sh edit role a --output-patch=true
Patch: {"rules":[{"apiGroups":[""],"resources":["nodes"],"verbs":["get","list","delete"]}]}
role "a" edited

# ./cluster/kubectl.sh create role b --verb=get,list --resource=no
role "b" created

# ./cluster/kubectl.sh patch role b -p '{"rules":[{"apiGroups":[""],"resources":["nodes"],"verbs":["get","list","delete"]}]}'
role "b" patched
```
**Which issue this PR fixes**: fixes #47173

**Special notes for your reviewer**:

**Release note**:

```release-note
Could get the patch from kubectl edit command
```
2017-07-16 18:04:42 -07:00
xilabao fe4afa8643 allow output patch string in edit command 2017-06-01 14:53:17 +08:00
ymqytw c3481b07d2 support setElementOrder 2017-05-31 15:08:25 -07:00
Shiyang Wang 4597658cb9 add `kubectl apply edit-last-applied` subcommand 2017-05-26 00:20:48 +08:00
Jeffrey Regan 7abff879d7 Introduce visibility rules to kubernetes code.
**What this PR does / why we need it**:

Visibility rules allow dependency control.  The rules currently in
place make all targets public, to override the default state of
private.  This PR removes public visibility from kubectl code.  It
uses specially named pacakge groups to identify "bad" dependencies on
kubectl code for later refactoring or removal.

**Which issue this PR fixes**

First in a series of PRs to address kubernetes/community#598

**Release note**:
```release-note
NONE
```
2017-05-15 12:50:56 -07:00
Mike Danese a05c3c0efd autogenerated 2017-04-14 10:40:57 -07:00
ymqytw 1cebb2c1bb make edit respect --save-config 2017-02-27 13:34:07 -08:00
Jordan Liggitt f8d2e4fa1c
Add 'kubectl edit' testcase for unknown field in known group/version/kind 2017-02-20 20:40:03 -05:00
Jordan Liggitt ec271f5c09
Switch 'kubectl edit' to use unstructured objects, handle schemaless objects
mark --output-version as deprecated, add example for fully-qualifying version to edit

Add 'kubectl edit' testcase for editing schemaed and schemaless data together

Add 'kubectl edit' testcase for editing unknown version of known group/kind
2017-02-14 14:55:02 -05:00
Jordan Liggitt 5b805bc18a
Simplify 'kubectl edit' logic
edit: make editFn operate on arguments regardless of mode

edit: simplify short-circuiting logic when re-editing a file containing an error

edit: factor out visitor building

edit: use resource builder to get results from edited file
2017-02-14 14:51:06 -05:00
Jordan Liggitt f86db18297
Add advanced 'kubectl edit' test scenarios
Add 'kubectl edit' testcase for saving a repeated error

Add 'kubectl edit' testcase for preserving an edited file with a syntax error

Add 'kubectl edit' testcase for recording command on list of objects
2017-02-14 14:50:45 -05:00
Jordan Liggitt c43192c0c1
Add edit command testcases 2017-02-04 00:11:30 -05:00
Jordan Liggitt af3505f53c
Add unit test framework for edit command 2017-02-04 00:11:29 -05:00