This is a huge commit, it does following things: (#1942)

1. Remove ks-iam standalone binary, move it to ks-apiserver
2. Generate all devops apis inside kubesphere repository, no need to
import s2ioperator.
3. Reorganize ldap code, make it more flexible to use.
This commit is contained in:
zryfish
2020-03-10 13:50:17 +08:00
committed by GitHub
parent 7270307b66
commit 641615b299
235 changed files with 5538 additions and 38064 deletions

View File

@@ -27,6 +27,9 @@ import (
type DevopsV1alpha1Interface interface {
RESTClient() rest.Interface
S2iBinariesGetter
S2iBuildersGetter
S2iBuilderTemplatesGetter
S2iRunsGetter
}
// DevopsV1alpha1Client is used to interact with features provided by the devops.kubesphere.io group.
@@ -38,6 +41,18 @@ func (c *DevopsV1alpha1Client) S2iBinaries(namespace string) S2iBinaryInterface
return newS2iBinaries(c, namespace)
}
func (c *DevopsV1alpha1Client) S2iBuilders(namespace string) S2iBuilderInterface {
return newS2iBuilders(c, namespace)
}
func (c *DevopsV1alpha1Client) S2iBuilderTemplates() S2iBuilderTemplateInterface {
return newS2iBuilderTemplates(c)
}
func (c *DevopsV1alpha1Client) S2iRuns(namespace string) S2iRunInterface {
return newS2iRuns(c, namespace)
}
// NewForConfig creates a new DevopsV1alpha1Client for the given config.
func NewForConfig(c *rest.Config) (*DevopsV1alpha1Client, error) {
config := *c

View File

@@ -32,6 +32,18 @@ func (c *FakeDevopsV1alpha1) S2iBinaries(namespace string) v1alpha1.S2iBinaryInt
return &FakeS2iBinaries{c, namespace}
}
func (c *FakeDevopsV1alpha1) S2iBuilders(namespace string) v1alpha1.S2iBuilderInterface {
return &FakeS2iBuilders{c, namespace}
}
func (c *FakeDevopsV1alpha1) S2iBuilderTemplates() v1alpha1.S2iBuilderTemplateInterface {
return &FakeS2iBuilderTemplates{c}
}
func (c *FakeDevopsV1alpha1) S2iRuns(namespace string) v1alpha1.S2iRunInterface {
return &FakeS2iRuns{c, namespace}
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeDevopsV1alpha1) RESTClient() rest.Interface {

View File

@@ -0,0 +1,140 @@
/*
Copyright 2019 The KubeSphere 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
v1alpha1 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha1"
)
// FakeS2iBuilders implements S2iBuilderInterface
type FakeS2iBuilders struct {
Fake *FakeDevopsV1alpha1
ns string
}
var s2ibuildersResource = schema.GroupVersionResource{Group: "devops.kubesphere.io", Version: "v1alpha1", Resource: "s2ibuilders"}
var s2ibuildersKind = schema.GroupVersionKind{Group: "devops.kubesphere.io", Version: "v1alpha1", Kind: "S2iBuilder"}
// Get takes name of the s2iBuilder, and returns the corresponding s2iBuilder object, and an error if there is any.
func (c *FakeS2iBuilders) Get(name string, options v1.GetOptions) (result *v1alpha1.S2iBuilder, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(s2ibuildersResource, c.ns, name), &v1alpha1.S2iBuilder{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.S2iBuilder), err
}
// List takes label and field selectors, and returns the list of S2iBuilders that match those selectors.
func (c *FakeS2iBuilders) List(opts v1.ListOptions) (result *v1alpha1.S2iBuilderList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(s2ibuildersResource, s2ibuildersKind, c.ns, opts), &v1alpha1.S2iBuilderList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.S2iBuilderList{ListMeta: obj.(*v1alpha1.S2iBuilderList).ListMeta}
for _, item := range obj.(*v1alpha1.S2iBuilderList).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 s2iBuilders.
func (c *FakeS2iBuilders) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(s2ibuildersResource, c.ns, opts))
}
// Create takes the representation of a s2iBuilder and creates it. Returns the server's representation of the s2iBuilder, and an error, if there is any.
func (c *FakeS2iBuilders) Create(s2iBuilder *v1alpha1.S2iBuilder) (result *v1alpha1.S2iBuilder, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(s2ibuildersResource, c.ns, s2iBuilder), &v1alpha1.S2iBuilder{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.S2iBuilder), err
}
// Update takes the representation of a s2iBuilder and updates it. Returns the server's representation of the s2iBuilder, and an error, if there is any.
func (c *FakeS2iBuilders) Update(s2iBuilder *v1alpha1.S2iBuilder) (result *v1alpha1.S2iBuilder, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(s2ibuildersResource, c.ns, s2iBuilder), &v1alpha1.S2iBuilder{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.S2iBuilder), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeS2iBuilders) UpdateStatus(s2iBuilder *v1alpha1.S2iBuilder) (*v1alpha1.S2iBuilder, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(s2ibuildersResource, "status", c.ns, s2iBuilder), &v1alpha1.S2iBuilder{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.S2iBuilder), err
}
// Delete takes name of the s2iBuilder and deletes it. Returns an error if one occurs.
func (c *FakeS2iBuilders) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(s2ibuildersResource, c.ns, name), &v1alpha1.S2iBuilder{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeS2iBuilders) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(s2ibuildersResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1alpha1.S2iBuilderList{})
return err
}
// Patch applies the patch and returns the patched s2iBuilder.
func (c *FakeS2iBuilders) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.S2iBuilder, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(s2ibuildersResource, c.ns, name, pt, data, subresources...), &v1alpha1.S2iBuilder{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.S2iBuilder), err
}

View File

@@ -0,0 +1,131 @@
/*
Copyright 2019 The KubeSphere 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
v1alpha1 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha1"
)
// FakeS2iBuilderTemplates implements S2iBuilderTemplateInterface
type FakeS2iBuilderTemplates struct {
Fake *FakeDevopsV1alpha1
}
var s2ibuildertemplatesResource = schema.GroupVersionResource{Group: "devops.kubesphere.io", Version: "v1alpha1", Resource: "s2ibuildertemplates"}
var s2ibuildertemplatesKind = schema.GroupVersionKind{Group: "devops.kubesphere.io", Version: "v1alpha1", Kind: "S2iBuilderTemplate"}
// Get takes name of the s2iBuilderTemplate, and returns the corresponding s2iBuilderTemplate object, and an error if there is any.
func (c *FakeS2iBuilderTemplates) Get(name string, options v1.GetOptions) (result *v1alpha1.S2iBuilderTemplate, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(s2ibuildertemplatesResource, name), &v1alpha1.S2iBuilderTemplate{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.S2iBuilderTemplate), err
}
// List takes label and field selectors, and returns the list of S2iBuilderTemplates that match those selectors.
func (c *FakeS2iBuilderTemplates) List(opts v1.ListOptions) (result *v1alpha1.S2iBuilderTemplateList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(s2ibuildertemplatesResource, s2ibuildertemplatesKind, opts), &v1alpha1.S2iBuilderTemplateList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.S2iBuilderTemplateList{ListMeta: obj.(*v1alpha1.S2iBuilderTemplateList).ListMeta}
for _, item := range obj.(*v1alpha1.S2iBuilderTemplateList).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 s2iBuilderTemplates.
func (c *FakeS2iBuilderTemplates) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchAction(s2ibuildertemplatesResource, opts))
}
// Create takes the representation of a s2iBuilderTemplate and creates it. Returns the server's representation of the s2iBuilderTemplate, and an error, if there is any.
func (c *FakeS2iBuilderTemplates) Create(s2iBuilderTemplate *v1alpha1.S2iBuilderTemplate) (result *v1alpha1.S2iBuilderTemplate, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(s2ibuildertemplatesResource, s2iBuilderTemplate), &v1alpha1.S2iBuilderTemplate{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.S2iBuilderTemplate), err
}
// Update takes the representation of a s2iBuilderTemplate and updates it. Returns the server's representation of the s2iBuilderTemplate, and an error, if there is any.
func (c *FakeS2iBuilderTemplates) Update(s2iBuilderTemplate *v1alpha1.S2iBuilderTemplate) (result *v1alpha1.S2iBuilderTemplate, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(s2ibuildertemplatesResource, s2iBuilderTemplate), &v1alpha1.S2iBuilderTemplate{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.S2iBuilderTemplate), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeS2iBuilderTemplates) UpdateStatus(s2iBuilderTemplate *v1alpha1.S2iBuilderTemplate) (*v1alpha1.S2iBuilderTemplate, error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateSubresourceAction(s2ibuildertemplatesResource, "status", s2iBuilderTemplate), &v1alpha1.S2iBuilderTemplate{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.S2iBuilderTemplate), err
}
// Delete takes name of the s2iBuilderTemplate and deletes it. Returns an error if one occurs.
func (c *FakeS2iBuilderTemplates) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(s2ibuildertemplatesResource, name), &v1alpha1.S2iBuilderTemplate{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeS2iBuilderTemplates) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(s2ibuildertemplatesResource, listOptions)
_, err := c.Fake.Invokes(action, &v1alpha1.S2iBuilderTemplateList{})
return err
}
// Patch applies the patch and returns the patched s2iBuilderTemplate.
func (c *FakeS2iBuilderTemplates) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.S2iBuilderTemplate, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(s2ibuildertemplatesResource, name, pt, data, subresources...), &v1alpha1.S2iBuilderTemplate{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.S2iBuilderTemplate), err
}

View File

@@ -0,0 +1,140 @@
/*
Copyright 2019 The KubeSphere 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
v1alpha1 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha1"
)
// FakeS2iRuns implements S2iRunInterface
type FakeS2iRuns struct {
Fake *FakeDevopsV1alpha1
ns string
}
var s2irunsResource = schema.GroupVersionResource{Group: "devops.kubesphere.io", Version: "v1alpha1", Resource: "s2iruns"}
var s2irunsKind = schema.GroupVersionKind{Group: "devops.kubesphere.io", Version: "v1alpha1", Kind: "S2iRun"}
// Get takes name of the s2iRun, and returns the corresponding s2iRun object, and an error if there is any.
func (c *FakeS2iRuns) Get(name string, options v1.GetOptions) (result *v1alpha1.S2iRun, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(s2irunsResource, c.ns, name), &v1alpha1.S2iRun{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.S2iRun), err
}
// List takes label and field selectors, and returns the list of S2iRuns that match those selectors.
func (c *FakeS2iRuns) List(opts v1.ListOptions) (result *v1alpha1.S2iRunList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(s2irunsResource, s2irunsKind, c.ns, opts), &v1alpha1.S2iRunList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.S2iRunList{ListMeta: obj.(*v1alpha1.S2iRunList).ListMeta}
for _, item := range obj.(*v1alpha1.S2iRunList).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 s2iRuns.
func (c *FakeS2iRuns) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(s2irunsResource, c.ns, opts))
}
// Create takes the representation of a s2iRun and creates it. Returns the server's representation of the s2iRun, and an error, if there is any.
func (c *FakeS2iRuns) Create(s2iRun *v1alpha1.S2iRun) (result *v1alpha1.S2iRun, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(s2irunsResource, c.ns, s2iRun), &v1alpha1.S2iRun{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.S2iRun), err
}
// Update takes the representation of a s2iRun and updates it. Returns the server's representation of the s2iRun, and an error, if there is any.
func (c *FakeS2iRuns) Update(s2iRun *v1alpha1.S2iRun) (result *v1alpha1.S2iRun, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(s2irunsResource, c.ns, s2iRun), &v1alpha1.S2iRun{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.S2iRun), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeS2iRuns) UpdateStatus(s2iRun *v1alpha1.S2iRun) (*v1alpha1.S2iRun, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(s2irunsResource, "status", c.ns, s2iRun), &v1alpha1.S2iRun{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.S2iRun), err
}
// Delete takes name of the s2iRun and deletes it. Returns an error if one occurs.
func (c *FakeS2iRuns) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(s2irunsResource, c.ns, name), &v1alpha1.S2iRun{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeS2iRuns) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(s2irunsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1alpha1.S2iRunList{})
return err
}
// Patch applies the patch and returns the patched s2iRun.
func (c *FakeS2iRuns) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.S2iRun, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(s2irunsResource, c.ns, name, pt, data, subresources...), &v1alpha1.S2iRun{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.S2iRun), err
}

View File

@@ -19,3 +19,9 @@ limitations under the License.
package v1alpha1
type S2iBinaryExpansion interface{}
type S2iBuilderExpansion interface{}
type S2iBuilderTemplateExpansion interface{}
type S2iRunExpansion interface{}

View File

@@ -0,0 +1,191 @@
/*
Copyright 2019 The KubeSphere 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
v1alpha1 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha1"
scheme "kubesphere.io/kubesphere/pkg/client/clientset/versioned/scheme"
)
// S2iBuildersGetter has a method to return a S2iBuilderInterface.
// A group's client should implement this interface.
type S2iBuildersGetter interface {
S2iBuilders(namespace string) S2iBuilderInterface
}
// S2iBuilderInterface has methods to work with S2iBuilder resources.
type S2iBuilderInterface interface {
Create(*v1alpha1.S2iBuilder) (*v1alpha1.S2iBuilder, error)
Update(*v1alpha1.S2iBuilder) (*v1alpha1.S2iBuilder, error)
UpdateStatus(*v1alpha1.S2iBuilder) (*v1alpha1.S2iBuilder, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*v1alpha1.S2iBuilder, error)
List(opts v1.ListOptions) (*v1alpha1.S2iBuilderList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.S2iBuilder, err error)
S2iBuilderExpansion
}
// s2iBuilders implements S2iBuilderInterface
type s2iBuilders struct {
client rest.Interface
ns string
}
// newS2iBuilders returns a S2iBuilders
func newS2iBuilders(c *DevopsV1alpha1Client, namespace string) *s2iBuilders {
return &s2iBuilders{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the s2iBuilder, and returns the corresponding s2iBuilder object, and an error if there is any.
func (c *s2iBuilders) Get(name string, options v1.GetOptions) (result *v1alpha1.S2iBuilder, err error) {
result = &v1alpha1.S2iBuilder{}
err = c.client.Get().
Namespace(c.ns).
Resource("s2ibuilders").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of S2iBuilders that match those selectors.
func (c *s2iBuilders) List(opts v1.ListOptions) (result *v1alpha1.S2iBuilderList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.S2iBuilderList{}
err = c.client.Get().
Namespace(c.ns).
Resource("s2ibuilders").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested s2iBuilders.
func (c *s2iBuilders) Watch(opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("s2ibuilders").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
}
// Create takes the representation of a s2iBuilder and creates it. Returns the server's representation of the s2iBuilder, and an error, if there is any.
func (c *s2iBuilders) Create(s2iBuilder *v1alpha1.S2iBuilder) (result *v1alpha1.S2iBuilder, err error) {
result = &v1alpha1.S2iBuilder{}
err = c.client.Post().
Namespace(c.ns).
Resource("s2ibuilders").
Body(s2iBuilder).
Do().
Into(result)
return
}
// Update takes the representation of a s2iBuilder and updates it. Returns the server's representation of the s2iBuilder, and an error, if there is any.
func (c *s2iBuilders) Update(s2iBuilder *v1alpha1.S2iBuilder) (result *v1alpha1.S2iBuilder, err error) {
result = &v1alpha1.S2iBuilder{}
err = c.client.Put().
Namespace(c.ns).
Resource("s2ibuilders").
Name(s2iBuilder.Name).
Body(s2iBuilder).
Do().
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *s2iBuilders) UpdateStatus(s2iBuilder *v1alpha1.S2iBuilder) (result *v1alpha1.S2iBuilder, err error) {
result = &v1alpha1.S2iBuilder{}
err = c.client.Put().
Namespace(c.ns).
Resource("s2ibuilders").
Name(s2iBuilder.Name).
SubResource("status").
Body(s2iBuilder).
Do().
Into(result)
return
}
// Delete takes name of the s2iBuilder and deletes it. Returns an error if one occurs.
func (c *s2iBuilders) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("s2ibuilders").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *s2iBuilders) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("s2ibuilders").
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Error()
}
// Patch applies the patch and returns the patched s2iBuilder.
func (c *s2iBuilders) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.S2iBuilder, err error) {
result = &v1alpha1.S2iBuilder{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("s2ibuilders").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}

View File

@@ -0,0 +1,180 @@
/*
Copyright 2019 The KubeSphere 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
v1alpha1 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha1"
scheme "kubesphere.io/kubesphere/pkg/client/clientset/versioned/scheme"
)
// S2iBuilderTemplatesGetter has a method to return a S2iBuilderTemplateInterface.
// A group's client should implement this interface.
type S2iBuilderTemplatesGetter interface {
S2iBuilderTemplates() S2iBuilderTemplateInterface
}
// S2iBuilderTemplateInterface has methods to work with S2iBuilderTemplate resources.
type S2iBuilderTemplateInterface interface {
Create(*v1alpha1.S2iBuilderTemplate) (*v1alpha1.S2iBuilderTemplate, error)
Update(*v1alpha1.S2iBuilderTemplate) (*v1alpha1.S2iBuilderTemplate, error)
UpdateStatus(*v1alpha1.S2iBuilderTemplate) (*v1alpha1.S2iBuilderTemplate, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*v1alpha1.S2iBuilderTemplate, error)
List(opts v1.ListOptions) (*v1alpha1.S2iBuilderTemplateList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.S2iBuilderTemplate, err error)
S2iBuilderTemplateExpansion
}
// s2iBuilderTemplates implements S2iBuilderTemplateInterface
type s2iBuilderTemplates struct {
client rest.Interface
}
// newS2iBuilderTemplates returns a S2iBuilderTemplates
func newS2iBuilderTemplates(c *DevopsV1alpha1Client) *s2iBuilderTemplates {
return &s2iBuilderTemplates{
client: c.RESTClient(),
}
}
// Get takes name of the s2iBuilderTemplate, and returns the corresponding s2iBuilderTemplate object, and an error if there is any.
func (c *s2iBuilderTemplates) Get(name string, options v1.GetOptions) (result *v1alpha1.S2iBuilderTemplate, err error) {
result = &v1alpha1.S2iBuilderTemplate{}
err = c.client.Get().
Resource("s2ibuildertemplates").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of S2iBuilderTemplates that match those selectors.
func (c *s2iBuilderTemplates) List(opts v1.ListOptions) (result *v1alpha1.S2iBuilderTemplateList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.S2iBuilderTemplateList{}
err = c.client.Get().
Resource("s2ibuildertemplates").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested s2iBuilderTemplates.
func (c *s2iBuilderTemplates) Watch(opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Resource("s2ibuildertemplates").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
}
// Create takes the representation of a s2iBuilderTemplate and creates it. Returns the server's representation of the s2iBuilderTemplate, and an error, if there is any.
func (c *s2iBuilderTemplates) Create(s2iBuilderTemplate *v1alpha1.S2iBuilderTemplate) (result *v1alpha1.S2iBuilderTemplate, err error) {
result = &v1alpha1.S2iBuilderTemplate{}
err = c.client.Post().
Resource("s2ibuildertemplates").
Body(s2iBuilderTemplate).
Do().
Into(result)
return
}
// Update takes the representation of a s2iBuilderTemplate and updates it. Returns the server's representation of the s2iBuilderTemplate, and an error, if there is any.
func (c *s2iBuilderTemplates) Update(s2iBuilderTemplate *v1alpha1.S2iBuilderTemplate) (result *v1alpha1.S2iBuilderTemplate, err error) {
result = &v1alpha1.S2iBuilderTemplate{}
err = c.client.Put().
Resource("s2ibuildertemplates").
Name(s2iBuilderTemplate.Name).
Body(s2iBuilderTemplate).
Do().
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *s2iBuilderTemplates) UpdateStatus(s2iBuilderTemplate *v1alpha1.S2iBuilderTemplate) (result *v1alpha1.S2iBuilderTemplate, err error) {
result = &v1alpha1.S2iBuilderTemplate{}
err = c.client.Put().
Resource("s2ibuildertemplates").
Name(s2iBuilderTemplate.Name).
SubResource("status").
Body(s2iBuilderTemplate).
Do().
Into(result)
return
}
// Delete takes name of the s2iBuilderTemplate and deletes it. Returns an error if one occurs.
func (c *s2iBuilderTemplates) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Resource("s2ibuildertemplates").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *s2iBuilderTemplates) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Resource("s2ibuildertemplates").
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Error()
}
// Patch applies the patch and returns the patched s2iBuilderTemplate.
func (c *s2iBuilderTemplates) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.S2iBuilderTemplate, err error) {
result = &v1alpha1.S2iBuilderTemplate{}
err = c.client.Patch(pt).
Resource("s2ibuildertemplates").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}

View File

@@ -0,0 +1,191 @@
/*
Copyright 2019 The KubeSphere 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
v1alpha1 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha1"
scheme "kubesphere.io/kubesphere/pkg/client/clientset/versioned/scheme"
)
// S2iRunsGetter has a method to return a S2iRunInterface.
// A group's client should implement this interface.
type S2iRunsGetter interface {
S2iRuns(namespace string) S2iRunInterface
}
// S2iRunInterface has methods to work with S2iRun resources.
type S2iRunInterface interface {
Create(*v1alpha1.S2iRun) (*v1alpha1.S2iRun, error)
Update(*v1alpha1.S2iRun) (*v1alpha1.S2iRun, error)
UpdateStatus(*v1alpha1.S2iRun) (*v1alpha1.S2iRun, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*v1alpha1.S2iRun, error)
List(opts v1.ListOptions) (*v1alpha1.S2iRunList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.S2iRun, err error)
S2iRunExpansion
}
// s2iRuns implements S2iRunInterface
type s2iRuns struct {
client rest.Interface
ns string
}
// newS2iRuns returns a S2iRuns
func newS2iRuns(c *DevopsV1alpha1Client, namespace string) *s2iRuns {
return &s2iRuns{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the s2iRun, and returns the corresponding s2iRun object, and an error if there is any.
func (c *s2iRuns) Get(name string, options v1.GetOptions) (result *v1alpha1.S2iRun, err error) {
result = &v1alpha1.S2iRun{}
err = c.client.Get().
Namespace(c.ns).
Resource("s2iruns").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of S2iRuns that match those selectors.
func (c *s2iRuns) List(opts v1.ListOptions) (result *v1alpha1.S2iRunList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.S2iRunList{}
err = c.client.Get().
Namespace(c.ns).
Resource("s2iruns").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested s2iRuns.
func (c *s2iRuns) Watch(opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("s2iruns").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
}
// Create takes the representation of a s2iRun and creates it. Returns the server's representation of the s2iRun, and an error, if there is any.
func (c *s2iRuns) Create(s2iRun *v1alpha1.S2iRun) (result *v1alpha1.S2iRun, err error) {
result = &v1alpha1.S2iRun{}
err = c.client.Post().
Namespace(c.ns).
Resource("s2iruns").
Body(s2iRun).
Do().
Into(result)
return
}
// Update takes the representation of a s2iRun and updates it. Returns the server's representation of the s2iRun, and an error, if there is any.
func (c *s2iRuns) Update(s2iRun *v1alpha1.S2iRun) (result *v1alpha1.S2iRun, err error) {
result = &v1alpha1.S2iRun{}
err = c.client.Put().
Namespace(c.ns).
Resource("s2iruns").
Name(s2iRun.Name).
Body(s2iRun).
Do().
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *s2iRuns) UpdateStatus(s2iRun *v1alpha1.S2iRun) (result *v1alpha1.S2iRun, err error) {
result = &v1alpha1.S2iRun{}
err = c.client.Put().
Namespace(c.ns).
Resource("s2iruns").
Name(s2iRun.Name).
SubResource("status").
Body(s2iRun).
Do().
Into(result)
return
}
// Delete takes name of the s2iRun and deletes it. Returns an error if one occurs.
func (c *s2iRuns) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("s2iruns").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *s2iRuns) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("s2iruns").
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Error()
}
// Patch applies the patch and returns the patched s2iRun.
func (c *s2iRuns) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.S2iRun, err error) {
result = &v1alpha1.S2iRun{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("s2iruns").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}

View File

@@ -26,6 +26,12 @@ import (
type Interface interface {
// S2iBinaries returns a S2iBinaryInformer.
S2iBinaries() S2iBinaryInformer
// S2iBuilders returns a S2iBuilderInformer.
S2iBuilders() S2iBuilderInformer
// S2iBuilderTemplates returns a S2iBuilderTemplateInformer.
S2iBuilderTemplates() S2iBuilderTemplateInformer
// S2iRuns returns a S2iRunInformer.
S2iRuns() S2iRunInformer
}
type version struct {
@@ -43,3 +49,18 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
func (v *version) S2iBinaries() S2iBinaryInformer {
return &s2iBinaryInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
// S2iBuilders returns a S2iBuilderInformer.
func (v *version) S2iBuilders() S2iBuilderInformer {
return &s2iBuilderInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
// S2iBuilderTemplates returns a S2iBuilderTemplateInformer.
func (v *version) S2iBuilderTemplates() S2iBuilderTemplateInformer {
return &s2iBuilderTemplateInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
}
// S2iRuns returns a S2iRunInformer.
func (v *version) S2iRuns() S2iRunInformer {
return &s2iRunInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}

View File

@@ -0,0 +1,89 @@
/*
Copyright 2019 The KubeSphere 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.
*/
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
import (
time "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
devopsv1alpha1 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha1"
versioned "kubesphere.io/kubesphere/pkg/client/clientset/versioned"
internalinterfaces "kubesphere.io/kubesphere/pkg/client/informers/externalversions/internalinterfaces"
v1alpha1 "kubesphere.io/kubesphere/pkg/client/listers/devops/v1alpha1"
)
// S2iBuilderInformer provides access to a shared informer and lister for
// S2iBuilders.
type S2iBuilderInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.S2iBuilderLister
}
type s2iBuilderInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
namespace string
}
// NewS2iBuilderInformer constructs a new informer for S2iBuilder type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewS2iBuilderInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredS2iBuilderInformer(client, namespace, resyncPeriod, indexers, nil)
}
// NewFilteredS2iBuilderInformer constructs a new informer for S2iBuilder type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredS2iBuilderInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.DevopsV1alpha1().S2iBuilders(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.DevopsV1alpha1().S2iBuilders(namespace).Watch(options)
},
},
&devopsv1alpha1.S2iBuilder{},
resyncPeriod,
indexers,
)
}
func (f *s2iBuilderInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredS2iBuilderInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *s2iBuilderInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&devopsv1alpha1.S2iBuilder{}, f.defaultInformer)
}
func (f *s2iBuilderInformer) Lister() v1alpha1.S2iBuilderLister {
return v1alpha1.NewS2iBuilderLister(f.Informer().GetIndexer())
}

