Commit Graph

165 Commits

Author SHA1 Message Date
k8s-merge-robot
07929972a3 Merge pull request #18835 from brendandburns/3rdparty
Automatic merge from submit-queue

Add support for 3rd party objects to kubectl

@deads2k @jlowdermilk

Instructions for playing around with this:

Run an apiserver with third party resources turned on (`--runtime-config=extensions/v1beta1=true,extensions/v1beta1/thirdpartyresources=true`)

Then you should be able to:

```
kubectl create -f rsrc.json
```

```json
{
  "metadata": {
    "name": "foo.company.com"
  },
  "apiVersion": "extensions/v1beta1",
  "kind": "ThirdPartyResource",
  "versions": [
    {
      "apiGroup": "group",
      "name": "v1"
    },
    {
      "apiGroup": "group",
      "name": "v2"
    }
  ]
}
```

Once that is done, you should be able to:

```
curl http://<server>/apis/company.com/v1/foos
```

```
curl -X POST -d @${HOME}/foo.json http://localhost:8080/apis/company.com/v1/namespaces/default/foos
```

```json
{
  "kind": "Foo",
  "apiVersion": "company.com/v1",
  "metadata": {
    "name": "baz"
  },
  "someField": "hello world",
  "otherField": 1
}
```

After this PR, you can do:

```
kubectl create -f foo.json
```

```
kubectl get foos
```

etc.
2016-03-31 18:09:56 -07:00
Brendan Burns
be6c5b332b Add third party support to kubectl 2016-03-31 10:53:32 -07:00
Janet Kuo
c1596e6711 Update guestbook examples; replace RC concepts with Deployment 2016-03-30 14:16:52 -07:00
Mike Metral
7403878ac0 allow kubectl cmd to process dirs recursively
reqs:
    - the kubectl cmd must support the -f | --filename flag
    - the kubectl cmd must support visiting a dir one level deep,
    or using more than one resource
2016-03-28 12:44:21 -07:00
Wojciech Tyczynski
89585237cd Rename RawJSON to Raw in runtime.RawExtension and add ContentType & ContentEncoding. 2016-03-18 12:35:27 +01:00
Wojciech Tyczynski
218d3e5923 Rename RawJSON to Raw in runtime.Unknown and add ContentType & ContentEncoding. 2016-03-16 16:43:58 +01:00
deads2k
5bd161a9cc allow resource.version.group in kubectl 2016-03-11 10:21:50 -05:00
Jordan Liggitt
560b02b3ec Prefer fetched version when determining HPA group version kind 2016-03-11 00:03:38 -05:00
Avesh Agarwal
ad6dfa0370 Fix kubectl create to create all resources in a url.
https://github.com/kubernetes/kubernetes/issues/18751 .
2016-03-02 18:08:24 -05:00
Kris
e664ef922f Move restclient to its own package 2016-02-29 12:05:13 -08:00
deads2k
9c42d219bc allow disambiguation of resouces 2016-02-25 07:35:23 -05:00
Clayton Coleman
d23c531869 Can't replace a generic resource that is cluster scoped
It should be allowed to invoke kubectl replace with a JSON file that has
no resource version set.  Namespaced resources were working correctly,
but cluster resources were silently failing to lookup the current state
of the object to get the resource version because we weren't using
NamespaceIfScoped(). Added a failing test.
2016-02-12 16:20:37 -05:00
Clayton Coleman
2fd38a7dc0 Break kubectl from assuming details of codecs
Most of the logic related to type and kind retrieval belongs in the
codec, not in the various classes. Make it explicit that the codec
should handle these details.

Factory now returns a universal Decoder and a JSONEncoder to assist code
in kubectl that needs to specifically deal with JSON serialization
(apply, merge, patch, edit, jsonpath). Add comments to indicate the
serialization is explicit in those places. These methods decode to
internal and encode to the preferred API version as previous, although
in the future they may be changed.

