Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for 3rd party objects to kubectl #18835

Merged
merged 2 commits into from
Apr 1, 2016

Conversation

brendandburns
Copy link
Contributor

@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
{
  "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
{
  "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.

@k8s-github-robot
Copy link

Labelling this PR as size/L

@k8s-github-robot k8s-github-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 17, 2015
@k8s-bot
Copy link

k8s-bot commented Dec 17, 2015

GCE e2e build/test failed for commit 199926c05554a22edfd73d3199c325cea4c128ae.

@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 18, 2015
@brendandburns brendandburns assigned j3ffml and unassigned bgrant0607 Dec 18, 2015
@k8s-bot
Copy link

k8s-bot commented Dec 18, 2015

GCE e2e build/test failed for commit 9cacb46f0bc2b3d296849ea6fd2262f2d844739b.

Resources map[string]unversioned.GroupVersionKind
}

func interfacesFor(version string) (*meta.VersionInterfaces, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see this used anywhere.

@j3ffml
Copy link
Contributor

j3ffml commented Dec 18, 2015

Second commit mostly lgtm. Not familiar enough with master/apiserver to comment on the first one.

@k8s-bot
Copy link

k8s-bot commented Dec 18, 2015

GCE e2e build/test failed for commit ade3e4e6b77c6ca483698502ed1983fee76fb70d.

@brendandburns brendandburns force-pushed the 3rdparty branch 2 times, most recently from b36e0bd to eb88094 Compare December 18, 2015 23:47
@brendandburns
Copy link
Contributor Author

@jlowdermilk comments addressed. second commit is the only one for review, the first commit is covered in: #18484

@j3ffml
Copy link
Contributor

j3ffml commented Dec 19, 2015

lgtm

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 19, 2015
clientVersions = append(clientVersions, registered.RegisteredGroupVersions[ix])
}
// Add in any third party group/version resources
list, err := gvClient.ThirdPartyResources(api.NamespaceDefault).List(api.ListOptions{})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forbidden's from this API request should be handled gracefully. I don't think I'd expect the whole method to fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 21, 2015
return priorityRESTMapper, api.Scheme
// return outputRESTMapper, api.Scheme
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove these two lines?

@k8s-bot
Copy link

k8s-bot commented Mar 31, 2016

GCE e2e build/test passed for commit 6d4fbe9fe5d6d52d870365822c5377603aa8f8eb.

@brendandburns
Copy link
Contributor Author

@k8s-bot unit test this please issue: #23533

@brendandburns
Copy link
Contributor Author

@caesarxuchao comments addressed, please take another look.

Thanks!
--brendan

@k8s-bot
Copy link

k8s-bot commented Mar 31, 2016

GCE e2e build/test passed for commit 79f0b45df212671647863f138ba851f4e0d6f3f9.

@k8s-bot
Copy link

k8s-bot commented Mar 31, 2016

GCE e2e build/test passed for commit be6c5b3.

@brendandburns
Copy link
Contributor Author

@caesarxuchao comments addressed and all green. Any chance for an LGTM? this one is a bear to keep in sync.

@caesarxuchao
Copy link
Member

Thanks @brendandburns. LGTM. We can incrementally fix the left issues.

@caesarxuchao caesarxuchao added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 31, 2016
@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented Mar 31, 2016

GCE e2e build/test passed for commit be6c5b3.

cfg, err := clientConfig.ClientConfig()
CheckErr(err)
cmdApiVersion := unversioned.GroupVersion{}
if cfg.GroupVersion != nil {
cmdApiVersion = *cfg.GroupVersion
}
if discoverDynamicAPIs {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @krousey I think you'd be interested in this. This is building REST mapper (with the exisiting RESTMapper struct) based on discovery results.

@eparis eparis added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Mar 31, 2016
@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented Mar 31, 2016

GCE e2e build/test passed for commit be6c5b3.

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented Apr 1, 2016

GCE e2e build/test passed for commit be6c5b3.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 0792997 into kubernetes:master Apr 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.