View File

@@ -0,0 +1,88 @@
/*
Copyright 2019 The KubeSphere 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.
*/
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
import (
time "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
devopsv1alpha1 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha1"
versioned "kubesphere.io/kubesphere/pkg/client/clientset/versioned"
internalinterfaces "kubesphere.io/kubesphere/pkg/client/informers/externalversions/internalinterfaces"
v1alpha1 "kubesphere.io/kubesphere/pkg/client/listers/devops/v1alpha1"
)
// S2iBuilderTemplateInformer provides access to a shared informer and lister for
// S2iBuilderTemplates.
type S2iBuilderTemplateInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.S2iBuilderTemplateLister
}
type s2iBuilderTemplateInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
}
// NewS2iBuilderTemplateInformer constructs a new informer for S2iBuilderTemplate type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewS2iBuilderTemplateInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredS2iBuilderTemplateInformer(client, resyncPeriod, indexers, nil)
}
// NewFilteredS2iBuilderTemplateInformer constructs a new informer for S2iBuilderTemplate type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredS2iBuilderTemplateInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.DevopsV1alpha1().S2iBuilderTemplates().List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.DevopsV1alpha1().S2iBuilderTemplates().Watch(options)
},
},
&devopsv1alpha1.S2iBuilderTemplate{},
resyncPeriod,
indexers,
)
}
func (f *s2iBuilderTemplateInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredS2iBuilderTemplateInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *s2iBuilderTemplateInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&devopsv1alpha1.S2iBuilderTemplate{}, f.defaultInformer)
}
func (f *s2iBuilderTemplateInformer) Lister() v1alpha1.S2iBuilderTemplateLister {
return v1alpha1.NewS2iBuilderTemplateLister(f.Informer().GetIndexer())
}

