Commit 6b56d7ba authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #34976 from deads2k/api-30-separate-third-party

Automatic merge from submit-queue separate third party resources from master (moves + consequences) Remove the third party resource code from the main `Master` struct. I think we may be able to get this down to particular way to configure/`New` a generic API server.
parents 8290366a f9cbc425
...@@ -440,12 +440,10 @@ func TestDiscoveryAtAPIS(t *testing.T) { ...@@ -440,12 +440,10 @@ func TestDiscoveryAtAPIS(t *testing.T) {
} }
thirdPartyGV := unversioned.GroupVersionForDiscovery{GroupVersion: "company.com/v1", Version: "v1"} thirdPartyGV := unversioned.GroupVersionForDiscovery{GroupVersion: "company.com/v1", Version: "v1"}
master.addThirdPartyResourceStorage("/apis/company.com/v1", "foos", nil, master.thirdPartyResourceServer.InstallThirdPartyResource(&extensions.ThirdPartyResource{
unversioned.APIGroup{ ObjectMeta: api.ObjectMeta{Name: "foo.company.com"},
Name: "company.com", Versions: []extensions.APIVersion{{Name: "v1"}},
Versions: []unversioned.GroupVersionForDiscovery{thirdPartyGV}, })
PreferredVersion: thirdPartyGV,
})
resp, err = http.Get(server.URL + "/apis") resp, err = http.Get(server.URL + "/apis")
if !assert.NoError(err) { if !assert.NoError(err) {
......
/*
Copyright 2014 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package master
import (
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apiserver"
)
// dynamicLister is used to list resources for dynamic third party
// apis. It implements the apiserver.APIResourceLister interface
type dynamicLister struct {
m *Master
path string
}
func (d dynamicLister) ListAPIResources() []unversioned.APIResource {
return d.m.getExistingThirdPartyResources(d.path)
}
var _ apiserver.APIResourceLister = &dynamicLister{}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment