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
}