View File

@@ -0,0 +1,89 @@
/*
Copyright 2019 The KubeSphere 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.
*/
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
import (
time "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
devopsv1alpha1 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha1"
versioned "kubesphere.io/kubesphere/pkg/client/clientset/versioned"
internalinterfaces "kubesphere.io/kubesphere/pkg/client/informers/externalversions/internalinterfaces"
v1alpha1 "kubesphere.io/kubesphere/pkg/client/listers/devops/v1alpha1"
)
// S2iRunInformer provides access to a shared informer and lister for
// S2iRuns.
type S2iRunInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.S2iRunLister
}
type s2iRunInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
namespace string
}
// NewS2iRunInformer constructs a new informer for S2iRun type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewS2iRunInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredS2iRunInformer(client, namespace, resyncPeriod, indexers, nil)
}
// NewFilteredS2iRunInformer constructs a new informer for S2iRun type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredS2iRunInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.DevopsV1alpha1().S2iRuns(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.DevopsV1alpha1().S2iRuns(namespace).Watch(options)
},
},
&devopsv1alpha1.S2iRun{},
resyncPeriod,
indexers,
)
}
func (f *s2iRunInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredS2iRunInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *s2iRunInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&devopsv1alpha1.S2iRun{}, f.defaultInformer)
}
func (f *s2iRunInformer) Lister() v1alpha1.S2iRunLister {
return v1alpha1.NewS2iRunLister(f.Informer().GetIndexer())
}

