提交 fe6c5de0 编写于 作者: H hongming

update dependencies

Signed-off-by: Nhongming <talonwan@yunify.com>
上级 4a11a505

要显示的变更太多。

To preserve performance only 1000 of 1000+ files are displayed.
此差异已折叠。
{
"swagger": "2.0",
"info": {
"title": "KubeSphere Advanced",
"title": "KubeSphere",
"contact": {
"name": "KubeSphere",
"url": "https://kubesphere.io/",
......@@ -11,7 +11,7 @@
"name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
},
"version": "v2.0.0"
"version": "v0.0.0"
},
"paths": {
"/apis/": {
......
......@@ -17,6 +17,7 @@ limitations under the License.
package app
import (
"context"
"fmt"
"k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
"k8s.io/apimachinery/pkg/util/wait"
......@@ -31,7 +32,7 @@ func WaitForAPIServer(client clientset.Interface, timeout time.Duration) error {
err := wait.PollImmediate(time.Second, timeout, func() (bool, error) {
healthStatus := 0
result := client.Discovery().RESTClient().Get().AbsPath("/healthz").Do().StatusCode(&healthStatus)
result := client.Discovery().RESTClient().Get().AbsPath("/healthz").Do(context.Background()).StatusCode(&healthStatus)
if result.Error() != nil {
lastErr = fmt.Errorf("failed to get apiserver /healthz status: %v", result.Error())
return false, nil
......
......@@ -106,6 +106,7 @@ func NewControllerManagerCommand() *cobra.Command {
}
func run(s *options.KubeSphereControllerManagerOptions, stopCh <-chan struct{}) error {
kubernetesClient, err := k8s.NewKubernetesClient(s.KubernetesOptions)
if err != nil {
klog.Errorf("Failed to create kubernetes clientset %v", err)
......
......@@ -18,13 +18,8 @@ package app
import (
"fmt"
"github.com/kiali/kiali/business"
kconfig "github.com/kiali/kiali/config"
"github.com/kiali/kiali/kubernetes"
"github.com/kiali/kiali/prometheus"
"github.com/spf13/cobra"
utilerrors "k8s.io/apimachinery/pkg/util/errors"
"k8s.io/client-go/tools/clientcmd"
cliflag "k8s.io/component-base/cli/flag"
"k8s.io/klog"
......@@ -98,9 +93,6 @@ func Run(s *options.ServerRunOptions, stopCh <-chan struct{}) error {
}
func initializeServicemeshConfig(s *options.ServerRunOptions) {
// Initialize kiali config
config := kconfig.NewConfig()
// Config jaeger query endpoint address
if s.ServiceMeshOptions != nil && len(s.ServiceMeshOptions.JaegerQueryHost) != 0 {
tracing.JaegerQueryUrl = s.ServiceMeshOptions.JaegerQueryHost
......@@ -110,31 +102,4 @@ func initializeServicemeshConfig(s *options.ServerRunOptions) {
if s.ServiceMeshOptions != nil && len(s.ServiceMeshOptions.KialiQueryHost) != 0 {
tracing.KialiQueryUrl = s.ServiceMeshOptions.KialiQueryHost
}
// Exclude system namespaces
config.API.Namespaces.Exclude = []string{"istio-system", "kube-.*"}
config.InCluster = true
// Set default prometheus service url
config.ExternalServices.PrometheusServiceURL = s.ServiceMeshOptions.ServicemeshPrometheusHost
config.ExternalServices.PrometheusCustomMetricsURL = config.ExternalServices.PrometheusServiceURL
// Set istio pilot discovery service url
config.ExternalServices.Istio.UrlServiceVersion = s.ServiceMeshOptions.IstioPilotHost
kconfig.Set(config)
// Set kiali config
if len(s.KubernetesOptions.KubeConfig) != 0 {
kubeconfig, err := clientcmd.BuildConfigFromFlags("", s.KubernetesOptions.KubeConfig)
if err != nil {
fmt.Println(err)
}
k8sClient, err := kubernetes.NewClientFromConfig(kubeconfig)
if err != nil {
fmt.Println(err)
}
prometheusClient, _ := prometheus.NewClient()
business.SetWithBackends(k8sClient, prometheusClient)
}
}
此差异已折叠。
此差异已折叠。
......@@ -20,7 +20,7 @@ import (
"istio.io/client-go/pkg/apis/networking/v1alpha3"
"kubesphere.io/kubesphere/pkg/apis/servicemesh/v1alpha2"
appv1beta1 "sigs.k8s.io/application/pkg/apis/app/v1beta1"
appv1beta1 "sigs.k8s.io/application/api/v1beta1"
)
func init() {
......
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package v1beta1
import (
"regexp"
"strings"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// Constants for condition
const (
// Ready => controller considers this resource Ready
Ready = "Ready"
// Qualified => functionally tested
Qualified = "Qualified"
// Settled => observed generation == generation + settled means controller is done acting functionally tested
Settled = "Settled"
// Cleanup => it is set to track finalizer failures
Cleanup = "Cleanup"
// Error => last recorded error
Error = "Error"
ReasonInit = "Init"
)
// Descriptor defines the Metadata and informations about the Application.
type Descriptor struct {
// Type is the type of the application (e.g. WordPress, MySQL, Cassandra).
Type string `json:"type,omitempty"`
// Version is an optional version indicator for the Application.
Version string `json:"version,omitempty"`
// Description is a brief string description of the Application.
Description string `json:"description,omitempty"`
// Icons is an optional list of icons for an application. Icon information includes the source, size,
// and mime type.
Icons []ImageSpec `json:"icons,omitempty"`
// Maintainers is an optional list of maintainers of the application. The maintainers in this list maintain the
// the source code, images, and package for the application.
Maintainers []ContactData `json:"maintainers,omitempty"`
// Owners is an optional list of the owners of the installed application. The owners of the application should be
// contacted in the event of a planned or unplanned disruption affecting the application.
Owners []ContactData `json:"owners,omitempty"`
// Keywords is an optional list of key words associated with the application (e.g. MySQL, RDBMS, database).
Keywords []string `json:"keywords,omitempty"`
// Links are a list of descriptive URLs intended to be used to surface additional documentation, dashboards, etc.
Links []Link `json:"links,omitempty"`
// Notes contain a human readable snippets intended as a quick start for the users of the Application.
// CommonMark markdown syntax may be used for rich text representation.
Notes string `json:"notes,omitempty"`
}
// ApplicationSpec defines the specification for an Application.
type ApplicationSpec struct {
// ComponentGroupKinds is a list of Kinds for Application's components (e.g. Deployments, Pods, Services, CRDs). It
// can be used in conjunction with the Application's Selector to list or watch the Applications components.
ComponentGroupKinds []metav1.GroupKind `json:"componentKinds,omitempty"`
// Descriptor regroups information and metadata about an application.
Descriptor Descriptor `json:"descriptor,omitempty"`
// Selector is a label query over kinds that created by the application. It must match the component objects' labels.
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
Selector *metav1.LabelSelector `json:"selector,omitempty"`
// AddOwnerRef objects - flag to indicate if we need to add OwnerRefs to matching objects
// Matching is done by using Selector to query all ComponentGroupKinds
AddOwnerRef bool `json:"addOwnerRef,omitempty"`
// Info contains human readable key,value pairs for the Application.
// +patchStrategy=merge
// +patchMergeKey=name
Info []InfoItem `json:"info,omitempty" patchStrategy:"merge" patchMergeKey:"name"`
// AssemblyPhase represents the current phase of the application's assembly.
// An empty value is equivalent to "Succeeded".
AssemblyPhase ApplicationAssemblyPhase `json:"assemblyPhase,omitempty"`
}
// ComponentList is a generic status holder for the top level resource
type ComponentList struct {
// Object status array for all matching objects
Objects []ObjectStatus `json:"components,omitempty"`
}
// ObjectStatus is a generic status holder for objects
type ObjectStatus struct {
// Link to object
Link string `json:"link,omitempty"`
// Name of object
Name string `json:"name,omitempty"`
// Kind of object
Kind string `json:"kind,omitempty"`
// Object group
Group string `json:"group,omitempty"`
// Status. Values: InProgress, Ready, Unknown
Status string `json:"status,omitempty"`
}
// ConditionType encodes information on the condition
type ConditionType string
// Condition describes the state of an object at a certain point.
type Condition struct {
// Type of condition.
Type ConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=StatefulSetConditionType"`
// Status of the condition, one of True, False, Unknown.
Status corev1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/api/core/v1.ConditionStatus"`
// The reason for the condition's last transition.
// +optional
Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"`
// A human readable message indicating details about the transition.
// +optional
Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"`
// Last time the condition was probed
// +optional
LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty" protobuf:"bytes,3,opt,name=lastProbeTime"`
// Last time the condition transitioned from one status to another.
// +optional
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"`
}
// ApplicationStatus defines controller's the observed state of Application
type ApplicationStatus struct {
// ObservedGeneration is the most recent generation observed. It corresponds to the
// Object's generation, which is updated on mutation by the API Server.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,1,opt,name=observedGeneration"`
// Conditions represents the latest state of the object
// +optional
// +patchMergeKey=type
// +patchStrategy=merge
Conditions []Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,10,rep,name=conditions"`
// Resources embeds a list of object statuses
// +optional
ComponentList `json:",inline,omitempty"`
// ComponentsReady: status of the components in the format ready/total
// +optional
ComponentsReady string `json:"componentsReady,omitempty"`
}
// ImageSpec contains information about an image used as an icon.
type ImageSpec struct {
// The source for image represented as either an absolute URL to the image or a Data URL containing
// the image. Data URLs are defined in RFC 2397.
Source string `json:"src"`
// (optional) The size of the image in pixels (e.g., 25x25).
Size string `json:"size,omitempty"`
// (optional) The mine type of the image (e.g., "image/png").
Type string `json:"type,omitempty"`
}
// ContactData contains information about an individual or organization.
type ContactData struct {
// Name is the descriptive name.
Name string `json:"name,omitempty"`
// Url could typically be a website address.
URL string `json:"url,omitempty"`
// Email is the email address.
Email string `json:"email,omitempty"`
}
// Link contains information about an URL to surface documentation, dashboards, etc.
type Link struct {
// Description is human readable content explaining the purpose of the link.
Description string `json:"description,omitempty"`
// Url typically points at a website address.
URL string `json:"url,omitempty"`
}
// InfoItem is a human readable key,value pair containing important information about how to access the Application.
type InfoItem struct {
// Name is a human readable title for this piece of information.
Name string `json:"name,omitempty"`
// Type of the value for this InfoItem.
Type InfoItemType `json:"type,omitempty"`
// Value is human readable content.
Value string `json:"value,omitempty"`
// ValueFrom defines a reference to derive the value from another source.
ValueFrom *InfoItemSource `json:"valueFrom,omitempty"`
}
// InfoItemType is a string that describes the value of InfoItem
type InfoItemType string
const (
// ValueInfoItemType const string for value type
ValueInfoItemType InfoItemType = "Value"
// ReferenceInfoItemType const string for ref type
ReferenceInfoItemType InfoItemType = "Reference"
)
// InfoItemSource represents a source for the value of an InfoItem.
type InfoItemSource struct {
// Type of source.
Type InfoItemSourceType `json:"type,omitempty"`
// Selects a key of a Secret.
SecretKeyRef *SecretKeySelector `json:"secretKeyRef,omitempty"`
// Selects a key of a ConfigMap.
ConfigMapKeyRef *ConfigMapKeySelector `json:"configMapKeyRef,omitempty"`
// Select a Service.
ServiceRef *ServiceSelector `json:"serviceRef,omitempty"`
// Select an Ingress.
IngressRef *IngressSelector `json:"ingressRef,omitempty"`
}
// InfoItemSourceType is a string
type InfoItemSourceType string
// Constants for info type
const (
SecretKeyRefInfoItemSourceType InfoItemSourceType = "SecretKeyRef"
ConfigMapKeyRefInfoItemSourceType InfoItemSourceType = "ConfigMapKeyRef"
ServiceRefInfoItemSourceType InfoItemSourceType = "ServiceRef"
IngressRefInfoItemSourceType InfoItemSourceType = "IngressRef"
)
// ConfigMapKeySelector selects a key from a ConfigMap.
type ConfigMapKeySelector struct {
// The ConfigMap to select from.
corev1.ObjectReference `json:",inline"`
// The key to select.
Key string `json:"key,omitempty"`
}
// SecretKeySelector selects a key from a Secret.
type SecretKeySelector struct {
// The Secret to select from.
corev1.ObjectReference `json:",inline"`
// The key to select.
Key string `json:"key,omitempty"`
}
// ServiceSelector selects a Service.
type ServiceSelector struct {
// The Service to select from.
corev1.ObjectReference `json:",inline"`
// The optional port to select.
Port *int32 `json:"port,omitempty"`
// The optional HTTP path.
Path string `json:"path,omitempty"`
// Protocol for the service
Protocol string `json:"protocol,omitempty"`
}
// IngressSelector selects an Ingress.
type IngressSelector struct {
// The Ingress to select from.
corev1.ObjectReference `json:",inline"`
// The optional host to select.
Host string `json:"host,omitempty"`
// The optional HTTP path.
Path string `json:"path,omitempty"`
// Protocol for the ingress
Protocol string `json:"protocol,omitempty"`
}
// ApplicationAssemblyPhase tracks the Application CRD phases: pending, succeeded, failed
type ApplicationAssemblyPhase string
// Constants
const (
// Used to indicate that not all of application's components
// have been deployed yet.
Pending ApplicationAssemblyPhase = "Pending"
// Used to indicate that all of application's components
// have already been deployed.
Succeeded = "Succeeded"
// Used to indicate that deployment of application's components
// failed. Some components might be present, but deployment of
// the remaining ones will not be re-attempted.
Failed = "Failed"
)
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:object:root=true
// +kubebuilder:resource:categories=all,shortName=app
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Type",type=string,description="The type of the application",JSONPath=`.spec.descriptor.type`,priority=0
// +kubebuilder:printcolumn:name="Version",type=string,description="The creation date",JSONPath=`.spec.descriptor.version`,priority=0
// +kubebuilder:printcolumn:name="Owner",type=boolean,description="The application object owns the matched resources",JSONPath=`.spec.addOwnerRef`,priority=0
// +kubebuilder:printcolumn:name="Ready",type=string,description="Numbers of components ready",JSONPath=`.status.componentsReady`,priority=0
// +kubebuilder:printcolumn:name="Age",type=date,description="The creation date",JSONPath=`.metadata.creationTimestamp`,priority=0
// Application is the Schema for the applications API
type Application struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ApplicationSpec `json:"spec,omitempty"`
Status ApplicationStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// ApplicationList contains a list of Application
type ApplicationList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Application `json:"items"`
}
func init() {
SchemeBuilder.Register(&Application{}, &ApplicationList{})
}
// StripVersion the version part of gv
func StripVersion(gv string) string {
if gv == "" {
return gv
}
re := regexp.MustCompile(`^[vV][0-9].*`)
// If it begins with only version, (group is nil), return empty string which maps to core group
if re.MatchString(gv) {
return ""
}
return strings.Split(gv, "/")[0]
}
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package v1beta1
import (
"testing"
"context"
"github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
)
func TestStorageApplication(t *testing.T) {
key := types.NamespacedName{
Name: "foo",
Namespace: "default",
}
created := &Application{
ObjectMeta: metav1.ObjectMeta{
Name: "foo",
Namespace: "default",
}}
g := gomega.NewGomegaWithT(t)
// Test Create
fetched := &Application{}
g.Expect(c.Create(context.TODO(), created)).NotTo(gomega.HaveOccurred())
g.Expect(c.Get(context.TODO(), key, fetched)).NotTo(gomega.HaveOccurred())
g.Expect(fetched).To(gomega.Equal(created))
// Test Updating the Labels
updated := fetched.DeepCopy()
updated.Labels = map[string]string{"hello": "world"}
g.Expect(c.Update(context.TODO(), updated)).NotTo(gomega.HaveOccurred())
g.Expect(c.Get(context.TODO(), key, fetched)).NotTo(gomega.HaveOccurred())
g.Expect(fetched).To(gomega.Equal(updated))
// Test Delete
g.Expect(c.Delete(context.TODO(), fetched)).NotTo(gomega.HaveOccurred())
g.Expect(c.Get(context.TODO(), key, fetched)).To(gomega.HaveOccurred())
// Test stripVersion()
g.Expect(StripVersion("")).To(gomega.Equal(""))
g.Expect(StripVersion("v1beta1")).To(gomega.Equal(""))
g.Expect(StripVersion("apps/v1")).To(gomega.Equal("apps"))
g.Expect(StripVersion("apps/v1alpha2")).To(gomega.Equal("apps"))
}
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
// Package v1beta1 contains API Schema definitions for the app v1beta1 API group
// +kubebuilder:object:generate=true
// +groupName=app.k8s.io
package v1beta1
import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)
var (
// SchemeGroupVersion is group version used to register these objects
SchemeGroupVersion = schema.GroupVersion{Group: "app.k8s.io", Version: "v1beta1"}
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
)
// Modified.
// Register GVR manually
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package v1beta1
import (
"log"
"os"
"path/filepath"
"testing"
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/envtest"
)
var cfg *rest.Config
var c client.Client
func TestMain(m *testing.M) {
t := &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "..", "config", "crds")},
}
err := SchemeBuilder.AddToScheme(scheme.Scheme)
if err != nil {
log.Fatal(err)
}
if cfg, err = t.Start(); err != nil {
log.Fatal(err)
}
if c, err = client.New(cfg, client.Options{Scheme: scheme.Scheme}); err != nil {
log.Fatal(err)
}
code := m.Run()
_ = t.Stop()
os.Exit(code)
}
// +build !ignore_autogenerated
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by controller-gen. DO NOT EDIT.
package v1beta1
import (
"k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Application) DeepCopyInto(out *Application) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Application.
func (in *Application) DeepCopy() *Application {
if in == nil {
return nil
}
out := new(Application)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *Application) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApplicationList) DeepCopyInto(out *ApplicationList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Application, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationList.
func (in *ApplicationList) DeepCopy() *ApplicationList {
if in == nil {
return nil
}
out := new(ApplicationList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ApplicationList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApplicationSpec) DeepCopyInto(out *ApplicationSpec) {
*out = *in
if in.ComponentGroupKinds != nil {
in, out := &in.ComponentGroupKinds, &out.ComponentGroupKinds
*out = make([]v1.GroupKind, len(*in))
copy(*out, *in)
}
in.Descriptor.DeepCopyInto(&out.Descriptor)
if in.Selector != nil {
in, out := &in.Selector, &out.Selector
*out = new(v1.LabelSelector)
(*in).DeepCopyInto(*out)
}
if in.Info != nil {
in, out := &in.Info, &out.Info
*out = make([]InfoItem, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationSpec.
func (in *ApplicationSpec) DeepCopy() *ApplicationSpec {
if in == nil {
return nil
}
out := new(ApplicationSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApplicationStatus) DeepCopyInto(out *ApplicationStatus) {
*out = *in
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
*out = make([]Condition, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
in.ComponentList.DeepCopyInto(&out.ComponentList)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationStatus.
func (in *ApplicationStatus) DeepCopy() *ApplicationStatus {
if in == nil {
return nil
}
out := new(ApplicationStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ComponentList) DeepCopyInto(out *ComponentList) {
*out = *in
if in.Objects != nil {
in, out := &in.Objects, &out.Objects
*out = make([]ObjectStatus, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentList.
func (in *ComponentList) DeepCopy() *ComponentList {
if in == nil {
return nil
}
out := new(ComponentList)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Condition) DeepCopyInto(out *Condition) {
*out = *in
in.LastUpdateTime.DeepCopyInto(&out.LastUpdateTime)
in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition.
func (in *Condition) DeepCopy() *Condition {
if in == nil {
return nil
}
out := new(Condition)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ConfigMapKeySelector) DeepCopyInto(out *ConfigMapKeySelector) {
*out = *in
out.ObjectReference = in.ObjectReference
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigMapKeySelector.
func (in *ConfigMapKeySelector) DeepCopy() *ConfigMapKeySelector {
if in == nil {
return nil
}
out := new(ConfigMapKeySelector)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ContactData) DeepCopyInto(out *ContactData) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContactData.
func (in *ContactData) DeepCopy() *ContactData {
if in == nil {
return nil
}
out := new(ContactData)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Descriptor) DeepCopyInto(out *Descriptor) {
*out = *in
if in.Icons != nil {
in, out := &in.Icons, &out.Icons
*out = make([]ImageSpec, len(*in))
copy(*out, *in)
}
if in.Maintainers != nil {
in, out := &in.Maintainers, &out.Maintainers
*out = make([]ContactData, len(*in))
copy(*out, *in)
}
if in.Owners != nil {
in, out := &in.Owners, &out.Owners
*out = make([]ContactData, len(*in))
copy(*out, *in)
}
if in.Keywords != nil {
in, out := &in.Keywords, &out.Keywords
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.Links != nil {
in, out := &in.Links, &out.Links
*out = make([]Link, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Descriptor.
func (in *Descriptor) DeepCopy() *Descriptor {
if in == nil {
return nil
}
out := new(Descriptor)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ImageSpec) DeepCopyInto(out *ImageSpec) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageSpec.
func (in *ImageSpec) DeepCopy() *ImageSpec {
if in == nil {
return nil
}
out := new(ImageSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *InfoItem) DeepCopyInto(out *InfoItem) {
*out = *in
if in.ValueFrom != nil {
in, out := &in.ValueFrom, &out.ValueFrom
*out = new(InfoItemSource)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InfoItem.
func (in *InfoItem) DeepCopy() *InfoItem {
if in == nil {
return nil
}
out := new(InfoItem)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *InfoItemSource) DeepCopyInto(out *InfoItemSource) {
*out = *in
if in.SecretKeyRef != nil {
in, out := &in.SecretKeyRef, &out.SecretKeyRef
*out = new(SecretKeySelector)
**out = **in
}
if in.ConfigMapKeyRef != nil {
in, out := &in.ConfigMapKeyRef, &out.ConfigMapKeyRef
*out = new(ConfigMapKeySelector)
**out = **in
}
if in.ServiceRef != nil {
in, out := &in.ServiceRef, &out.ServiceRef
*out = new(ServiceSelector)
(*in).DeepCopyInto(*out)
}
if in.IngressRef != nil {
in, out := &in.IngressRef, &out.IngressRef
*out = new(IngressSelector)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InfoItemSource.
func (in *InfoItemSource) DeepCopy() *InfoItemSource {
if in == nil {
return nil
}
out := new(InfoItemSource)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *IngressSelector) DeepCopyInto(out *IngressSelector) {
*out = *in
out.ObjectReference = in.ObjectReference
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressSelector.
func (in *IngressSelector) DeepCopy() *IngressSelector {
if in == nil {
return nil
}
out := new(IngressSelector)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Link) DeepCopyInto(out *Link) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Link.
func (in *Link) DeepCopy() *Link {
if in == nil {
return nil
}
out := new(Link)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ObjectStatus) DeepCopyInto(out *ObjectStatus) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectStatus.
func (in *ObjectStatus) DeepCopy() *ObjectStatus {
if in == nil {
return nil
}
out := new(ObjectStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SecretKeySelector) DeepCopyInto(out *SecretKeySelector) {
*out = *in
out.ObjectReference = in.ObjectReference
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretKeySelector.
func (in *SecretKeySelector) DeepCopy() *SecretKeySelector {
if in == nil {
return nil
}
out := new(SecretKeySelector)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ServiceSelector) DeepCopyInto(out *ServiceSelector) {
*out = *in
out.ObjectReference = in.ObjectReference
if in.Port != nil {
in, out := &in.Port, &out.Port
*out = new(int32)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceSelector.
func (in *ServiceSelector) DeepCopy() *ServiceSelector {
if in == nil {
return nil
}
out := new(ServiceSelector)
in.DeepCopyInto(out)
return out
}
......@@ -18,7 +18,7 @@ package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/application/pkg/apis/app/v1beta1"
"sigs.k8s.io/application/api/v1beta1"
)
const (
......
......@@ -139,7 +139,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
configShallowCopy := *c
if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 {
if configShallowCopy.Burst <= 0 {
return nil, fmt.Errorf("Burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0")
return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0")
}
configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst)
}
......
......@@ -19,6 +19,8 @@ limitations under the License.
package fake
import (
"context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
......@@ -38,7 +40,7 @@ var rulesResource = schema.GroupVersionResource{Group: "auditing.kubesphere.io",
var rulesKind = schema.GroupVersionKind{Group: "auditing.kubesphere.io", Version: "v1alpha1", Kind: "Rule"}
// Get takes name of the rule, and returns the corresponding rule object, and an error if there is any.
func (c *FakeRules) Get(name string, options v1.GetOptions) (result *v1alpha1.Rule, err error) {
func (c *FakeRules) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Rule, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(rulesResource, name), &v1alpha1.Rule{})
if obj == nil {
......@@ -48,7 +50,7 @@ func (c *FakeRules) Get(name string, options v1.GetOptions) (result *v1alpha1.Ru
}
// List takes label and field selectors, and returns the list of Rules that match those selectors.
func (c *FakeRules) List(opts v1.ListOptions) (result *v1alpha1.RuleList, err error) {
func (c *FakeRules) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RuleList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(rulesResource, rulesKind, opts), &v1alpha1.RuleList{})
if obj == nil {
......@@ -69,13 +71,13 @@ func (c *FakeRules) List(opts v1.ListOptions) (result *v1alpha1.RuleList, err er
}
// Watch returns a watch.Interface that watches the requested rules.
func (c *FakeRules) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakeRules) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchAction(rulesResource, opts))
}
// Create takes the representation of a rule and creates it. Returns the server's representation of the rule, and an error, if there is any.
func (c *FakeRules) Create(rule *v1alpha1.Rule) (result *v1alpha1.Rule, err error) {
func (c *FakeRules) Create(ctx context.Context, rule *v1alpha1.Rule, opts v1.CreateOptions) (result *v1alpha1.Rule, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(rulesResource, rule), &v1alpha1.Rule{})
if obj == nil {
......@@ -85,7 +87,7 @@ func (c *FakeRules) Create(rule *v1alpha1.Rule) (result *v1alpha1.Rule, err erro
}
// Update takes the representation of a rule and updates it. Returns the server's representation of the rule, and an error, if there is any.
func (c *FakeRules) Update(rule *v1alpha1.Rule) (result *v1alpha1.Rule, err error) {
func (c *FakeRules) Update(ctx context.Context, rule *v1alpha1.Rule, opts v1.UpdateOptions) (result *v1alpha1.Rule, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(rulesResource, rule), &v1alpha1.Rule{})
if obj == nil {
......@@ -95,22 +97,22 @@ func (c *FakeRules) Update(rule *v1alpha1.Rule) (result *v1alpha1.Rule, err erro
}
// Delete takes name of the rule and deletes it. Returns an error if one occurs.
func (c *FakeRules) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeRules) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(rulesResource, name), &v1alpha1.Rule{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeRules) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(rulesResource, listOptions)
func (c *FakeRules) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(rulesResource, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.RuleList{})
return err
}
// Patch applies the patch and returns the patched rule.
func (c *FakeRules) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Rule, err error) {
func (c *FakeRules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Rule, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(rulesResource, name, pt, data, subresources...), &v1alpha1.Rule{})
if obj == nil {
......
......@@ -19,6 +19,8 @@ limitations under the License.
package fake
import (
"context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
......@@ -38,7 +40,7 @@ var webhooksResource = schema.GroupVersionResource{Group: "auditing.kubesphere.i
var webhooksKind = schema.GroupVersionKind{Group: "auditing.kubesphere.io", Version: "v1alpha1", Kind: "Webhook"}
// Get takes name of the webhook, and returns the corresponding webhook object, and an error if there is any.
func (c *FakeWebhooks) Get(name string, options v1.GetOptions) (result *v1alpha1.Webhook, err error) {
func (c *FakeWebhooks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Webhook, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(webhooksResource, name), &v1alpha1.Webhook{})
if obj == nil {
......@@ -48,7 +50,7 @@ func (c *FakeWebhooks) Get(name string, options v1.GetOptions) (result *v1alpha1
}
// List takes label and field selectors, and returns the list of Webhooks that match those selectors.
func (c *FakeWebhooks) List(opts v1.ListOptions) (result *v1alpha1.WebhookList, err error) {
func (c *FakeWebhooks) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.WebhookList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(webhooksResource, webhooksKind, opts), &v1alpha1.WebhookList{})
if obj == nil {
......@@ -69,13 +71,13 @@ func (c *FakeWebhooks) List(opts v1.ListOptions) (result *v1alpha1.WebhookList,
}
// Watch returns a watch.Interface that watches the requested webhooks.
func (c *FakeWebhooks) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakeWebhooks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchAction(webhooksResource, opts))
}
// Create takes the representation of a webhook and creates it. Returns the server's representation of the webhook, and an error, if there is any.
func (c *FakeWebhooks) Create(webhook *v1alpha1.Webhook) (result *v1alpha1.Webhook, err error) {
func (c *FakeWebhooks) Create(ctx context.Context, webhook *v1alpha1.Webhook, opts v1.CreateOptions) (result *v1alpha1.Webhook, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(webhooksResource, webhook), &v1alpha1.Webhook{})
if obj == nil {
......@@ -85,7 +87,7 @@ func (c *FakeWebhooks) Create(webhook *v1alpha1.Webhook) (result *v1alpha1.Webho
}
// Update takes the representation of a webhook and updates it. Returns the server's representation of the webhook, and an error, if there is any.
func (c *FakeWebhooks) Update(webhook *v1alpha1.Webhook) (result *v1alpha1.Webhook, err error) {
func (c *FakeWebhooks) Update(ctx context.Context, webhook *v1alpha1.Webhook, opts v1.UpdateOptions) (result *v1alpha1.Webhook, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(webhooksResource, webhook), &v1alpha1.Webhook{})
if obj == nil {
......@@ -95,22 +97,22 @@ func (c *FakeWebhooks) Update(webhook *v1alpha1.Webhook) (result *v1alpha1.Webho
}
// Delete takes name of the webhook and deletes it. Returns an error if one occurs.
func (c *FakeWebhooks) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeWebhooks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(webhooksResource, name), &v1alpha1.Webhook{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeWebhooks) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(webhooksResource, listOptions)
func (c *FakeWebhooks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(webhooksResource, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.WebhookList{})
return err
}
// Patch applies the patch and returns the patched webhook.
func (c *FakeWebhooks) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Webhook, err error) {
func (c *FakeWebhooks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Webhook, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(webhooksResource, name, pt, data, subresources...), &v1alpha1.Webhook{})
if obj == nil {
......
......@@ -19,6 +19,7 @@ limitations under the License.
package v1alpha1
import (
"context"
"time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
......@@ -37,14 +38,14 @@ type RulesGetter interface {
// RuleInterface has methods to work with Rule resources.
type RuleInterface interface {
Create(*v1alpha1.Rule) (*v1alpha1.Rule, error)
Update(*v1alpha1.Rule) (*v1alpha1.Rule, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*v1alpha1.Rule, error)
List(opts v1.ListOptions) (*v1alpha1.RuleList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Rule, err error)
Create(ctx context.Context, rule *v1alpha1.Rule, opts v1.CreateOptions) (*v1alpha1.Rule, error)
Update(ctx context.Context, rule *v1alpha1.Rule, opts v1.UpdateOptions) (*v1alpha1.Rule, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Rule, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.RuleList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Rule, err error)
RuleExpansion
}
......@@ -61,19 +62,19 @@ func newRules(c *AuditingV1alpha1Client) *rules {
}
// Get takes name of the rule, and returns the corresponding rule object, and an error if there is any.
func (c *rules) Get(name string, options v1.GetOptions) (result *v1alpha1.Rule, err error) {
func (c *rules) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Rule, err error) {
result = &v1alpha1.Rule{}
err = c.client.Get().
Resource("rules").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of Rules that match those selectors.
func (c *rules) List(opts v1.ListOptions) (result *v1alpha1.RuleList, err error) {
func (c *rules) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RuleList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
......@@ -83,13 +84,13 @@ func (c *rules) List(opts v1.ListOptions) (result *v1alpha1.RuleList, err error)
Resource("rules").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested rules.
func (c *rules) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *rules) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
......@@ -99,66 +100,69 @@ func (c *rules) Watch(opts v1.ListOptions) (watch.Interface, error) {
Resource("rules").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(ctx)
}
// Create takes the representation of a rule and creates it. Returns the server's representation of the rule, and an error, if there is any.
func (c *rules) Create(rule *v1alpha1.Rule) (result *v1alpha1.Rule, err error) {
func (c *rules) Create(ctx context.Context, rule *v1alpha1.Rule, opts v1.CreateOptions) (result *v1alpha1.Rule, err error) {
result = &v1alpha1.Rule{}
err = c.client.Post().
Resource("rules").
VersionedParams(&opts, scheme.ParameterCodec).
Body(rule).
Do().
Do(ctx).
Into(result)
return
}
// Update takes the representation of a rule and updates it. Returns the server's representation of the rule, and an error, if there is any.
func (c *rules) Update(rule *v1alpha1.Rule) (result *v1alpha1.Rule, err error) {
func (c *rules) Update(ctx context.Context, rule *v1alpha1.Rule, opts v1.UpdateOptions) (result *v1alpha1.Rule, err error) {
result = &v1alpha1.Rule{}
err = c.client.Put().
Resource("rules").
Name(rule.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(rule).
Do().
Do(ctx).
Into(result)
return
}
// Delete takes name of the rule and deletes it. Returns an error if one occurs.
func (c *rules) Delete(name string, options *v1.DeleteOptions) error {
func (c *rules) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Resource("rules").
Name(name).
Body(options).
Do().
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *rules) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *rules) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Resource("rules").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched rule.
func (c *rules) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Rule, err error) {
func (c *rules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Rule, err error) {
result = &v1alpha1.Rule{}
err = c.client.Patch(pt).
Resource("rules").
SubResource(subresources...).
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do().
Do(ctx).
Into(result)
return
}
......@@ -19,6 +19,7 @@ limitations under the License.
package v1alpha1
import (
"context"
"time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
......@@ -37,14 +38,14 @@ type WebhooksGetter interface {
// WebhookInterface has methods to work with Webhook resources.
type WebhookInterface interface {
Create(*v1alpha1.Webhook) (*v1alpha1.Webhook, error)
Update(*v1alpha1.Webhook) (*v1alpha1.Webhook, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*v1alpha1.Webhook, error)
List(opts v1.ListOptions) (*v1alpha1.WebhookList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Webhook, err error)
Create(ctx context.Context, webhook *v1alpha1.Webhook, opts v1.CreateOptions) (*v1alpha1.Webhook, error)
Update(ctx context.Context, webhook *v1alpha1.Webhook, opts v1.UpdateOptions) (*v1alpha1.Webhook, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Webhook, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.WebhookList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Webhook, err error)
WebhookExpansion
}
......@@ -61,19 +62,19 @@ func newWebhooks(c *AuditingV1alpha1Client) *webhooks {
}
// Get takes name of the webhook, and returns the corresponding webhook object, and an error if there is any.
func (c *webhooks) Get(name string, options v1.GetOptions) (result *v1alpha1.Webhook, err error) {
func (c *webhooks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Webhook, err error) {
result = &v1alpha1.Webhook{}
err = c.client.Get().
Resource("webhooks").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of Webhooks that match those selectors.
func (c *webhooks) List(opts v1.ListOptions) (result *v1alpha1.WebhookList, err error) {
func (c *webhooks) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.WebhookList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
......@@ -83,13 +84,13 @@ func (c *webhooks) List(opts v1.ListOptions) (result *v1alpha1.WebhookList, err
Resource("webhooks").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested webhooks.
func (c *webhooks) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *webhooks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
......@@ -99,66 +100,69 @@ func (c *webhooks) Watch(opts v1.ListOptions) (watch.Interface, error) {
Resource("webhooks").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(ctx)
}
// Create takes the representation of a webhook and creates it. Returns the server's representation of the webhook, and an error, if there is any.
func (c *webhooks) Create(webhook *v1alpha1.Webhook) (result *v1alpha1.Webhook, err error) {
func (c *webhooks) Create(ctx context.Context, webhook *v1alpha1.Webhook, opts v1.CreateOptions) (result *v1alpha1.Webhook, err error) {
result = &v1alpha1.Webhook{}
err = c.client.Post().
Resource("webhooks").
VersionedParams(&opts, scheme.ParameterCodec).
Body(webhook).
Do().
Do(ctx).
Into(result)
return
}
// Update takes the representation of a webhook and updates it. Returns the server's representation of the webhook, and an error, if there is any.
func (c *webhooks) Update(webhook *v1alpha1.Webhook) (result *v1alpha1.Webhook, err error) {
func (c *webhooks) Update(ctx context.Context, webhook *v1alpha1.Webhook, opts v1.UpdateOptions) (result *v1alpha1.Webhook, err error) {
result = &v1alpha1.Webhook{}
err = c.client.Put().
Resource("webhooks").
Name(webhook.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(webhook).
Do().
Do(ctx).
Into(result)
return
}
// Delete takes name of the webhook and deletes it. Returns an error if one occurs.
func (c *webhooks) Delete(name string, options *v1.DeleteOptions) error {
func (c *webhooks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Resource("webhooks").
Name(name).
Body(options).
Do().
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *webhooks) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *webhooks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Resource("webhooks").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched webhook.
func (c *webhooks) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Webhook, err error) {
func (c *webhooks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Webhook, err error) {
result = &v1alpha1.Webhook{}
err = c.client.Patch(pt).
Resource("webhooks").
SubResource(subresources...).
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do().
Do(ctx).
Into(result)
return
}
......@@ -19,6 +19,7 @@ limitations under the License.
package v1alpha1
import (
"context"
"time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
......@@ -37,15 +38,15 @@ type ClustersGetter interface {
// ClusterInterface has methods to work with Cluster resources.
type ClusterInterface interface {
Create(*v1alpha1.Cluster) (*v1alpha1.Cluster, error)
Update(*v1alpha1.Cluster) (*v1alpha1.Cluster, error)
UpdateStatus(*v1alpha1.Cluster) (*v1alpha1.Cluster, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*v1alpha1.Cluster, error)
List(opts v1.ListOptions) (*v1alpha1.ClusterList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Cluster, err error)
Create(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.CreateOptions) (*v1alpha1.Cluster, error)
Update(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.UpdateOptions) (*v1alpha1.Cluster, error)
UpdateStatus(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.UpdateOptions) (*v1alpha1.Cluster, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Cluster, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Cluster, err error)
ClusterExpansion
}
......@@ -62,19 +63,19 @@ func newClusters(c *ClusterV1alpha1Client) *clusters {
}
// Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any.
func (c *clusters) Get(name string, options v1.GetOptions) (result *v1alpha1.Cluster, err error) {
func (c *clusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Cluster, err error) {
result = &v1alpha1.Cluster{}
err = c.client.Get().
Resource("clusters").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of Clusters that match those selectors.
func (c *clusters) List(opts v1.ListOptions) (result *v1alpha1.ClusterList, err error) {
func (c *clusters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
......@@ -84,13 +85,13 @@ func (c *clusters) List(opts v1.ListOptions) (result *v1alpha1.ClusterList, err
Resource("clusters").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested clusters.
func (c *clusters) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *clusters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
......@@ -100,81 +101,84 @@ func (c *clusters) Watch(opts v1.ListOptions) (watch.Interface, error) {
Resource("clusters").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(ctx)
}
// Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any.
func (c *clusters) Create(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) {
func (c *clusters) Create(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.CreateOptions) (result *v1alpha1.Cluster, err error) {
result = &v1alpha1.Cluster{}
err = c.client.Post().
Resource("clusters").
VersionedParams(&opts, scheme.ParameterCodec).
Body(cluster).
Do().
Do(ctx).
Into(result)
return
}
// Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any.
func (c *clusters) Update(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) {
func (c *clusters) Update(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.UpdateOptions) (result *v1alpha1.Cluster, err error) {
result = &v1alpha1.Cluster{}
err = c.client.Put().
Resource("clusters").
Name(cluster.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(cluster).
Do().
Do(ctx).
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 *clusters) UpdateStatus(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) {
func (c *clusters) UpdateStatus(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.UpdateOptions) (result *v1alpha1.Cluster, err error) {
result = &v1alpha1.Cluster{}
err = c.client.Put().
Resource("clusters").
Name(cluster.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(cluster).
Do().
Do(ctx).
Into(result)
return
}
// Delete takes name of the cluster and deletes it. Returns an error if one occurs.
func (c *clusters) Delete(name string, options *v1.DeleteOptions) error {
func (c *clusters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Resource("clusters").
Name(name).
Body(options).
Do().
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *clusters) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *clusters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Resource("clusters").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched cluster.
func (c *clusters) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Cluster, err error) {
func (c *clusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Cluster, err error) {
result = &v1alpha1.Cluster{}
err = c.client.Patch(pt).
Resource("clusters").
SubResource(subresources...).
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do().
Do(ctx).
Into(result)
return
}
......@@ -19,6 +19,8 @@ limitations under the License.
package fake
import (
"context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
......@@ -38,7 +40,7 @@ var clustersResource = schema.GroupVersionResource{Group: "cluster.kubesphere.io
var clustersKind = schema.GroupVersionKind{Group: "cluster.kubesphere.io", Version: "v1alpha1", Kind: "Cluster"}
// Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any.
func (c *FakeClusters) Get(name string, options v1.GetOptions) (result *v1alpha1.Cluster, err error) {
func (c *FakeClusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Cluster, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(clustersResource, name), &v1alpha1.Cluster{})
if obj == nil {
......@@ -48,7 +50,7 @@ func (c *FakeClusters) Get(name string, options v1.GetOptions) (result *v1alpha1
}
// List takes label and field selectors, and returns the list of Clusters that match those selectors.
func (c *FakeClusters) List(opts v1.ListOptions) (result *v1alpha1.ClusterList, err error) {
func (c *FakeClusters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(clustersResource, clustersKind, opts), &v1alpha1.ClusterList{})
if obj == nil {
......@@ -69,13 +71,13 @@ func (c *FakeClusters) List(opts v1.ListOptions) (result *v1alpha1.ClusterList,
}
// Watch returns a watch.Interface that watches the requested clusters.
func (c *FakeClusters) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakeClusters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchAction(clustersResource, opts))
}
// Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any.
func (c *FakeClusters) Create(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) {
func (c *FakeClusters) Create(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.CreateOptions) (result *v1alpha1.Cluster, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(clustersResource, cluster), &v1alpha1.Cluster{})
if obj == nil {
......@@ -85,7 +87,7 @@ func (c *FakeClusters) Create(cluster *v1alpha1.Cluster) (result *v1alpha1.Clust
}
// Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any.
func (c *FakeClusters) Update(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) {
func (c *FakeClusters) Update(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.UpdateOptions) (result *v1alpha1.Cluster, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(clustersResource, cluster), &v1alpha1.Cluster{})
if obj == nil {
......@@ -96,7 +98,7 @@ func (c *FakeClusters) Update(cluster *v1alpha1.Cluster) (result *v1alpha1.Clust
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeClusters) UpdateStatus(cluster *v1alpha1.Cluster) (*v1alpha1.Cluster, error) {
func (c *FakeClusters) UpdateStatus(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.UpdateOptions) (*v1alpha1.Cluster, error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateSubresourceAction(clustersResource, "status", cluster), &v1alpha1.Cluster{})
if obj == nil {
......@@ -106,22 +108,22 @@ func (c *FakeClusters) UpdateStatus(cluster *v1alpha1.Cluster) (*v1alpha1.Cluste
}
// Delete takes name of the cluster and deletes it. Returns an error if one occurs.
func (c *FakeClusters) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeClusters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(clustersResource, name), &v1alpha1.Cluster{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeClusters) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(clustersResource, listOptions)
func (c *FakeClusters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(clustersResource, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.ClusterList{})
return err
}
// Patch applies the patch and returns the patched cluster.
func (c *FakeClusters) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Cluster, err error) {
func (c *FakeClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Cluster, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(clustersResource, name, pt, data, subresources...), &v1alpha1.Cluster{})
if obj == nil {
......
......@@ -19,6 +19,8 @@ limitations under the License.
package fake
import (
"context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
......@@ -39,7 +41,7 @@ var s2ibinariesResource = schema.GroupVersionResource{Group: "devops.kubesphere.
var s2ibinariesKind = schema.GroupVersionKind{Group: "devops.kubesphere.io", Version: "v1alpha1", Kind: "S2iBinary"}
// Get takes name of the s2iBinary, and returns the corresponding s2iBinary object, and an error if there is any.
func (c *FakeS2iBinaries) Get(name string, options v1.GetOptions) (result *v1alpha1.S2iBinary, err error) {
func (c *FakeS2iBinaries) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.S2iBinary, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(s2ibinariesResource, c.ns, name), &v1alpha1.S2iBinary{})
......@@ -50,7 +52,7 @@ func (c *FakeS2iBinaries) Get(name string, options v1.GetOptions) (result *v1alp
}
// List takes label and field selectors, and returns the list of S2iBinaries that match those selectors.
func (c *FakeS2iBinaries) List(opts v1.ListOptions) (result *v1alpha1.S2iBinaryList, err error) {
func (c *FakeS2iBinaries) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.S2iBinaryList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(s2ibinariesResource, s2ibinariesKind, c.ns, opts), &v1alpha1.S2iBinaryList{})
......@@ -72,14 +74,14 @@ func (c *FakeS2iBinaries) List(opts v1.ListOptions) (result *v1alpha1.S2iBinaryL
}
// Watch returns a watch.Interface that watches the requested s2iBinaries.
func (c *FakeS2iBinaries) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakeS2iBinaries) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(s2ibinariesResource, c.ns, opts))
}
// Create takes the representation of a s2iBinary and creates it. Returns the server's representation of the s2iBinary, and an error, if there is any.
func (c *FakeS2iBinaries) Create(s2iBinary *v1alpha1.S2iBinary) (result *v1alpha1.S2iBinary, err error) {
func (c *FakeS2iBinaries) Create(ctx context.Context, s2iBinary *v1alpha1.S2iBinary, opts v1.CreateOptions) (result *v1alpha1.S2iBinary, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(s2ibinariesResource, c.ns, s2iBinary), &v1alpha1.S2iBinary{})
......@@ -90,7 +92,7 @@ func (c *FakeS2iBinaries) Create(s2iBinary *v1alpha1.S2iBinary) (result *v1alpha
}
// Update takes the representation of a s2iBinary and updates it. Returns the server's representation of the s2iBinary, and an error, if there is any.
func (c *FakeS2iBinaries) Update(s2iBinary *v1alpha1.S2iBinary) (result *v1alpha1.S2iBinary, err error) {
func (c *FakeS2iBinaries) Update(ctx context.Context, s2iBinary *v1alpha1.S2iBinary, opts v1.UpdateOptions) (result *v1alpha1.S2iBinary, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(s2ibinariesResource, c.ns, s2iBinary), &v1alpha1.S2iBinary{})
......@@ -102,7 +104,7 @@ func (c *FakeS2iBinaries) Update(s2iBinary *v1alpha1.S2iBinary) (result *v1alpha
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeS2iBinaries) UpdateStatus(s2iBinary *v1alpha1.S2iBinary) (*v1alpha1.S2iBinary, error) {
func (c *FakeS2iBinaries) UpdateStatus(ctx context.Context, s2iBinary *v1alpha1.S2iBinary, opts v1.UpdateOptions) (*v1alpha1.S2iBinary, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(s2ibinariesResource, "status", c.ns, s2iBinary), &v1alpha1.S2iBinary{})
......@@ -113,7 +115,7 @@ func (c *FakeS2iBinaries) UpdateStatus(s2iBinary *v1alpha1.S2iBinary) (*v1alpha1
}
// Delete takes name of the s2iBinary and deletes it. Returns an error if one occurs.
func (c *FakeS2iBinaries) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeS2iBinaries) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(s2ibinariesResource, c.ns, name), &v1alpha1.S2iBinary{})
......@@ -121,15 +123,15 @@ func (c *FakeS2iBinaries) Delete(name string, options *v1.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *FakeS2iBinaries) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(s2ibinariesResource, c.ns, listOptions)
func (c *FakeS2iBinaries) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(s2ibinariesResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.S2iBinaryList{})
return err
}
// Patch applies the patch and returns the patched s2iBinary.
func (c *FakeS2iBinaries) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.S2iBinary, err error) {
func (c *FakeS2iBinaries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.S2iBinary, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(s2ibinariesResource, c.ns, name, pt, data, subresources...), &v1alpha1.S2iBinary{})
......
......@@ -19,6 +19,8 @@ limitations under the License.
package fake
import (
"context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
......@@ -39,7 +41,7 @@ var s2ibuildersResource = schema.GroupVersionResource{Group: "devops.kubesphere.
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) {
func (c *FakeS2iBuilders) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.S2iBuilder, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(s2ibuildersResource, c.ns, name), &v1alpha1.S2iBuilder{})
......@@ -50,7 +52,7 @@ func (c *FakeS2iBuilders) Get(name string, options v1.GetOptions) (result *v1alp
}
// 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) {
func (c *FakeS2iBuilders) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.S2iBuilderList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(s2ibuildersResource, s2ibuildersKind, c.ns, opts), &v1alpha1.S2iBuilderList{})
......@@ -72,14 +74,14 @@ func (c *FakeS2iBuilders) List(opts v1.ListOptions) (result *v1alpha1.S2iBuilder
}
// Watch returns a watch.Interface that watches the requested s2iBuilders.
func (c *FakeS2iBuilders) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakeS2iBuilders) Watch(ctx context.Context, 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) {
func (c *FakeS2iBuilders) Create(ctx context.Context, s2iBuilder *v1alpha1.S2iBuilder, opts v1.CreateOptions) (result *v1alpha1.S2iBuilder, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(s2ibuildersResource, c.ns, s2iBuilder), &v1alpha1.S2iBuilder{})
......@@ -90,7 +92,7 @@ func (c *FakeS2iBuilders) Create(s2iBuilder *v1alpha1.S2iBuilder) (result *v1alp
}
// 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) {
func (c *FakeS2iBuilders) Update(ctx context.Context, s2iBuilder *v1alpha1.S2iBuilder, opts v1.UpdateOptions) (result *v1alpha1.S2iBuilder, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(s2ibuildersResource, c.ns, s2iBuilder), &v1alpha1.S2iBuilder{})
......@@ -102,7 +104,7 @@ func (c *FakeS2iBuilders) Update(s2iBuilder *v1alpha1.S2iBuilder) (result *v1alp
// 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) {
func (c *FakeS2iBuilders) UpdateStatus(ctx context.Context, s2iBuilder *v1alpha1.S2iBuilder, opts v1.UpdateOptions) (*v1alpha1.S2iBuilder, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(s2ibuildersResource, "status", c.ns, s2iBuilder), &v1alpha1.S2iBuilder{})
......@@ -113,7 +115,7 @@ func (c *FakeS2iBuilders) UpdateStatus(s2iBuilder *v1alpha1.S2iBuilder) (*v1alph
}
// 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 {
func (c *FakeS2iBuilders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(s2ibuildersResource, c.ns, name), &v1alpha1.S2iBuilder{})
......@@ -121,15 +123,15 @@ func (c *FakeS2iBuilders) Delete(name string, options *v1.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *FakeS2iBuilders) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(s2ibuildersResource, c.ns, listOptions)
func (c *FakeS2iBuilders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(s2ibuildersResource, c.ns, listOpts)
_, 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) {
func (c *FakeS2iBuilders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.S2iBuilder, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(s2ibuildersResource, c.ns, name, pt, data, subresources...), &v1alpha1.S2iBuilder{})
......
......@@ -19,6 +19,8 @@ limitations under the License.
package fake
import (
"context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
......@@ -38,7 +40,7 @@ var s2ibuildertemplatesResource = schema.GroupVersionResource{Group: "devops.kub
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) {
func (c *FakeS2iBuilderTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.S2iBuilderTemplate, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(s2ibuildertemplatesResource, name), &v1alpha1.S2iBuilderTemplate{})
if obj == nil {
......@@ -48,7 +50,7 @@ func (c *FakeS2iBuilderTemplates) Get(name string, options v1.GetOptions) (resul
}
// 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) {
func (c *FakeS2iBuilderTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.S2iBuilderTemplateList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(s2ibuildertemplatesResource, s2ibuildertemplatesKind, opts), &v1alpha1.S2iBuilderTemplateList{})
if obj == nil {
......@@ -69,13 +71,13 @@ func (c *FakeS2iBuilderTemplates) List(opts v1.ListOptions) (result *v1alpha1.S2
}
// Watch returns a watch.Interface that watches the requested s2iBuilderTemplates.
func (c *FakeS2iBuilderTemplates) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakeS2iBuilderTemplates) Watch(ctx context.Context, 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) {
func (c *FakeS2iBuilderTemplates) Create(ctx context.Context, s2iBuilderTemplate *v1alpha1.S2iBuilderTemplate, opts v1.CreateOptions) (result *v1alpha1.S2iBuilderTemplate, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(s2ibuildertemplatesResource, s2iBuilderTemplate), &v1alpha1.S2iBuilderTemplate{})
if obj == nil {
......@@ -85,7 +87,7 @@ func (c *FakeS2iBuilderTemplates) Create(s2iBuilderTemplate *v1alpha1.S2iBuilder
}
// 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) {
func (c *FakeS2iBuilderTemplates) Update(ctx context.Context, s2iBuilderTemplate *v1alpha1.S2iBuilderTemplate, opts v1.UpdateOptions) (result *v1alpha1.S2iBuilderTemplate, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(s2ibuildertemplatesResource, s2iBuilderTemplate), &v1alpha1.S2iBuilderTemplate{})
if obj == nil {
......@@ -96,7 +98,7 @@ func (c *FakeS2iBuilderTemplates) Update(s2iBuilderTemplate *v1alpha1.S2iBuilder
// 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) {
func (c *FakeS2iBuilderTemplates) UpdateStatus(ctx context.Context, s2iBuilderTemplate *v1alpha1.S2iBuilderTemplate, opts v1.UpdateOptions) (*v1alpha1.S2iBuilderTemplate, error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateSubresourceAction(s2ibuildertemplatesResource, "status", s2iBuilderTemplate), &v1alpha1.S2iBuilderTemplate{})
if obj == nil {
......@@ -106,22 +108,22 @@ func (c *FakeS2iBuilderTemplates) UpdateStatus(s2iBuilderTemplate *v1alpha1.S2iB
}
// 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 {
func (c *FakeS2iBuilderTemplates) Delete(ctx context.Context, name string, opts 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)
func (c *FakeS2iBuilderTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(s2ibuildertemplatesResource, listOpts)
_, 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) {
func (c *FakeS2iBuilderTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.S2iBuilderTemplate, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(s2ibuildertemplatesResource, name, pt, data, subresources...), &v1alpha1.S2iBuilderTemplate{})
if obj == nil {
......
......@@ -19,6 +19,8 @@ limitations under the License.
package fake
import (
"context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
......@@ -39,7 +41,7 @@ var s2irunsResource = schema.GroupVersionResource{Group: "devops.kubesphere.io",
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) {
func (c *FakeS2iRuns) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.S2iRun, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(s2irunsResource, c.ns, name), &v1alpha1.S2iRun{})
......@@ -50,7 +52,7 @@ func (c *FakeS2iRuns) Get(name string, options v1.GetOptions) (result *v1alpha1.
}
// 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) {
func (c *FakeS2iRuns) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.S2iRunList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(s2irunsResource, s2irunsKind, c.ns, opts), &v1alpha1.S2iRunList{})
......@@ -72,14 +74,14 @@ func (c *FakeS2iRuns) List(opts v1.ListOptions) (result *v1alpha1.S2iRunList, er
}
// Watch returns a watch.Interface that watches the requested s2iRuns.
func (c *FakeS2iRuns) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakeS2iRuns) Watch(ctx context.Context, 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) {
func (c *FakeS2iRuns) Create(ctx context.Context, s2iRun *v1alpha1.S2iRun, opts v1.CreateOptions) (result *v1alpha1.S2iRun, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(s2irunsResource, c.ns, s2iRun), &v1alpha1.S2iRun{})
......@@ -90,7 +92,7 @@ func (c *FakeS2iRuns) Create(s2iRun *v1alpha1.S2iRun) (result *v1alpha1.S2iRun,
}
// 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) {
func (c *FakeS2iRuns) Update(ctx context.Context, s2iRun *v1alpha1.S2iRun, opts v1.UpdateOptions) (result *v1alpha1.S2iRun, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(s2irunsResource, c.ns, s2iRun), &v1alpha1.S2iRun{})
......@@ -102,7 +104,7 @@ func (c *FakeS2iRuns) Update(s2iRun *v1alpha1.S2iRun) (result *v1alpha1.S2iRun,
// 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) {
func (c *FakeS2iRuns) UpdateStatus(ctx context.Context, s2iRun *v1alpha1.S2iRun, opts v1.UpdateOptions) (*v1alpha1.S2iRun, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(s2irunsResource, "status", c.ns, s2iRun), &v1alpha1.S2iRun{})
......@@ -113,7 +115,7 @@ func (c *FakeS2iRuns) UpdateStatus(s2iRun *v1alpha1.S2iRun) (*v1alpha1.S2iRun, e
}
// 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 {
func (c *FakeS2iRuns) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(s2irunsResource, c.ns, name), &v1alpha1.S2iRun{})
......@@ -121,15 +123,15 @@ func (c *FakeS2iRuns) Delete(name string, options *v1.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *FakeS2iRuns) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(s2irunsResource, c.ns, listOptions)
func (c *FakeS2iRuns) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(s2irunsResource, c.ns, listOpts)
_, 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) {
func (c *FakeS2iRuns) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.S2iRun, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(s2irunsResource, c.ns, name, pt, data, subresources...), &v1alpha1.S2iRun{})
......
......@@ -19,6 +19,7 @@ limitations under the License.
package v1alpha1
import (
"context"
"time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
......@@ -37,15 +38,15 @@ type S2iBinariesGetter interface {
// S2iBinaryInterface has methods to work with S2iBinary resources.
type S2iBinaryInterface interface {
Create(*v1alpha1.S2iBinary) (*v1alpha1.S2iBinary, error)
Update(*v1alpha1.S2iBinary) (*v1alpha1.S2iBinary, error)
UpdateStatus(*v1alpha1.S2iBinary) (*v1alpha1.S2iBinary, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*v1alpha1.S2iBinary, error)
List(opts v1.ListOptions) (*v1alpha1.S2iBinaryList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.S2iBinary, err error)
Create(ctx context.Context, s2iBinary *v1alpha1.S2iBinary, opts v1.CreateOptions) (*v1alpha1.S2iBinary, error)
Update(ctx context.Context, s2iBinary *v1alpha1.S2iBinary, opts v1.UpdateOptions) (*v1alpha1.S2iBinary, error)
UpdateStatus(ctx context.Context, s2iBinary *v1alpha1.S2iBinary, opts v1.UpdateOptions) (*v1alpha1.S2iBinary, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.S2iBinary, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.S2iBinaryList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.S2iBinary, err error)
S2iBinaryExpansion
}
......@@ -64,20 +65,20 @@ func newS2iBinaries(c *DevopsV1alpha1Client, namespace string) *s2iBinaries {
}
// Get takes name of the s2iBinary, and returns the corresponding s2iBinary object, and an error if there is any.
func (c *s2iBinaries) Get(name string, options v1.GetOptions) (result *v1alpha1.S2iBinary, err error) {
func (c *s2iBinaries) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.S2iBinary, err error) {
result = &v1alpha1.S2iBinary{}
err = c.client.Get().
Namespace(c.ns).
Resource("s2ibinaries").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of S2iBinaries that match those selectors.
func (c *s2iBinaries) List(opts v1.ListOptions) (result *v1alpha1.S2iBinaryList, err error) {
func (c *s2iBinaries) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.S2iBinaryList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
......@@ -88,13 +89,13 @@ func (c *s2iBinaries) List(opts v1.ListOptions) (result *v1alpha1.S2iBinaryList,
Resource("s2ibinaries").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested s2iBinaries.
func (c *s2iBinaries) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *s2iBinaries) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
......@@ -105,87 +106,90 @@ func (c *s2iBinaries) Watch(opts v1.ListOptions) (watch.Interface, error) {
Resource("s2ibinaries").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(ctx)
}
// Create takes the representation of a s2iBinary and creates it. Returns the server's representation of the s2iBinary, and an error, if there is any.
func (c *s2iBinaries) Create(s2iBinary *v1alpha1.S2iBinary) (result *v1alpha1.S2iBinary, err error) {
func (c *s2iBinaries) Create(ctx context.Context, s2iBinary *v1alpha1.S2iBinary, opts v1.CreateOptions) (result *v1alpha1.S2iBinary, err error) {
result = &v1alpha1.S2iBinary{}
err = c.client.Post().
Namespace(c.ns).
Resource("s2ibinaries").
VersionedParams(&opts, scheme.ParameterCodec).
Body(s2iBinary).
Do().
Do(ctx).
Into(result)
return
}
// Update takes the representation of a s2iBinary and updates it. Returns the server's representation of the s2iBinary, and an error, if there is any.
func (c *s2iBinaries) Update(s2iBinary *v1alpha1.S2iBinary) (result *v1alpha1.S2iBinary, err error) {
func (c *s2iBinaries) Update(ctx context.Context, s2iBinary *v1alpha1.S2iBinary, opts v1.UpdateOptions) (result *v1alpha1.S2iBinary, err error) {
result = &v1alpha1.S2iBinary{}
err = c.client.Put().
Namespace(c.ns).
Resource("s2ibinaries").
Name(s2iBinary.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(s2iBinary).
Do().
Do(ctx).
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 *s2iBinaries) UpdateStatus(s2iBinary *v1alpha1.S2iBinary) (result *v1alpha1.S2iBinary, err error) {
func (c *s2iBinaries) UpdateStatus(ctx context.Context, s2iBinary *v1alpha1.S2iBinary, opts v1.UpdateOptions) (result *v1alpha1.S2iBinary, err error) {
result = &v1alpha1.S2iBinary{}
err = c.client.Put().
Namespace(c.ns).
Resource("s2ibinaries").
Name(s2iBinary.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(s2iBinary).
Do().
Do(ctx).
Into(result)
return
}
// Delete takes name of the s2iBinary and deletes it. Returns an error if one occurs.
func (c *s2iBinaries) Delete(name string, options *v1.DeleteOptions) error {
func (c *s2iBinaries) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("s2ibinaries").
Name(name).
Body(options).
Do().
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *s2iBinaries) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *s2iBinaries) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("s2ibinaries").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched s2iBinary.
func (c *s2iBinaries) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.S2iBinary, err error) {
func (c *s2iBinaries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.S2iBinary, err error) {
result = &v1alpha1.S2iBinary{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("s2ibinaries").
SubResource(subresources...).
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do().
Do(ctx).
Into(result)
return
}
......@@ -19,6 +19,8 @@ limitations under the License.
package fake
import (
"context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
......@@ -38,7 +40,7 @@ var devopsprojectsResource = schema.GroupVersionResource{Group: "devops.kubesphe
var devopsprojectsKind = schema.GroupVersionKind{Group: "devops.kubesphere.io", Version: "v1alpha3", Kind: "DevOpsProject"}
// Get takes name of the devOpsProject, and returns the corresponding devOpsProject object, and an error if there is any.
func (c *FakeDevOpsProjects) Get(name string, options v1.GetOptions) (result *v1alpha3.DevOpsProject, err error) {
func (c *FakeDevOpsProjects) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.DevOpsProject, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(devopsprojectsResource, name), &v1alpha3.DevOpsProject{})
if obj == nil {
......@@ -48,7 +50,7 @@ func (c *FakeDevOpsProjects) Get(name string, options v1.GetOptions) (result *v1
}
// List takes label and field selectors, and returns the list of DevOpsProjects that match those selectors.
func (c *FakeDevOpsProjects) List(opts v1.ListOptions) (result *v1alpha3.DevOpsProjectList, err error) {
func (c *FakeDevOpsProjects) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.DevOpsProjectList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(devopsprojectsResource, devopsprojectsKind, opts), &v1alpha3.DevOpsProjectList{})
if obj == nil {
......@@ -69,13 +71,13 @@ func (c *FakeDevOpsProjects) List(opts v1.ListOptions) (result *v1alpha3.DevOpsP
}
// Watch returns a watch.Interface that watches the requested devOpsProjects.
func (c *FakeDevOpsProjects) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakeDevOpsProjects) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchAction(devopsprojectsResource, opts))
}
// Create takes the representation of a devOpsProject and creates it. Returns the server's representation of the devOpsProject, and an error, if there is any.
func (c *FakeDevOpsProjects) Create(devOpsProject *v1alpha3.DevOpsProject) (result *v1alpha3.DevOpsProject, err error) {
func (c *FakeDevOpsProjects) Create(ctx context.Context, devOpsProject *v1alpha3.DevOpsProject, opts v1.CreateOptions) (result *v1alpha3.DevOpsProject, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(devopsprojectsResource, devOpsProject), &v1alpha3.DevOpsProject{})
if obj == nil {
......@@ -85,7 +87,7 @@ func (c *FakeDevOpsProjects) Create(devOpsProject *v1alpha3.DevOpsProject) (resu
}
// Update takes the representation of a devOpsProject and updates it. Returns the server's representation of the devOpsProject, and an error, if there is any.
func (c *FakeDevOpsProjects) Update(devOpsProject *v1alpha3.DevOpsProject) (result *v1alpha3.DevOpsProject, err error) {
func (c *FakeDevOpsProjects) Update(ctx context.Context, devOpsProject *v1alpha3.DevOpsProject, opts v1.UpdateOptions) (result *v1alpha3.DevOpsProject, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(devopsprojectsResource, devOpsProject), &v1alpha3.DevOpsProject{})
if obj == nil {
......@@ -96,7 +98,7 @@ func (c *FakeDevOpsProjects) Update(devOpsProject *v1alpha3.DevOpsProject) (resu
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeDevOpsProjects) UpdateStatus(devOpsProject *v1alpha3.DevOpsProject) (*v1alpha3.DevOpsProject, error) {
func (c *FakeDevOpsProjects) UpdateStatus(ctx context.Context, devOpsProject *v1alpha3.DevOpsProject, opts v1.UpdateOptions) (*v1alpha3.DevOpsProject, error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateSubresourceAction(devopsprojectsResource, "status", devOpsProject), &v1alpha3.DevOpsProject{})
if obj == nil {
......@@ -106,22 +108,22 @@ func (c *FakeDevOpsProjects) UpdateStatus(devOpsProject *v1alpha3.DevOpsProject)
}
// Delete takes name of the devOpsProject and deletes it. Returns an error if one occurs.
func (c *FakeDevOpsProjects) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeDevOpsProjects) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(devopsprojectsResource, name), &v1alpha3.DevOpsProject{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeDevOpsProjects) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(devopsprojectsResource, listOptions)
func (c *FakeDevOpsProjects) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(devopsprojectsResource, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha3.DevOpsProjectList{})
return err
}
// Patch applies the patch and returns the patched devOpsProject.
func (c *FakeDevOpsProjects) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha3.DevOpsProject, err error) {
func (c *FakeDevOpsProjects) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.DevOpsProject, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(devopsprojectsResource, name, pt, data, subresources...), &v1alpha3.DevOpsProject{})
if obj == nil {
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册