-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
110 changed files
with
4,896 additions
and
0 deletions.
There are no files selected for viewing
74 changes: 74 additions & 0 deletions
74
pkg/authorization/client/clientset_generated/release_v1_4/clientset.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package release_v1_4 | ||
|
||
import ( | ||
"github.com/golang/glog" | ||
v1core "github.com/openshift/origin/pkg/authorization/client/clientset_generated/release_v1_4/typed/core/v1" | ||
restclient "k8s.io/kubernetes/pkg/client/restclient" | ||
discovery "k8s.io/kubernetes/pkg/client/typed/discovery" | ||
"k8s.io/kubernetes/pkg/util/flowcontrol" | ||
) | ||
|
||
type Interface interface { | ||
Discovery() discovery.DiscoveryInterface | ||
Core() v1core.CoreInterface | ||
} | ||
|
||
// Clientset contains the clients for groups. Each group has exactly one | ||
// version included in a Clientset. | ||
type Clientset struct { | ||
*discovery.DiscoveryClient | ||
*v1core.CoreClient | ||
} | ||
|
||
// Core retrieves the CoreClient | ||
func (c *Clientset) Core() v1core.CoreInterface { | ||
if c == nil { | ||
return nil | ||
} | ||
return c.CoreClient | ||
} | ||
|
||
// Discovery retrieves the DiscoveryClient | ||
func (c *Clientset) Discovery() discovery.DiscoveryInterface { | ||
return c.DiscoveryClient | ||
} | ||
|
||
// NewForConfig creates a new Clientset for the given config. | ||
func NewForConfig(c *restclient.Config) (*Clientset, error) { | ||
configShallowCopy := *c | ||
if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { | ||
configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) | ||
} | ||
var clientset Clientset | ||
var err error | ||
clientset.CoreClient, err = v1core.NewForConfig(&configShallowCopy) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
clientset.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) | ||
if err != nil { | ||
glog.Errorf("failed to create the DiscoveryClient: %v", err) | ||
return nil, err | ||
} | ||
return &clientset, nil | ||
} | ||
|
||
// NewForConfigOrDie creates a new Clientset for the given config and | ||
// panics if there is an error in the config. | ||
func NewForConfigOrDie(c *restclient.Config) *Clientset { | ||
var clientset Clientset | ||
clientset.CoreClient = v1core.NewForConfigOrDie(c) | ||
|
||
clientset.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) | ||
return &clientset | ||
} | ||
|
||
// New creates a new Clientset for the given RESTClient. | ||
func New(c *restclient.RESTClient) *Clientset { | ||
var clientset Clientset | ||
clientset.CoreClient = v1core.New(c) | ||
|
||
clientset.DiscoveryClient = discovery.NewDiscoveryClient(c) | ||
return &clientset | ||
} |
4 changes: 4 additions & 0 deletions
4
pkg/authorization/client/clientset_generated/release_v1_4/doc.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// This package is generated by client-gen with arguments: --clientset-api-path=/oapi --clientset-name=release_v1_4 --clientset-path=github.com/openshift/origin/pkg/authorization/client/clientset_generated --go-header-file=hack/boilerplate.txt --input=[api/v1] --input-base=github.com/openshift/origin/pkg/authorization/api --output-base=../../.. | ||
|
||
// This package has the automatically generated clientset. | ||
package release_v1_4 |
52 changes: 52 additions & 0 deletions
52
pkg/authorization/client/clientset_generated/release_v1_4/fake/clientset_generated.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package fake | ||
|
||
import ( | ||
clientset "github.com/openshift/origin/pkg/authorization/client/clientset_generated/release_v1_4" | ||
v1core "github.com/openshift/origin/pkg/authorization/client/clientset_generated/release_v1_4/typed/core/v1" | ||
fakev1core "github.com/openshift/origin/pkg/authorization/client/clientset_generated/release_v1_4/typed/core/v1/fake" | ||
"k8s.io/kubernetes/pkg/api" | ||
"k8s.io/kubernetes/pkg/apimachinery/registered" | ||
"k8s.io/kubernetes/pkg/client/testing/core" | ||
"k8s.io/kubernetes/pkg/client/typed/discovery" | ||
fakediscovery "k8s.io/kubernetes/pkg/client/typed/discovery/fake" | ||
"k8s.io/kubernetes/pkg/runtime" | ||
"k8s.io/kubernetes/pkg/watch" | ||
) | ||
|
||
// NewSimpleClientset returns a clientset that will respond with the provided objects. | ||
// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, | ||
// without applying any validations and/or defaults. It shouldn't be considered a replacement | ||
// for a real clientset and is mostly useful in simple unit tests. | ||
func NewSimpleClientset(objects ...runtime.Object) *Clientset { | ||
o := core.NewObjectTracker(api.Scheme, api.Codecs.UniversalDecoder()) | ||
for _, obj := range objects { | ||
if err := o.Add(obj); err != nil { | ||
panic(err) | ||
} | ||
} | ||
|
||
fakePtr := core.Fake{} | ||
fakePtr.AddReactor("*", "*", core.ObjectReaction(o, registered.RESTMapper())) | ||
|
||
fakePtr.AddWatchReactor("*", core.DefaultWatchReactor(watch.NewFake(), nil)) | ||
|
||
return &Clientset{fakePtr} | ||
} | ||
|
||
// Clientset implements clientset.Interface. Meant to be embedded into a | ||
// struct to get a default implementation. This makes faking out just the method | ||
// you want to test easier. | ||
type Clientset struct { | ||
core.Fake | ||
} | ||
|
||
func (c *Clientset) Discovery() discovery.DiscoveryInterface { | ||
return &fakediscovery.FakeDiscovery{Fake: &c.Fake} | ||
} | ||
|
||
var _ clientset.Interface = &Clientset{} | ||
|
||
// Core retrieves the CoreClient | ||
func (c *Clientset) Core() v1core.CoreInterface { | ||
return &fakev1core.FakeCore{Fake: &c.Fake} | ||
} |
4 changes: 4 additions & 0 deletions
4
pkg/authorization/client/clientset_generated/release_v1_4/fake/doc.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// This package is generated by client-gen with arguments: --clientset-api-path=/oapi --clientset-name=release_v1_4 --clientset-path=github.com/openshift/origin/pkg/authorization/client/clientset_generated --go-header-file=hack/boilerplate.txt --input=[api/v1] --input-base=github.com/openshift/origin/pkg/authorization/api --output-base=../../.. | ||
|
||
// This package has the automatically generated fake clientset. | ||
package fake |
80 changes: 80 additions & 0 deletions
80
pkg/authorization/client/clientset_generated/release_v1_4/typed/core/v1/core_client.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
package v1 | ||
|
||
import ( | ||
api "k8s.io/kubernetes/pkg/api" | ||
registered "k8s.io/kubernetes/pkg/apimachinery/registered" | ||
restclient "k8s.io/kubernetes/pkg/client/restclient" | ||
serializer "k8s.io/kubernetes/pkg/runtime/serializer" | ||
) | ||
|
||
type CoreInterface interface { | ||
GetRESTClient() *restclient.RESTClient | ||
PoliciesGetter | ||
} | ||
|
||
// CoreClient is used to interact with features provided by the Core group. | ||
type CoreClient struct { | ||
*restclient.RESTClient | ||
} | ||
|
||
func (c *CoreClient) Policies(namespace string) PolicyInterface { | ||
return newPolicies(c, namespace) | ||
} | ||
|
||
// NewForConfig creates a new CoreClient for the given config. | ||
func NewForConfig(c *restclient.Config) (*CoreClient, error) { | ||
config := *c | ||
if err := setConfigDefaults(&config); err != nil { | ||
return nil, err | ||
} | ||
client, err := restclient.RESTClientFor(&config) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return &CoreClient{client}, nil | ||
} | ||
|
||
// NewForConfigOrDie creates a new CoreClient for the given config and | ||
// panics if there is an error in the config. | ||
func NewForConfigOrDie(c *restclient.Config) *CoreClient { | ||
client, err := NewForConfig(c) | ||
if err != nil { | ||
panic(err) | ||
} | ||
return client | ||
} | ||
|
||
// New creates a new CoreClient for the given RESTClient. | ||
func New(c *restclient.RESTClient) *CoreClient { | ||
return &CoreClient{c} | ||
} | ||
|
||
func setConfigDefaults(config *restclient.Config) error { | ||
// if core group is not registered, return an error | ||
g, err := registered.Group("") | ||
if err != nil { | ||
return err | ||
} | ||
config.APIPath = "/oapi" | ||
if config.UserAgent == "" { | ||
config.UserAgent = restclient.DefaultKubernetesUserAgent() | ||
} | ||
// TODO: Unconditionally set the config.Version, until we fix the config. | ||
//if config.Version == "" { | ||
copyGroupVersion := g.GroupVersion | ||
config.GroupVersion = ©GroupVersion | ||
//} | ||
|
||
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs} | ||
|
||
return nil | ||
} | ||
|
||
// GetRESTClient returns a RESTClient that is used to communicate | ||
// with API server by this client implementation. | ||
func (c *CoreClient) GetRESTClient() *restclient.RESTClient { | ||
if c == nil { | ||
return nil | ||
} | ||
return c.RESTClient | ||
} |
4 changes: 4 additions & 0 deletions
4
pkg/authorization/client/clientset_generated/release_v1_4/typed/core/v1/doc.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// This package is generated by client-gen with arguments: --clientset-api-path=/oapi --clientset-name=release_v1_4 --clientset-path=github.com/openshift/origin/pkg/authorization/client/clientset_generated --go-header-file=hack/boilerplate.txt --input=[api/v1] --input-base=github.com/openshift/origin/pkg/authorization/api --output-base=../../.. | ||
|
||
// This package has the automatically generated typed clients. | ||
package v1 |
4 changes: 4 additions & 0 deletions
4
pkg/authorization/client/clientset_generated/release_v1_4/typed/core/v1/fake/doc.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// This package is generated by client-gen with arguments: --clientset-api-path=/oapi --clientset-name=release_v1_4 --clientset-path=github.com/openshift/origin/pkg/authorization/client/clientset_generated --go-header-file=hack/boilerplate.txt --input=[api/v1] --input-base=github.com/openshift/origin/pkg/authorization/api --output-base=../../.. | ||
|
||
// Package fake has the automatically generated clients. | ||
package fake |
21 changes: 21 additions & 0 deletions
21
...horization/client/clientset_generated/release_v1_4/typed/core/v1/fake/fake_core_client.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package fake | ||
|
||
import ( | ||
v1 "github.com/openshift/origin/pkg/authorization/client/clientset_generated/release_v1_4/typed/core/v1" | ||
restclient "k8s.io/kubernetes/pkg/client/restclient" | ||
core "k8s.io/kubernetes/pkg/client/testing/core" | ||
) | ||
|
||
type FakeCore struct { | ||
*core.Fake | ||
} | ||
|
||
func (c *FakeCore) Policies(namespace string) v1.PolicyInterface { | ||
return &FakePolicies{c, namespace} | ||
} | ||
|
||
// GetRESTClient returns a RESTClient that is used to communicate | ||
// with API server by this client implementation. | ||
func (c *FakeCore) GetRESTClient() *restclient.RESTClient { | ||
return nil | ||
} |
101 changes: 101 additions & 0 deletions
101
pkg/authorization/client/clientset_generated/release_v1_4/typed/core/v1/fake/fake_policy.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
package fake | ||
|
||
import ( | ||
v1 "github.com/openshift/origin/pkg/authorization/api/v1" | ||
api "k8s.io/kubernetes/pkg/api" | ||
unversioned "k8s.io/kubernetes/pkg/api/unversioned" | ||
core "k8s.io/kubernetes/pkg/client/testing/core" | ||
labels "k8s.io/kubernetes/pkg/labels" | ||
watch "k8s.io/kubernetes/pkg/watch" | ||
) | ||
|
||
// FakePolicies implements PolicyInterface | ||
type FakePolicies struct { | ||
Fake *FakeCore | ||
ns string | ||
} | ||
|
||
var policiesResource = unversioned.GroupVersionResource{Group: "", Version: "v1", Resource: "policies"} | ||
|
||
func (c *FakePolicies) Create(policy *v1.Policy) (result *v1.Policy, err error) { | ||
obj, err := c.Fake. | ||
Invokes(core.NewCreateAction(policiesResource, c.ns, policy), &v1.Policy{}) | ||
|
||
if obj == nil { | ||
return nil, err | ||
} | ||
return obj.(*v1.Policy), err | ||
} | ||
|
||
func (c *FakePolicies) Update(policy *v1.Policy) (result *v1.Policy, err error) { | ||
obj, err := c.Fake. | ||
Invokes(core.NewUpdateAction(policiesResource, c.ns, policy), &v1.Policy{}) | ||
|
||
if obj == nil { | ||
return nil, err | ||
} | ||
return obj.(*v1.Policy), err | ||
} | ||
|
||
func (c *FakePolicies) Delete(name string, options *api.DeleteOptions) error { | ||
_, err := c.Fake. | ||
Invokes(core.NewDeleteAction(policiesResource, c.ns, name), &v1.Policy{}) | ||
|
||
return err | ||
} | ||
|
||
func (c *FakePolicies) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { | ||
action := core.NewDeleteCollectionAction(policiesResource, c.ns, listOptions) | ||
|
||
_, err := c.Fake.Invokes(action, &v1.PolicyList{}) | ||
return err | ||
} | ||
|
||
func (c *FakePolicies) Get(name string) (result *v1.Policy, err error) { | ||
obj, err := c.Fake. | ||
Invokes(core.NewGetAction(policiesResource, c.ns, name), &v1.Policy{}) | ||
|
||
if obj == nil { | ||
return nil, err | ||
} | ||
return obj.(*v1.Policy), err | ||
} | ||
|
||
func (c *FakePolicies) List(opts api.ListOptions) (result *v1.PolicyList, err error) { | ||
obj, err := c.Fake. | ||
Invokes(core.NewListAction(policiesResource, c.ns, opts), &v1.PolicyList{}) | ||
|
||
if obj == nil { | ||
return nil, err | ||
} | ||
|
||
label := opts.LabelSelector | ||
if label == nil { | ||
label = labels.Everything() | ||
} | ||
list := &v1.PolicyList{} | ||
for _, item := range obj.(*v1.PolicyList).Items { | ||
if label.Matches(labels.Set(item.Labels)) { | ||
list.Items = append(list.Items, item) | ||
} | ||
} | ||
return list, err | ||
} | ||
|
||
// Watch returns a watch.Interface that watches the requested policies. | ||
func (c *FakePolicies) Watch(opts api.ListOptions) (watch.Interface, error) { | ||
return c.Fake. | ||
InvokesWatch(core.NewWatchAction(policiesResource, c.ns, opts)) | ||
|
||
} | ||
|
||
// Patch applies the patch and returns the patched policy. | ||
func (c *FakePolicies) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Policy, err error) { | ||
obj, err := c.Fake. | ||
Invokes(core.NewPatchSubresourceAction(policiesResource, c.ns, name, data, subresources...), &v1.Policy{}) | ||
|
||
if obj == nil { | ||
return nil, err | ||
} | ||
return obj.(*v1.Policy), err | ||
} |
3 changes: 3 additions & 0 deletions
3
...uthorization/client/clientset_generated/release_v1_4/typed/core/v1/generated_expansion.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package v1 | ||
|
||
type PolicyExpansion interface{} |
Oops, something went wrong.