Commit Graph

24 Commits

Author SHA1 Message Date
k8s-ci-robot
8fd28eface
Merge pull request #69167 from apelisse/kubectl-diff
Move `diff` command from alpha sub-command to root cmd
2018-09-27 20:52:11 -07:00
Antoine Pelisse
e1eadc5031 Move diff command to root rather than alpha
New command is now `kubectl diff` rather than `kubectl alpha diff` since
it's moving out of alpha soon, and will be using dry-run apply to
produce the diff rather than the custom merge logic.
2018-09-27 13:11:43 -07:00
Antoine Pelisse
2d3f7795c8 Use dry-run patch to get the merged version of the object 2018-09-27 13:06:12 -07:00
k8s-ci-robot
63930183e0
Merge pull request #69119 from seans3/diff-small-fix
Replace internal reference of last-applied-config with external refer…
2018-09-27 09:51:29 -07:00
Sean Sullivan
7863e7c4ba Replace internal reference of last-applied-config with external reference for diff 2018-09-26 14:33:33 -07:00
Antoine Pelisse
0db6249740 kubectl-diff: Simplify interface
The current interface is kind of clunky and not super easy to use, since
you have to specify parameters to specify which versions to diff. Also
the default isn't the most useful setting.

Change the interface by removing all the parameters and force only one
useful use-case, that is: diffing what's currently live against
what would be live if applied.
2018-09-11 15:53:29 -07:00
Antoine Pelisse
a3417fe62c diff: Fix crash when remote object doesn't exist
Since we're saving nil in an interface rather than the implementation,
we can't compare to nil to check if the remote object exists or
not. Change the struct to save in the implementation.
2018-08-22 06:36:29 -07:00
Maciej Szulik
5b55e1f8ed
Create cli-runtime staging repository 2018-08-21 17:08:30 +02:00
David Eads
c85e69aeb9
remove unnecessary factory delegation for RESTClientGetter method 2018-05-28 15:12:41 +02:00
David Eads
eabfcfaa2b start splitting polymorphic functions out of the factory 2018-05-17 08:55:31 -04:00
Antoine Pelisse
f2b48a90df diff: Fix broken Local() logic
Local and Live functions where doing and returning the same thing,
giving empty results by default. Fix the local function by copying the
objects before fetching the live version.
2018-05-16 10:27:56 -07:00
David Eads
16d6a6c52f move resource builder to generic options 2018-05-10 14:15:12 -04:00
David Eads
facd04be43 use IOStreams for cli commands 2018-05-08 09:02:34 -04:00
Lion-Wei
e2dedc76a8 fix kubectl apply error message 2018-03-17 15:08:26 +08:00
David Eads
d8a5420b7c remove unneeded factory codec methods 2018-02-21 15:20:20 -05:00
Di Xu
48388fec7e fix all the typos across the project 2018-02-11 11:04:14 +08:00
Di Xu
1c715d51c4 some code change
fix wrong required flags

disable the addition of [flags] to the usage, use customized useline

fix function rename
2017-12-25 16:23:38 +08:00
Zhenguo Niu
2522b3601b Fix a typo in kubectl/diff cmd long description. 2017-12-01 14:31:12 +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
98e0c69907 Revert "refactor builder in kubectl factory"
This reverts commit 06c5be9802.
2017-11-19 19:02:21 -05:00
Dr. Stefan Schimanski
012b085ac8 pkg/apis/core: mechanical import fixes in dependencies 2017-11-09 12:14:08 +01:00
ymqytw
06c5be9802 refactor builder in kubectl factory 2017-11-07 20:16:27 -08:00
Antoine Pelisse
b916739d4f diff: Propragate errors when diffing
Because of that, errors while diffing would potentially not do anything,
leaving the user clueless of what was going on.
2017-10-30 14:16:36 -07:00
Antoine Pelisse
011a45cde7 Implement kubectl alpha diff to diff resources
`kubectl alpha diff` lets you diff your resources against live
resources, or last applied, or even preview what changes are going to be
applied on the cluster.

This is still quite premature, and mostly untested.
2017-10-23 10:49:02 -07:00