View File

@@ -58,6 +58,12 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
// Group=devops.kubesphere.io, Version=v1alpha1
case v1alpha1.SchemeGroupVersion.WithResource("s2ibinaries"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Devops().V1alpha1().S2iBinaries().Informer()}, nil
case v1alpha1.SchemeGroupVersion.WithResource("s2ibuilders"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Devops().V1alpha1().S2iBuilders().Informer()}, nil
case v1alpha1.SchemeGroupVersion.WithResource("s2ibuildertemplates"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Devops().V1alpha1().S2iBuilderTemplates().Informer()}, nil
case v1alpha1.SchemeGroupVersion.WithResource("s2iruns"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Devops().V1alpha1().S2iRuns().Informer()}, nil
// Group=network.kubesphere.io, Version=v1alpha1
case networkv1alpha1.SchemeGroupVersion.WithResource("namespacenetworkpolicies"):

View File

@@ -25,3 +25,23 @@ type S2iBinaryListerExpansion interface{}
// S2iBinaryNamespaceListerExpansion allows custom methods to be added to
// S2iBinaryNamespaceLister.
type S2iBinaryNamespaceListerExpansion interface{}
// S2iBuilderListerExpansion allows custom methods to be added to
// S2iBuilderLister.
type S2iBuilderListerExpansion interface{}
// S2iBuilderNamespaceListerExpansion allows custom methods to be added to
// S2iBuilderNamespaceLister.
type S2iBuilderNamespaceListerExpansion interface{}
// S2iBuilderTemplateListerExpansion allows custom methods to be added to
// S2iBuilderTemplateLister.
type S2iBuilderTemplateListerExpansion interface{}
// S2iRunListerExpansion allows custom methods to be added to
// S2iRunLister.
type S2iRunListerExpansion interface{}
// S2iRunNamespaceListerExpansion allows custom methods to be added to
// S2iRunNamespaceLister.
type S2iRunNamespaceListerExpansion interface{}

