Commit Graph

24 Commits

Author SHA1 Message Date
Sean Sullivan
6c96a059dd Move pkg/kubectl/cmd/util and subdirs to staging 2019-07-29 13:08:41 -07:00
Sean Sullivan
7a64a66d61 Move pkg/kubectl/cmd/util/openapi to staging 2019-07-27 16:18:37 -07:00
Sean Sullivan
70984d8385 Moves pkg/kubectl/util/i18n to staging 2019-07-25 23:09:34 -07:00
Sean Sullivan
309de42878 Move pkg/kubectl/apply.go to staging 2019-07-24 20:40:25 -07:00
Sean Sullivan
67140f13fe Updated dependencies: BUILD/modules.txt 2019-07-18 15:43:26 -07:00
Sean Sullivan
140c62cd4c Update all imports to scheme in staging 2019-07-18 15:32:27 -07:00
Peter Swica
123fa89f21 Moved pkg/kubectl/util/term, pkg/kubectl/util/templates, pkg/kubectl/util/interrupt, and pkg/kubectl/util/interrupt to staging 2019-06-20 15:50:16 -04:00
Antoine Pelisse
eb904d8fa8 Add "fieldManager" to flag to PATCH/CREATE/UPDATE
And add a corresponding flag in kubectl (for apply), even though the
value is defaulted in kubectl with "kubectl".

The flag is required for Apply patch-type, and optional for other PATCH,
CREATE and UPDATE (in which case we fallback on the user-agent).
2019-03-08 16:03:03 -08:00
Ilya Dmitrichenko
6d7a9048b6
Move printers & resources packages
These packages deserve to live at the top level of `k8s.io/cli-runtime`,
as they are potentially of wider use than genericclioptions.
2019-03-07 23:00:24 +00:00
Jingfang Liu
b38cf738d6 update kubectl subcommand with -k changes 2019-02-25 16:30:50 -08:00
Antoine Pelisse
0e1d50e70f API Machinery, Kubectl and tests 2019-02-04 13:51:48 -08:00
Antoine Pelisse
95eec905c7 diff: Make filename cross-platform compatible 2018-12-11 15:36:26 -08:00
Antoine Pelisse
b6135f63aa diff: Fix overlapping filenames
The filename can overlap when multiple resources have the same name (but
obviously are of a different type). Include the name of the type in the
file name to prevent the overlap.
2018-12-11 09:19:52 -08:00
Antoine Pelisse
a889f37505 Optimistic-locking on diff
There is currently a race-condition when diffing, where we get the
object and then run a server-side dry-run patch and compare the two
results. If something changes the object on the server between the get
and the patch, the diff is going to show unrelated changes. We can now
specify the exact revisionversion that we want to patch, and that will
return a conflict, and we can retry multiple times to get a
non-conflicting diff. Eventually (after 3 times), we diff without
checking the version and throw a warning that the diff might be
partially wrong.
2018-11-20 14:34:37 -08:00
Davanum Srinivas
43f523d405
Switch to sigs.k8s.io/yaml from ghodss/yaml
Change-Id: Ic72b5131bf441d159012d67a6a3d87088d0e6d31
2018-11-07 13:17:32 -05:00
k8s-ci-robot
2129bc9f85
Merge pull request #69742 from apelisse/fix-diff-error
Rename KUBERNETES_EXTERNAL_DIFF to KUBECTL_EXTERNAL_DIFF
2018-10-13 09:54:52 -07:00
Antoine Pelisse
572a028148 kubectl diff: Print error when something goes wrong 2018-10-12 14:12:32 -07:00
Antoine Pelisse
54889d581a kubectl dry-run: Check for server didn't work on create
We changed the code to verify that the type supports dry-run, but we've
only done it for patch, not for create, which means that people can
create objects they don't want to create. We can actually simplify the
code by moving the check much earlier in the method, which fixes all
possible bug like this.
2018-10-12 11:30:49 -07:00
Antoine Pelisse
e31d14cb10 kubectl diff: Rename KUBERNETES_EXTERNAL_DIFF to KUBECTL_EXTERNAL_DIFF 2018-10-12 10:56:16 -07:00
k8s-ci-robot
6fc89ae92d
Merge pull request #69633 from soltysh/move_templates
Move pkg/kubectl/cmd/templates -> pkg/kubectl/util/templates
2018-10-12 10:07:07 -07:00
Maciej Szulik
21789b85a6
Move pkg/kubectl/cmd/templates -> pkg/kubectl/util/temlpates 2018-10-11 22:01:03 +02:00
Antoine Pelisse
f2e2a930f9 dry-run: Verify if the object supports dry-run
For each object, first we verify if they have a dryRun parameter in the
openapi for the patch verb. If we can't find the object, we assume that
CRD will behave like "namespace". So we check if namespace supports
dryRun. If it does, then we verify that the resource is a CRD.
2018-10-10 08:56:09 -07:00
Maciej Szulik
55d5df8a36
React to moves 2018-10-06 18:44:05 +02:00
Maciej Szulik
33adf367f9
Move each kubectl command to a separate directory 2018-10-06 18:44:05 +02:00