React to removing Codec from version interfaces and RESTMapping by
passing it in to all the places that it is needed.
2016-01-22 13:27:26 -05:00
nikhiljindal
2ad642d370 Merge registered and latest and move to apimachinery 2016-01-21 14:42:21 -08:00
David Oppenheimer
8ac484793d Comment out calls to httptest.Server.Close() to work around
https://github.com/golang/go/issues/12262 . See #19254 for
more details. This change should be reverted when we upgrade
to Go 1.6.
2016-01-11 23:02:11 -08:00
k8s-merge-robot
356487c951 Merge pull request #18101 from brendandburns/kubectl6
Auto commit by PR queue bot
2015-12-29 12:43:42 -08:00
k8s-merge-robot
500493a3ac Merge pull request #18925 from caesarxuchao/refactor-registration
Auto commit by PR queue bot
2015-12-24 15:19:36 -08:00
Chao Xu
2b5b708b70 Refactor the API registration and installation 2015-12-23 22:44:25 -08:00
Brendan Burns
4123a61df7 Add the client side bits of kubectl export 2015-12-22 10:41:59 -08:00
deads2k
20f9c2c545 find partial resource matches 2015-12-21 09:26:06 -05:00
k8s-merge-robot
649855128d Merge pull request #18627 from caesarxuchao/oneline-fix
Auto commit by PR queue bot
2015-12-19 00:50:31 -08:00
k8s-merge-robot
00c754108f Merge pull request #18165 from fabianofranz/fixes_get_show_all
Auto commit by PR queue bot
2015-12-18 20:01:20 -08:00
Abhishek Shah
6f63875165 Reverting 18442 2015-12-17 16:57:29 -08:00
Fabiano Franz
717896eae3 Fixes get --show-all 2015-12-17 18:35:54 -02:00
deads2k
41b78ad2b6 find partial resource matches 2015-12-16 10:19:31 -05:00
Chao Xu
5ba4f836f8 some small fix 2015-12-15 12:00:48 -08:00
deads2k
d0aaf13920 use constants for group names 2015-12-14 10:04:10 -05:00
deads2k
519b4e80d1 update NewObject for groupversionkind 2015-12-09 08:13:15 -05:00
deads2k
2ee3dfe415 update testapi to eliminate redundant fields 2015-12-07 15:54:26 -05:00
deads2k
f764e0099c Update ObjectTyper to GroupVersion 2015-12-07 08:35:05 -05:00
Chao Xu
6e192760e3 refactoring latest.go GroupVersion;
clean up latest.go GroupVersions;
remove latest.GroupMeta.Group;
remove latest.GroupMeta.Version.
2015-11-30 11:30:21 -08:00
deads2k
8679925847 update RESTMapping API to be properly typed 2015-11-25 14:02:37 -05:00
deads2k
5c4fb5bcbe make RESTMapper.KindFor 2015-11-25 14:02:37 -05:00
deads2k
5077e9b644 make register.GroupVersion use GroupVersion 2015-11-24 09:45:36 -05:00
feihujiang
ad79fa6e84 Move list functions from runtime to meta package 2015-11-20 09:20:55 +08:00
deads2k
303bcad398 use groupversion in RESTMapping 2015-11-16 09:22:11 -05:00
Kris
eacf65ddce Renaming HTTPClientFunc to CreateHTTPClient 2015-11-11 11:54:58 -08:00
Kris
4a4d195419 Exposing http.Client for configurable timeouts 2015-11-10 13:40:51 -08:00
k8s-merge-robot
a9534bfd33 Merge pull request #16441 from liggitt/helper_codec
Auto commit by PR queue bot
2015-10-30 11:29:17 -07:00
Fabiano Franz
d9161cb3b5 stdin is not a valid file extension for bash completions 2015-10-29 00:00:34 -02:00
Jordan Liggitt
b58e62e7d4 Pass runtime.Object to Helper.Create/Replace 2015-10-28 12:43:21 -04:00
Clayton Coleman
be868e934c Revert resource.Builder changes from 57388f9
57388f9f94
2015-10-21 16:23:33 -04:00
k8s-merge-robot
77207d75e1 Merge pull request #15667 from JanetKuo/kubectl-watch-list
Auto commit by PR queue bot
2015-10-19 06:28:35 -07:00
eulerzgy
f8f9afb874 alias local packagename for pkg/util/errors 2015-10-18 09:37:46 +08:00
Janet Kuo
33b9235312 Better error handling for watching a list of resources specified in a file 2015-10-14 16:38:03 -07:00
Chao Xu
fe7b85f6ea run goimports 2015-10-12 13:33:13 -07:00
Chao Xu
8654227c08 run grep-sed 2015-10-12 13:33:13 -07:00
Chao Xu
58ed8fd6fe run goimports 2015-10-12 13:33:13 -07:00
Chao Xu
654ceb6e5a run grep-sed 2015-10-12 13:33:13 -07:00
Chao Xu
50a2c4c643 grep-sed 2015-10-12 13:31:45 -07:00