View File

@@ -0,0 +1,94 @@
/*
Copyright 2019 The KubeSphere 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.
*/
// Code generated by lister-gen. DO NOT EDIT.
package v1alpha1
import (
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
v1alpha1 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha1"
)
// S2iBuilderLister helps list S2iBuilders.
type S2iBuilderLister interface {
// List lists all S2iBuilders in the indexer.
List(selector labels.Selector) (ret []*v1alpha1.S2iBuilder, err error)
// S2iBuilders returns an object that can list and get S2iBuilders.
S2iBuilders(namespace string) S2iBuilderNamespaceLister
S2iBuilderListerExpansion
}
// s2iBuilderLister implements the S2iBuilderLister interface.
type s2iBuilderLister struct {
indexer cache.Indexer
}
// NewS2iBuilderLister returns a new S2iBuilderLister.
func NewS2iBuilderLister(indexer cache.Indexer) S2iBuilderLister {
return &s2iBuilderLister{indexer: indexer}
}
// List lists all S2iBuilders in the indexer.
func (s *s2iBuilderLister) List(selector labels.Selector) (ret []*v1alpha1.S2iBuilder, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.S2iBuilder))
})
return ret, err
}
// S2iBuilders returns an object that can list and get S2iBuilders.
func (s *s2iBuilderLister) S2iBuilders(namespace string) S2iBuilderNamespaceLister {
return s2iBuilderNamespaceLister{indexer: s.indexer, namespace: namespace}
}
// S2iBuilderNamespaceLister helps list and get S2iBuilders.
type S2iBuilderNamespaceLister interface {
// List lists all S2iBuilders in the indexer for a given namespace.
List(selector labels.Selector) (ret []*v1alpha1.S2iBuilder, err error)
// Get retrieves the S2iBuilder from the indexer for a given namespace and name.
Get(name string) (*v1alpha1.S2iBuilder, error)
S2iBuilderNamespaceListerExpansion
}
// s2iBuilderNamespaceLister implements the S2iBuilderNamespaceLister
// interface.
type s2iBuilderNamespaceLister struct {
indexer cache.Indexer
namespace string
}
// List lists all S2iBuilders in the indexer for a given namespace.
func (s s2iBuilderNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.S2iBuilder, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.S2iBuilder))
})
return ret, err
}
// Get retrieves the S2iBuilder from the indexer for a given namespace and name.
func (s s2iBuilderNamespaceLister) Get(name string) (*v1alpha1.S2iBuilder, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("s2ibuilder"), name)
}
return obj.(*v1alpha1.S2iBuilder), nil
}

View File

@@ -0,0 +1,65 @@
/*
Copyright 2019 The KubeSphere 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.
*/
// Code generated by lister-gen. DO NOT EDIT.
package v1alpha1
import (
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
v1alpha1 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha1"
)
// S2iBuilderTemplateLister helps list S2iBuilderTemplates.
type S2iBuilderTemplateLister interface {
// List lists all S2iBuilderTemplates in the indexer.
List(selector labels.Selector) (ret []*v1alpha1.S2iBuilderTemplate, err error)
// Get retrieves the S2iBuilderTemplate from the index for a given name.
Get(name string) (*v1alpha1.S2iBuilderTemplate, error)
S2iBuilderTemplateListerExpansion
}
// s2iBuilderTemplateLister implements the S2iBuilderTemplateLister interface.
type s2iBuilderTemplateLister struct {
indexer cache.Indexer
}
// NewS2iBuilderTemplateLister returns a new S2iBuilderTemplateLister.
func NewS2iBuilderTemplateLister(indexer cache.Indexer) S2iBuilderTemplateLister {
return &s2iBuilderTemplateLister{indexer: indexer}
}
// List lists all S2iBuilderTemplates in the indexer.
func (s *s2iBuilderTemplateLister) List(selector labels.Selector) (ret []*v1alpha1.S2iBuilderTemplate, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.S2iBuilderTemplate))
})
return ret, err
}
// Get retrieves the S2iBuilderTemplate from the index for a given name.
func (s *s2iBuilderTemplateLister) Get(name string) (*v1alpha1.S2iBuilderTemplate, error) {
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("s2ibuildertemplate"), name)
}
return obj.(*v1alpha1.S2iBuilderTemplate), nil
}

View File

@@ -0,0 +1,94 @@
/*
Copyright 2019 The KubeSphere 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.
*/
// Code generated by lister-gen. DO NOT EDIT.
package v1alpha1
import (
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
v1alpha1 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha1"
)
// S2iRunLister helps list S2iRuns.
type S2iRunLister interface {
// List lists all S2iRuns in the indexer.
List(selector labels.Selector) (ret []*v1alpha1.S2iRun, err error)
// S2iRuns returns an object that can list and get S2iRuns.
S2iRuns(namespace string) S2iRunNamespaceLister
S2iRunListerExpansion
}
// s2iRunLister implements the S2iRunLister interface.
type s2iRunLister struct {
indexer cache.Indexer
}
// NewS2iRunLister returns a new S2iRunLister.
func NewS2iRunLister(indexer cache.Indexer) S2iRunLister {
return &s2iRunLister{indexer: indexer}
}
// List lists all S2iRuns in the indexer.
func (s *s2iRunLister) List(selector labels.Selector) (ret []*v1alpha1.S2iRun, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.S2iRun))
})
return ret, err
}
// S2iRuns returns an object that can list and get S2iRuns.
func (s *s2iRunLister) S2iRuns(namespace string) S2iRunNamespaceLister {
return s2iRunNamespaceLister{indexer: s.indexer, namespace: namespace}
}
// S2iRunNamespaceLister helps list and get S2iRuns.
type S2iRunNamespaceLister interface {
// List lists all S2iRuns in the indexer for a given namespace.
List(selector labels.Selector) (ret []*v1alpha1.S2iRun, err error)
// Get retrieves the S2iRun from the indexer for a given namespace and name.
Get(name string) (*v1alpha1.S2iRun, error)
S2iRunNamespaceListerExpansion
}
// s2iRunNamespaceLister implements the S2iRunNamespaceLister
// interface.
type s2iRunNamespaceLister struct {
indexer cache.Indexer
namespace string
}
// List lists all S2iRuns in the indexer for a given namespace.
func (s s2iRunNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.S2iRun, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.S2iRun))
})
return ret, err
}
// Get retrieves the S2iRun from the indexer for a given namespace and name.
func (s s2iRunNamespaceLister) Get(name string) (*v1alpha1.S2iRun, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("s2irun"), name)
}
return obj.(*v1alpha1.S2iRun), nil
}