Signed-off-by: SherlockShemol <shemol@163.com>tags/v0.7.0
| @@ -150,7 +150,7 @@ func (c *Controller) addDeployment(obj interface{}) { | |||||
| c.enqueueByDeployment(deployment) | c.enqueueByDeployment(deployment) | ||||
| } | } | ||||
| //deleteDeployment enqueues the FeatureExtractionService obj When a deleteDeployment is deleted | |||||
| // deleteDeployment enqueues the FeatureExtractionService obj When a deleteDeployment is deleted | |||||
| func (c *Controller) deleteDeployment(obj interface{}) { | func (c *Controller) deleteDeployment(obj interface{}) { | ||||
| deployment, ok := obj.(*appsv1.Deployment) | deployment, ok := obj.(*appsv1.Deployment) | ||||
| @@ -513,7 +513,7 @@ func (c *Controller) createFeatureExtractionWorker(service *sednav1.FeatureExtra | |||||
| } | } | ||||
| // Create FE deployment AND related pods (as part of the deployment creation) | // Create FE deployment AND related pods (as part of the deployment creation) | ||||
| _, err = runtime.CreateDeploymentWithTemplate(c.kubeClient, service, &service.Spec.DeploymentSpec, &workerParam, FEPort) | |||||
| _, err = runtime.CreateDeploymentWithTemplate(c.kubeClient, service, &service.Spec.DeploymentSpec, &workerParam) | |||||
| if err != nil { | if err != nil { | ||||
| return fmt.Errorf("failed to create feature extraction deployment: %w", err) | return fmt.Errorf("failed to create feature extraction deployment: %w", err) | ||||
| } | } | ||||
| @@ -20,9 +20,12 @@ import ( | |||||
| "context" | "context" | ||||
| "encoding/json" | "encoding/json" | ||||
| "fmt" | "fmt" | ||||
| "reflect" | |||||
| "strconv" | "strconv" | ||||
| "strings" | |||||
| "time" | "time" | ||||
| appsv1 "k8s.io/api/apps/v1" | |||||
| v1 "k8s.io/api/core/v1" | v1 "k8s.io/api/core/v1" | ||||
| "k8s.io/apimachinery/pkg/api/errors" | "k8s.io/apimachinery/pkg/api/errors" | ||||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||||
| @@ -33,7 +36,7 @@ import ( | |||||
| "k8s.io/client-go/kubernetes" | "k8s.io/client-go/kubernetes" | ||||
| "k8s.io/client-go/kubernetes/scheme" | "k8s.io/client-go/kubernetes/scheme" | ||||
| v1core "k8s.io/client-go/kubernetes/typed/core/v1" | v1core "k8s.io/client-go/kubernetes/typed/core/v1" | ||||
| corelisters "k8s.io/client-go/listers/core/v1" | |||||
| appslisters "k8s.io/client-go/listers/apps/v1" | |||||
| "k8s.io/client-go/tools/cache" | "k8s.io/client-go/tools/cache" | ||||
| "k8s.io/client-go/tools/record" | "k8s.io/client-go/tools/record" | ||||
| "k8s.io/client-go/util/workqueue" | "k8s.io/client-go/util/workqueue" | ||||
| @@ -61,19 +64,19 @@ const ( | |||||
| BigModelPort = 5000 | BigModelPort = 5000 | ||||
| ) | ) | ||||
| // Kind contains the schema.GroupVersionKind for this controller type. | |||||
| var Kind = sednav1.SchemeGroupVersion.WithKind(KindName) | |||||
| // gvk contains the schema.GroupVersionKind for this controller type. | |||||
| var gvk = sednav1.SchemeGroupVersion.WithKind(KindName) | |||||
| // Controller ensures that all JointInferenceService objects | // Controller ensures that all JointInferenceService objects | ||||
| // have corresponding pods to run their configured workload. | |||||
| // have corresponding deployments to run their configured workload. | |||||
| type Controller struct { | type Controller struct { | ||||
| kubeClient kubernetes.Interface | kubeClient kubernetes.Interface | ||||
| client sednaclientset.SednaV1alpha1Interface | client sednaclientset.SednaV1alpha1Interface | ||||
| // podStoreSynced returns true if the pod store has been synced at least once. | |||||
| podStoreSynced cache.InformerSynced | |||||
| // A store of pods | |||||
| podStore corelisters.PodLister | |||||
| // deploymentsSynced returns true if the deployment store has been synced at least once. | |||||
| deploymentsSynced cache.InformerSynced | |||||
| // A store of deployment | |||||
| deploymentsLister appslisters.DeploymentLister | |||||
| // serviceStoreSynced returns true if the JointInferenceService store has been synced at least once. | // serviceStoreSynced returns true if the JointInferenceService store has been synced at least once. | ||||
| serviceStoreSynced cache.InformerSynced | serviceStoreSynced cache.InformerSynced | ||||
| @@ -100,7 +103,7 @@ func (c *Controller) Run(stopCh <-chan struct{}) { | |||||
| klog.Infof("Starting %s controller", Name) | klog.Infof("Starting %s controller", Name) | ||||
| defer klog.Infof("Shutting down %s controller", Name) | defer klog.Infof("Shutting down %s controller", Name) | ||||
| if !cache.WaitForNamedCacheSync(Name, stopCh, c.podStoreSynced, c.serviceStoreSynced) { | |||||
| if !cache.WaitForNamedCacheSync(Name, stopCh, c.deploymentsSynced, c.serviceStoreSynced) { | |||||
| klog.Errorf("failed to wait for %s caches to sync", Name) | klog.Errorf("failed to wait for %s caches to sync", Name) | ||||
| return | return | ||||
| @@ -114,84 +117,6 @@ func (c *Controller) Run(stopCh <-chan struct{}) { | |||||
| <-stopCh | <-stopCh | ||||
| } | } | ||||
| // enqueueByPod enqueues the JointInferenceService object of the specified pod. | |||||
| func (c *Controller) enqueueByPod(pod *v1.Pod, immediate bool) { | |||||
| controllerRef := metav1.GetControllerOf(pod) | |||||
| if controllerRef == nil { | |||||
| return | |||||
| } | |||||
| if controllerRef.Kind != Kind.Kind { | |||||
| return | |||||
| } | |||||
| service, err := c.serviceLister.JointInferenceServices(pod.Namespace).Get(controllerRef.Name) | |||||
| if err != nil { | |||||
| return | |||||
| } | |||||
| if service.UID != controllerRef.UID { | |||||
| return | |||||
| } | |||||
| c.enqueueController(service, immediate) | |||||
| } | |||||
| // When a pod is created, enqueue the controller that manages it and update it's expectations. | |||||
| func (c *Controller) addPod(obj interface{}) { | |||||
| pod := obj.(*v1.Pod) | |||||
| if pod.DeletionTimestamp != nil { | |||||
| // on a restart of the controller, it's possible a new pod shows up in a state that | |||||
| // is already pending deletion. Prevent the pod from being a creation observation. | |||||
| c.deletePod(pod) | |||||
| return | |||||
| } | |||||
| // backoff to queue when PodFailed | |||||
| immediate := pod.Status.Phase != v1.PodFailed | |||||
| c.enqueueByPod(pod, immediate) | |||||
| } | |||||
| // When a pod is updated, figure out what joint inference service manage it and wake them up. | |||||
| func (c *Controller) updatePod(old, cur interface{}) { | |||||
| curPod := cur.(*v1.Pod) | |||||
| oldPod := old.(*v1.Pod) | |||||
| // no pod update, no queue | |||||
| if curPod.ResourceVersion == oldPod.ResourceVersion { | |||||
| return | |||||
| } | |||||
| c.addPod(curPod) | |||||
| } | |||||
| // deletePod enqueues the JointinferenceService obj When a pod is deleted | |||||
| func (c *Controller) deletePod(obj interface{}) { | |||||
| pod, ok := obj.(*v1.Pod) | |||||
| // comment from https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/job/job_controller.go | |||||
| // When a delete is dropped, the relist will notice a pod in the store not | |||||
| // in the list, leading to the insertion of a tombstone object which contains | |||||
| // the deleted key/value. Note that this value might be stale. If the pod | |||||
| // changed labels the new JointInferenceService will not be woken up till the periodic resync. | |||||
| if !ok { | |||||
| tombstone, ok := obj.(cache.DeletedFinalStateUnknown) | |||||
| if !ok { | |||||
| klog.Warningf("couldn't get object from tombstone %+v", obj) | |||||
| return | |||||
| } | |||||
| pod, ok = tombstone.Obj.(*v1.Pod) | |||||
| if !ok { | |||||
| klog.Warningf("tombstone contained object that is not a pod %+v", obj) | |||||
| return | |||||
| } | |||||
| } | |||||
| c.enqueueByPod(pod, true) | |||||
| } | |||||
| // obj could be an *sednav1.JointInferenceService, or a DeletionFinalStateUnknown marker item, | // obj could be an *sednav1.JointInferenceService, or a DeletionFinalStateUnknown marker item, | ||||
| // immediate tells the controller to update the status right away, and should | // immediate tells the controller to update the status right away, and should | ||||
| // happen ONLY when there was a successful pod run. | // happen ONLY when there was a successful pod run. | ||||
| @@ -252,6 +177,10 @@ func (c *Controller) sync(key string) (bool, error) { | |||||
| if len(ns) == 0 || len(name) == 0 { | if len(ns) == 0 || len(name) == 0 { | ||||
| return false, fmt.Errorf("invalid jointinference service key %q: either namespace or name is missing", key) | return false, fmt.Errorf("invalid jointinference service key %q: either namespace or name is missing", key) | ||||
| } | } | ||||
| // Use Lister to obtain the JointInferenceService object (Lister is a cache reading mechanism). | |||||
| // If the service does not exist (has been deleted), log the message and return true, indicating that this object no longer needs to be synchronized. | |||||
| // If the acquisition fails but not because the object has been deleted, return an error. | |||||
| sharedService, err := c.serviceLister.JointInferenceServices(ns).Get(name) | sharedService, err := c.serviceLister.JointInferenceServices(ns).Get(name) | ||||
| if err != nil { | if err != nil { | ||||
| if errors.IsNotFound(err) { | if errors.IsNotFound(err) { | ||||
| @@ -270,31 +199,31 @@ func (c *Controller) sync(key string) (bool, error) { | |||||
| // set kind for service in case that the kind is None | // set kind for service in case that the kind is None | ||||
| // more details at https://github.com/kubernetes/kubernetes/issues/3030 | // more details at https://github.com/kubernetes/kubernetes/issues/3030 | ||||
| service.SetGroupVersionKind(Kind) | |||||
| service.SetGroupVersionKind(gvk) | |||||
| selector, _ := runtime.GenerateSelector(&service) | |||||
| pods, err := c.podStore.Pods(service.Namespace).List(selector) | |||||
| selectorDeployments, _ := runtime.GenerateSelector(&service) | |||||
| deployments, err := c.deploymentsLister.Deployments(service.Namespace).List(selectorDeployments) | |||||
| if err != nil { | if err != nil { | ||||
| return false, err | return false, err | ||||
| } | } | ||||
| klog.V(4).Infof("list jointinference service %v/%v, %v pods: %v", service.Namespace, service.Name, len(pods), pods) | |||||
| klog.V(4).Infof("list jointinference service %v/%v, %v deployments: %v", service.Namespace, service.Name, len(deployments), deployments) | |||||
| latestConditionLen := len(service.Status.Conditions) | latestConditionLen := len(service.Status.Conditions) | ||||
| active := runtime.CalcActivePodCount(pods) | |||||
| activeDeployments := runtime.CalcActiveDeploymentCount(deployments) | |||||
| var failed int32 = 0 | var failed int32 = 0 | ||||
| // neededCounts means that two pods should be created successfully in a jointinference service currently | |||||
| // two pods consist of edge pod and cloud pod | |||||
| // neededCounts means that two deployments should be created successfully in a jointinference service currently | |||||
| // two deployments consist of edge deployment and cloud deployment | |||||
| var neededCounts int32 = 2 | var neededCounts int32 = 2 | ||||
| if service.Status.StartTime == nil { | if service.Status.StartTime == nil { | ||||
| now := metav1.Now() | now := metav1.Now() | ||||
| service.Status.StartTime = &now | service.Status.StartTime = &now | ||||
| } else { | } else { | ||||
| failed = neededCounts - active | |||||
| failed = neededCounts - activeDeployments | |||||
| } | } | ||||
| var manageServiceErr error | var manageServiceErr error | ||||
| @@ -321,14 +250,14 @@ func (c *Controller) sync(key string) (bool, error) { | |||||
| newCondtionType = sednav1.JointInferenceServiceCondFailed | newCondtionType = sednav1.JointInferenceServiceCondFailed | ||||
| c.recorder.Event(&service, v1.EventTypeWarning, reason, message) | c.recorder.Event(&service, v1.EventTypeWarning, reason, message) | ||||
| } else { | } else { | ||||
| if len(pods) == 0 { | |||||
| active, manageServiceErr = c.createWorkers(&service) | |||||
| if len(deployments) == 0 { | |||||
| activeDeployments, manageServiceErr = c.createWorkers(&service) | |||||
| } | } | ||||
| if manageServiceErr != nil { | if manageServiceErr != nil { | ||||
| serviceFailed = true | serviceFailed = true | ||||
| message = error.Error(manageServiceErr) | message = error.Error(manageServiceErr) | ||||
| newCondtionType = sednav1.JointInferenceServiceCondFailed | newCondtionType = sednav1.JointInferenceServiceCondFailed | ||||
| failed = neededCounts - active | |||||
| failed = neededCounts - activeDeployments | |||||
| } else { | } else { | ||||
| // TODO: handle the case that the pod phase is PodSucceeded | // TODO: handle the case that the pod phase is PodSucceeded | ||||
| newCondtionType = sednav1.JointInferenceServiceCondRunning | newCondtionType = sednav1.JointInferenceServiceCondRunning | ||||
| @@ -342,8 +271,8 @@ func (c *Controller) sync(key string) (bool, error) { | |||||
| forget := false | forget := false | ||||
| // no need to update the jointinferenceservice if the status hasn't changed since last time | // no need to update the jointinferenceservice if the status hasn't changed since last time | ||||
| if service.Status.Active != active || service.Status.Failed != failed || len(service.Status.Conditions) != latestConditionLen { | |||||
| service.Status.Active = active | |||||
| if service.Status.Active != activeDeployments || service.Status.Failed != failed || len(service.Status.Conditions) != latestConditionLen { | |||||
| service.Status.Active = activeDeployments | |||||
| service.Status.Failed = failed | service.Status.Failed = failed | ||||
| if err := c.updateStatus(&service); err != nil { | if err := c.updateStatus(&service); err != nil { | ||||
| @@ -352,7 +281,7 @@ func (c *Controller) sync(key string) (bool, error) { | |||||
| if serviceFailed && !isServiceFinished(&service) { | if serviceFailed && !isServiceFinished(&service) { | ||||
| // returning an error will re-enqueue jointinferenceservice after the backoff period | // returning an error will re-enqueue jointinferenceservice after the backoff period | ||||
| return forget, fmt.Errorf("failed pod(s) detected for jointinference service key %q", key) | |||||
| return forget, fmt.Errorf("failed deployment(s) detected for jointinference service key %q", key) | |||||
| } | } | ||||
| forget = true | forget = true | ||||
| @@ -406,7 +335,7 @@ func (c *Controller) createWorkers(service *sednav1.JointInferenceService) (acti | |||||
| } | } | ||||
| active++ | active++ | ||||
| // create k8s service for cloudPod | |||||
| // create k8s service for cloud deployment | |||||
| bigModelHost, err := runtime.CreateEdgeMeshService(c.kubeClient, service, jointInferenceForCloud, bigModelPort) | bigModelHost, err := runtime.CreateEdgeMeshService(c.kubeClient, service, jointInferenceForCloud, bigModelPort) | ||||
| if err != nil { | if err != nil { | ||||
| return active, err | return active, err | ||||
| @@ -422,75 +351,181 @@ func (c *Controller) createWorkers(service *sednav1.JointInferenceService) (acti | |||||
| return active, err | return active, err | ||||
| } | } | ||||
| func (c *Controller) createCloudWorker(service *sednav1.JointInferenceService, bigModelPort int32) error { | |||||
| // deliver pod for cloudworker | |||||
| cloudModelName := service.Spec.CloudWorker.Model.Name | |||||
| cloudModel, err := c.client.Models(service.Namespace).Get(context.Background(), cloudModelName, metav1.GetOptions{}) | |||||
| // enqueueByDeployment enqueues the JointInferenceService object of the specified deployment. | |||||
| func (c *Controller) enqueueByDeployment(deployment *appsv1.Deployment, immediate bool) { | |||||
| controllerRef := metav1.GetControllerOf(deployment) | |||||
| klog.Infof("Deployment enqueued %v", deployment.Kind) | |||||
| if controllerRef == nil { | |||||
| return | |||||
| } | |||||
| if controllerRef.Kind != gvk.Kind { | |||||
| return | |||||
| } | |||||
| service, err := c.serviceLister.JointInferenceServices(deployment.Namespace).Get(controllerRef.Name) | |||||
| if err != nil { | if err != nil { | ||||
| return fmt.Errorf("failed to get cloud model %s: %w", | |||||
| cloudModelName, err) | |||||
| return | |||||
| } | } | ||||
| var workerParam runtime.WorkerParam | |||||
| if service.UID != controllerRef.UID { | |||||
| return | |||||
| } | |||||
| secretName := cloudModel.Spec.CredentialName | |||||
| var modelSecret *v1.Secret | |||||
| if secretName != "" { | |||||
| modelSecret, _ = c.kubeClient.CoreV1().Secrets(service.Namespace).Get(context.TODO(), secretName, metav1.GetOptions{}) | |||||
| c.enqueueController(service, immediate) | |||||
| } | |||||
| // When a deployment is created, enqueue the controller that manages it and update it's expectations. | |||||
| func (c *Controller) addDeployment(obj interface{}) { | |||||
| deployment := obj.(*appsv1.Deployment) | |||||
| c.enqueueByDeployment(deployment, true) | |||||
| } | |||||
| // When a deployment is updated, figure out what jointinferenceservice manage it and wake them up. | |||||
| func (c *Controller) updateDeployment(old, cur interface{}) { | |||||
| oldD := old.(*appsv1.Deployment) | |||||
| curD := cur.(*appsv1.Deployment) | |||||
| // no deployment update, no queue | |||||
| if curD.ResourceVersion == oldD.ResourceVersion { | |||||
| return | |||||
| } | } | ||||
| workerParam.Mounts = append(workerParam.Mounts, runtime.WorkerMount{ | |||||
| URL: &runtime.MountURL{ | |||||
| URL: cloudModel.Spec.URL, | |||||
| Secret: modelSecret, | |||||
| DownloadByInitializer: true, | |||||
| }, | |||||
| Name: "model", | |||||
| EnvName: "MODEL_URL", | |||||
| }) | |||||
| workerParam.Env = map[string]string{ | |||||
| "NAMESPACE": service.Namespace, | |||||
| "SERVICE_NAME": service.Name, | |||||
| "WORKER_NAME": "cloudworker-" + utilrand.String(5), | |||||
| c.addDeployment(curD) | |||||
| } | |||||
| // deleteDeployment enqueues the jointinferenceservice obj When a deleteDeployment is deleted | |||||
| func (c *Controller) deleteDeployment(obj interface{}) { | |||||
| deployment, ok := obj.(*appsv1.Deployment) | |||||
| "BIG_MODEL_BIND_PORT": strconv.Itoa(int(bigModelPort)), | |||||
| if !ok { | |||||
| tombstone, ok := obj.(cache.DeletedFinalStateUnknown) | |||||
| if !ok { | |||||
| klog.Warningf("couldn't get object from tombstone %+v", obj) | |||||
| return | |||||
| } | |||||
| deployment, ok = tombstone.Obj.(*appsv1.Deployment) | |||||
| if !ok { | |||||
| klog.Warningf("tombstone contained object that is not a Deployment %+v", obj) | |||||
| return | |||||
| } | |||||
| } | } | ||||
| workerParam.WorkerType = jointInferenceForCloud | |||||
| // If the deployment is accidentally deleted, recreate the deployment. | |||||
| newDeployment := deployment.DeepCopy() | |||||
| serviceName := func(input string) string { | |||||
| return strings.Split(input, "-deployment")[0] | |||||
| }(newDeployment.Name) | |||||
| _, err := c.serviceLister.JointInferenceServices(newDeployment.Namespace).Get(serviceName) | |||||
| if !errors.IsNotFound(err) { | |||||
| // Remove unnecessary metadata. | |||||
| newDeployment.ResourceVersion = "" | |||||
| newDeployment.UID = "" | |||||
| // Create a new deployment. | |||||
| _, err := c.kubeClient.AppsV1().Deployments(newDeployment.Namespace).Create(context.TODO(), newDeployment, metav1.CreateOptions{}) | |||||
| if err != nil { | |||||
| klog.Errorf("failed to recreate deployment %s: %v", deployment.Name, err) | |||||
| return | |||||
| } | |||||
| } | |||||
| // create cloud pod | |||||
| _, err = runtime.CreatePodWithTemplate(c.kubeClient, | |||||
| service, | |||||
| &service.Spec.CloudWorker.Template, | |||||
| &workerParam) | |||||
| return err | |||||
| klog.Infof("Successfully recreated deployment %s", deployment.Name) | |||||
| c.enqueueByDeployment(newDeployment, true) | |||||
| } | } | ||||
| func (c *Controller) createEdgeWorker(service *sednav1.JointInferenceService, bigModelHost string, bigModelPort int32) error { | |||||
| // deliver pod for edgeworker | |||||
| ctx := context.Background() | |||||
| edgeModelName := service.Spec.EdgeWorker.Model.Name | |||||
| edgeModel, err := c.client.Models(service.Namespace).Get(ctx, edgeModelName, metav1.GetOptions{}) | |||||
| func (c *Controller) updateInferenceServices(old, cur interface{}) error { | |||||
| oldService := old.(*sednav1.JointInferenceService) | |||||
| newService := cur.(*sednav1.JointInferenceService) | |||||
| // Check if the cloud worker configuration has changed | |||||
| if !reflect.DeepEqual(oldService.Spec.CloudWorker, newService.Spec.CloudWorker) { | |||||
| // Update cloud worker and log any errors | |||||
| if err := c.updateCloudWorker(newService); err != nil { | |||||
| klog.Errorf("Failed to update cloud worker for service %s/%s: %v", newService.Namespace, newService.Name, err) | |||||
| } | |||||
| } | |||||
| // Retrieve the address of the cloud inference service | |||||
| var bigModelHost string | |||||
| svc, err := c.kubeClient.CoreV1().Services(oldService.Namespace).Get(context.Background(), | |||||
| strings.ToLower(oldService.Name+"-"+jointInferenceForCloud), metav1.GetOptions{}) | |||||
| if err != nil { | if err != nil { | ||||
| return fmt.Errorf("failed to get edge model %s: %w", | |||||
| edgeModelName, err) | |||||
| if errors.IsNotFound(err) { | |||||
| // If the service does not exist, create a new one and retrieve its address | |||||
| klog.Info("Cloud service not found, creating new service...") | |||||
| bigModelHost, err = runtime.CreateEdgeMeshService(c.kubeClient, oldService, jointInferenceForCloud, BigModelPort) | |||||
| if err != nil { | |||||
| klog.Errorf("Failed to create EdgeMesh service for service %s/%s: %v", oldService.Namespace, oldService.Name, err) | |||||
| } | |||||
| } else { | |||||
| klog.Errorf("Failed to get cloud service %s/%s: %v", oldService.Namespace, oldService.Name, err) | |||||
| } | |||||
| } else { | |||||
| bigModelHost = fmt.Sprintf("%s.%s", svc.Name, svc.Namespace) | |||||
| } | } | ||||
| secretName := edgeModel.Spec.CredentialName | |||||
| var modelSecret *v1.Secret | |||||
| if secretName != "" { | |||||
| modelSecret, _ = c.kubeClient.CoreV1().Secrets(service.Namespace).Get(context.TODO(), secretName, metav1.GetOptions{}) | |||||
| // Check if the edge worker configuration has changed | |||||
| if !reflect.DeepEqual(oldService.Spec.EdgeWorker, newService.Spec.EdgeWorker) { | |||||
| // Update edge worker and log any errors | |||||
| if err := c.updateEdgeWorker(newService, bigModelHost); err != nil { | |||||
| klog.Errorf("Failed to update edge worker for service %s/%s: %v", newService.Namespace, newService.Name, err) | |||||
| } | |||||
| } | } | ||||
| edgeWorker := service.Spec.EdgeWorker | |||||
| HEMParameterJSON, _ := json.Marshal(edgeWorker.HardExampleMining.Parameters) | |||||
| HEMParameterString := string(HEMParameterJSON) | |||||
| return nil | |||||
| } | |||||
| func (c *Controller) createOrUpdateWorker(service *sednav1.JointInferenceService, workerType string, bigModelHost string, bigModelPort int32, create bool) error { | |||||
| var modelName string | |||||
| var modelTemplate v1.PodTemplateSpec | |||||
| var workerParam runtime.WorkerParam | var workerParam runtime.WorkerParam | ||||
| // Set the corresponding parameters according to the workerType. | |||||
| switch workerType { | |||||
| case jointInferenceForCloud: | |||||
| modelName = service.Spec.CloudWorker.Model.Name | |||||
| modelTemplate = *service.Spec.CloudWorker.Template.DeepCopy() | |||||
| workerParam.Env = map[string]string{ | |||||
| "BIG_MODEL_BIND_PORT": strconv.Itoa(int(bigModelPort)), | |||||
| } | |||||
| workerParam.WorkerType = workerType | |||||
| case jointInferenceForEdge: | |||||
| modelName = service.Spec.EdgeWorker.Model.Name | |||||
| modelTemplate = *service.Spec.EdgeWorker.Template.DeepCopy() | |||||
| HEMParameterJSON, _ := json.Marshal(service.Spec.EdgeWorker.HardExampleMining.Parameters) | |||||
| HEMParameterString := string(HEMParameterJSON) | |||||
| workerParam.Env = map[string]string{ | |||||
| "BIG_MODEL_IP": bigModelHost, | |||||
| "BIG_MODEL_PORT": strconv.Itoa(int(bigModelPort)), | |||||
| "HEM_NAME": service.Spec.EdgeWorker.HardExampleMining.Name, | |||||
| "HEM_PARAMETERS": HEMParameterString, | |||||
| "LC_SERVER": c.cfg.LC.Server, | |||||
| } | |||||
| workerParam.WorkerType = workerType | |||||
| } | |||||
| // get the model. | |||||
| model, err := c.client.Models(service.Namespace).Get(context.Background(), modelName, metav1.GetOptions{}) | |||||
| if err != nil { | |||||
| return fmt.Errorf("failed to get model %s: %w", modelName, err) | |||||
| } | |||||
| secretName := model.Spec.CredentialName | |||||
| var modelSecret *v1.Secret | |||||
| if secretName != "" { | |||||
| modelSecret, _ = c.kubeClient.CoreV1().Secrets(service.Namespace).Get(context.TODO(), secretName, metav1.GetOptions{}) | |||||
| } | |||||
| // Fill in the mounting configuration of workerParam. | |||||
| workerParam.Mounts = append(workerParam.Mounts, runtime.WorkerMount{ | workerParam.Mounts = append(workerParam.Mounts, runtime.WorkerMount{ | ||||
| URL: &runtime.MountURL{ | URL: &runtime.MountURL{ | ||||
| URL: edgeModel.Spec.URL, | |||||
| URL: model.Spec.URL, | |||||
| Secret: modelSecret, | Secret: modelSecret, | ||||
| DownloadByInitializer: true, | DownloadByInitializer: true, | ||||
| }, | }, | ||||
| @@ -498,37 +533,50 @@ func (c *Controller) createEdgeWorker(service *sednav1.JointInferenceService, bi | |||||
| EnvName: "MODEL_URL", | EnvName: "MODEL_URL", | ||||
| }) | }) | ||||
| workerParam.Env = map[string]string{ | |||||
| "NAMESPACE": service.Namespace, | |||||
| "SERVICE_NAME": service.Name, | |||||
| "WORKER_NAME": "edgeworker-" + utilrand.String(5), | |||||
| // Set other common environment variables. | |||||
| workerParam.Env["NAMESPACE"] = service.Namespace | |||||
| workerParam.Env["SERVICE_NAME"] = service.Name | |||||
| workerParam.Env["WORKER_NAME"] = strings.ToLower(workerType) + "worker-" + utilrand.String(5) | |||||
| "BIG_MODEL_IP": bigModelHost, | |||||
| "BIG_MODEL_PORT": strconv.Itoa(int(bigModelPort)), | |||||
| // Create or update Deployment. | |||||
| if create { | |||||
| _, err = runtime.CreateDeploymentWithTemplate(c.kubeClient, service, &appsv1.DeploymentSpec{Template: modelTemplate}, &workerParam) | |||||
| } else { | |||||
| service.SetGroupVersionKind(gvk) | |||||
| workerName := service.Name + "-deployment-" + strings.ToLower(workerType) | |||||
| existingDeployment, err := c.deploymentsLister.Deployments(service.Namespace).Get(workerName) | |||||
| if err != nil { | |||||
| return fmt.Errorf("get %s Deployment failed:%v", strings.ToLower(workerType), err) | |||||
| } | |||||
| newDeployment := existingDeployment.DeepCopy() | |||||
| newDeployment.Spec.Template = modelTemplate | |||||
| _, err = runtime.UpdateDeploymentWithTemplate(c.kubeClient, service, newDeployment, &workerParam) | |||||
| } | |||||
| return err | |||||
| } | |||||
| "HEM_NAME": edgeWorker.HardExampleMining.Name, | |||||
| "HEM_PARAMETERS": HEMParameterString, | |||||
| func (c *Controller) createCloudWorker(service *sednav1.JointInferenceService, bigModelPort int32) error { | |||||
| return c.createOrUpdateWorker(service, jointInferenceForCloud, "", bigModelPort, true) | |||||
| } | |||||
| "LC_SERVER": c.cfg.LC.Server, | |||||
| } | |||||
| func (c *Controller) createEdgeWorker(service *sednav1.JointInferenceService, bigModelHost string, bigModelPort int32) error { | |||||
| return c.createOrUpdateWorker(service, jointInferenceForEdge, bigModelHost, bigModelPort, true) | |||||
| } | |||||
| workerParam.WorkerType = jointInferenceForEdge | |||||
| workerParam.HostNetwork = true | |||||
| func (c *Controller) updateCloudWorker(newservice *sednav1.JointInferenceService) error { | |||||
| return c.createOrUpdateWorker(newservice, jointInferenceForCloud, "", BigModelPort, false) | |||||
| } | |||||
| // create edge pod | |||||
| _, err = runtime.CreatePodWithTemplate(c.kubeClient, | |||||
| service, | |||||
| &service.Spec.EdgeWorker.Template, | |||||
| &workerParam) | |||||
| return err | |||||
| func (c *Controller) updateEdgeWorker(newservice *sednav1.JointInferenceService, bigModelHost string) error { | |||||
| return c.createOrUpdateWorker(newservice, jointInferenceForEdge, bigModelHost, BigModelPort, false) | |||||
| } | } | ||||
| // New creates a new JointInferenceService controller that keeps the relevant pods | |||||
| // New creates a new JointInferenceService controller that keeps the relevant deployments | |||||
| // in sync with their corresponding JointInferenceService objects. | // in sync with their corresponding JointInferenceService objects. | ||||
| func New(cc *runtime.ControllerContext) (runtime.FeatureControllerI, error) { | func New(cc *runtime.ControllerContext) (runtime.FeatureControllerI, error) { | ||||
| cfg := cc.Config | cfg := cc.Config | ||||
| podInformer := cc.KubeInformerFactory.Core().V1().Pods() | |||||
| deploymentInformer := cc.KubeInformerFactory.Apps().V1().Deployments() | |||||
| serviceInformer := cc.SednaInformerFactory.Sedna().V1alpha1().JointInferenceServices() | serviceInformer := cc.SednaInformerFactory.Sedna().V1alpha1().JointInferenceServices() | ||||
| @@ -552,7 +600,8 @@ func New(cc *runtime.ControllerContext) (runtime.FeatureControllerI, error) { | |||||
| UpdateFunc: func(old, cur interface{}) { | UpdateFunc: func(old, cur interface{}) { | ||||
| jc.enqueueController(cur, true) | jc.enqueueController(cur, true) | ||||
| jc.syncToEdge(watch.Added, cur) | |||||
| jc.updateInferenceServices(old, cur) | |||||
| jc.syncToEdge(watch.Modified, cur) | |||||
| }, | }, | ||||
| DeleteFunc: func(obj interface{}) { | DeleteFunc: func(obj interface{}) { | ||||
| @@ -564,14 +613,13 @@ func New(cc *runtime.ControllerContext) (runtime.FeatureControllerI, error) { | |||||
| jc.serviceLister = serviceInformer.Lister() | jc.serviceLister = serviceInformer.Lister() | ||||
| jc.serviceStoreSynced = serviceInformer.Informer().HasSynced | jc.serviceStoreSynced = serviceInformer.Informer().HasSynced | ||||
| podInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ | |||||
| AddFunc: jc.addPod, | |||||
| UpdateFunc: jc.updatePod, | |||||
| DeleteFunc: jc.deletePod, | |||||
| deploymentInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ | |||||
| AddFunc: jc.addDeployment, | |||||
| UpdateFunc: jc.updateDeployment, | |||||
| DeleteFunc: jc.deleteDeployment, | |||||
| }) | }) | ||||
| jc.podStore = podInformer.Lister() | |||||
| jc.podStoreSynced = podInformer.Informer().HasSynced | |||||
| jc.deploymentsLister = deploymentInformer.Lister() | |||||
| jc.deploymentsSynced = deploymentInformer.Informer().HasSynced | |||||
| return jc, nil | return jc, nil | ||||
| } | } | ||||
| @@ -0,0 +1,308 @@ | |||||
| package jointinference | |||||
| import ( | |||||
| "context" | |||||
| "testing" | |||||
| appsv1 "k8s.io/api/apps/v1" | |||||
| v1 "k8s.io/api/core/v1" | |||||
| k8serrors "k8s.io/apimachinery/pkg/api/errors" | |||||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| "k8s.io/apimachinery/pkg/labels" | |||||
| "k8s.io/apimachinery/pkg/watch" | |||||
| kubernetesfake "k8s.io/client-go/kubernetes/fake" | |||||
| "k8s.io/client-go/kubernetes/scheme" | |||||
| v1core "k8s.io/client-go/kubernetes/typed/core/v1" | |||||
| corelisters "k8s.io/client-go/listers/apps/v1" | |||||
| corelistersv1 "k8s.io/client-go/listers/core/v1" | |||||
| "k8s.io/client-go/tools/record" | |||||
| "k8s.io/client-go/util/workqueue" | |||||
| sednav1 "github.com/kubeedge/sedna/pkg/apis/sedna/v1alpha1" | |||||
| fakeseednaclientset "github.com/kubeedge/sedna/pkg/client/clientset/versioned/fake" | |||||
| "github.com/kubeedge/sedna/pkg/globalmanager/config" | |||||
| "github.com/kubeedge/sedna/pkg/globalmanager/runtime" | |||||
| ) | |||||
| type mockPodLister struct { | |||||
| pods []*v1.Pod | |||||
| } | |||||
| type mockPodNamespaceLister struct { | |||||
| pods []*v1.Pod | |||||
| namespace string | |||||
| } | |||||
| func (m *mockPodLister) Pods(namespace string) corelistersv1.PodNamespaceLister { | |||||
| return mockPodNamespaceLister{pods: m.pods, namespace: namespace} | |||||
| } | |||||
| func (m *mockPodLister) List(selector labels.Selector) (ret []*v1.Pod, err error) { | |||||
| return m.pods, nil | |||||
| } | |||||
| func (m mockPodNamespaceLister) List(selector labels.Selector) ([]*v1.Pod, error) { | |||||
| var filteredPods []*v1.Pod | |||||
| for _, pod := range m.pods { | |||||
| if pod.Namespace == m.namespace { | |||||
| filteredPods = append(filteredPods, pod) | |||||
| } | |||||
| } | |||||
| return filteredPods, nil | |||||
| } | |||||
| type mockDeploymentLister struct { | |||||
| deployments []*appsv1.Deployment | |||||
| } | |||||
| func (m *mockDeploymentLister) List(selector labels.Selector) (ret []*appsv1.Deployment, err error) { | |||||
| return m.deployments, nil | |||||
| } | |||||
| func (m *mockDeploymentLister) Deployments(namespace string) corelisters.DeploymentNamespaceLister { | |||||
| return mockDeploymentNamespaceLister{deployments: m.deployments, namespace: namespace} | |||||
| } | |||||
| func (m mockPodNamespaceLister) Get(name string) (*v1.Pod, error) { | |||||
| for _, pod := range m.pods { | |||||
| if pod.Namespace == m.namespace && pod.Name == name { | |||||
| return pod, nil | |||||
| } | |||||
| } | |||||
| return nil, k8serrors.NewNotFound(v1.Resource("pod"), name) | |||||
| } | |||||
| type mockDeploymentNamespaceLister struct { | |||||
| deployments []*appsv1.Deployment | |||||
| namespace string | |||||
| } | |||||
| func (m mockDeploymentNamespaceLister) List(selector labels.Selector) ([]*appsv1.Deployment, error) { | |||||
| var filteredDeployments []*appsv1.Deployment | |||||
| for _, deployment := range m.deployments { | |||||
| if deployment.Namespace == m.namespace { | |||||
| filteredDeployments = append(filteredDeployments, deployment) | |||||
| } | |||||
| } | |||||
| return filteredDeployments, nil | |||||
| } | |||||
| func (m mockDeploymentNamespaceLister) Get(name string) (*appsv1.Deployment, error) { | |||||
| for _, deployment := range m.deployments { | |||||
| if deployment.Namespace == m.namespace && deployment.Name == name { | |||||
| return deployment, nil | |||||
| } | |||||
| } | |||||
| return nil, k8serrors.NewNotFound(v1.Resource("deployment"), name) | |||||
| } | |||||
| func Test_updateService(t *testing.T) { | |||||
| t.Run("update joint inference service successfully", func(t *testing.T) { | |||||
| // Create fake clients | |||||
| fakeSednaClient := fakeseednaclientset.NewSimpleClientset() | |||||
| fakeKubeClient := kubernetesfake.NewSimpleClientset() | |||||
| // Create a test joint inference service | |||||
| oldService := &sednav1.JointInferenceService{ | |||||
| ObjectMeta: metav1.ObjectMeta{ | |||||
| Name: "test-ji-service", | |||||
| Namespace: "default", | |||||
| Generation: 1, | |||||
| ResourceVersion: "1", | |||||
| }, | |||||
| Spec: sednav1.JointInferenceServiceSpec{ | |||||
| EdgeWorker: sednav1.EdgeWorker{ | |||||
| Model: sednav1.SmallModel{ | |||||
| Name: "test-edge-model", | |||||
| }, | |||||
| Template: v1.PodTemplateSpec{ | |||||
| Spec: v1.PodSpec{ | |||||
| Containers: []v1.Container{ | |||||
| { | |||||
| Name: "edge-container", | |||||
| Image: "edge-image:v1", | |||||
| }, | |||||
| }, | |||||
| }, | |||||
| }, | |||||
| HardExampleMining: sednav1.HardExampleMining{ | |||||
| Name: "test-hem", | |||||
| Parameters: []sednav1.ParaSpec{ | |||||
| { | |||||
| Key: "param1", | |||||
| Value: "value1", | |||||
| }, | |||||
| }, | |||||
| }, | |||||
| }, | |||||
| CloudWorker: sednav1.CloudWorker{ | |||||
| Model: sednav1.BigModel{ | |||||
| Name: "test-cloud-model", | |||||
| }, | |||||
| Template: v1.PodTemplateSpec{ | |||||
| Spec: v1.PodSpec{ | |||||
| Containers: []v1.Container{ | |||||
| { | |||||
| Name: "cloud-container", | |||||
| Image: "cloud-image:v1", | |||||
| }, | |||||
| }, | |||||
| }, | |||||
| }, | |||||
| }, | |||||
| }, | |||||
| } | |||||
| //Create Big Model Resource Object for Cloud | |||||
| bigModel := &sednav1.Model{ | |||||
| ObjectMeta: metav1.ObjectMeta{ | |||||
| Name: "test-cloud-model", | |||||
| Namespace: "default", | |||||
| }, | |||||
| } | |||||
| _, err := fakeSednaClient.SednaV1alpha1().Models("default").Create(context.TODO(), bigModel, metav1.CreateOptions{}) | |||||
| if err != nil { | |||||
| t.Fatalf("Failed to create test big model: %v", err) | |||||
| } | |||||
| // Create Small Model Resource Object for Edge | |||||
| smallModel := &sednav1.Model{ | |||||
| ObjectMeta: metav1.ObjectMeta{ | |||||
| Name: "test-edge-model", | |||||
| Namespace: "default", | |||||
| }, | |||||
| } | |||||
| _, err = fakeSednaClient.SednaV1alpha1().Models("default").Create(context.TODO(), smallModel, metav1.CreateOptions{}) | |||||
| if err != nil { | |||||
| t.Fatalf("Failed to create test small model: %v", err) | |||||
| } | |||||
| // Create the service using the fake client | |||||
| _, err = fakeSednaClient.SednaV1alpha1().JointInferenceServices("default").Create(context.TODO(), oldService, metav1.CreateOptions{}) | |||||
| if err != nil { | |||||
| t.Fatalf("Failed to create test service: %v", err) | |||||
| } | |||||
| // Create test deployments | |||||
| edgeDeployment := &appsv1.Deployment{ | |||||
| ObjectMeta: metav1.ObjectMeta{ | |||||
| Name: "test-ji-deployment-edge", | |||||
| Namespace: "default", | |||||
| }, | |||||
| Spec: appsv1.DeploymentSpec{ | |||||
| Template: oldService.Spec.EdgeWorker.Template, | |||||
| }, | |||||
| } | |||||
| cloudDeployment := &appsv1.Deployment{ | |||||
| ObjectMeta: metav1.ObjectMeta{ | |||||
| Name: "test-ji-deployment-cloud", | |||||
| Namespace: "default", | |||||
| }, | |||||
| Spec: appsv1.DeploymentSpec{ | |||||
| Template: oldService.Spec.CloudWorker.Template, | |||||
| }, | |||||
| } | |||||
| _, err = fakeKubeClient.AppsV1().Deployments("default").Create(context.TODO(), edgeDeployment, metav1.CreateOptions{}) | |||||
| if err != nil { | |||||
| t.Fatalf("Failed to create edge deployment: %v", err) | |||||
| } | |||||
| _, err = fakeKubeClient.AppsV1().Deployments("default").Create(context.TODO(), cloudDeployment, metav1.CreateOptions{}) | |||||
| if err != nil { | |||||
| t.Fatalf("Failed to create cloud deployment: %v", err) | |||||
| } | |||||
| // Manually create pods for the deployments | |||||
| edgePod := &v1.Pod{ | |||||
| ObjectMeta: metav1.ObjectMeta{ | |||||
| Name: "test-ji-service-edge-pod", | |||||
| Namespace: "default", | |||||
| Labels: map[string]string{ | |||||
| "jointinferenceservice.sedna.io/service-name": "test-ji-service", | |||||
| }, | |||||
| OwnerReferences: []metav1.OwnerReference{ | |||||
| { | |||||
| APIVersion: "apps/v1", | |||||
| Kind: "Deployment", | |||||
| Name: edgeDeployment.Name, | |||||
| UID: edgeDeployment.UID, | |||||
| }, | |||||
| }, | |||||
| }, | |||||
| Spec: edgeDeployment.Spec.Template.Spec, | |||||
| } | |||||
| cloudPod := &v1.Pod{ | |||||
| ObjectMeta: metav1.ObjectMeta{ | |||||
| Name: "test-ji-service-cloud-pod", | |||||
| Namespace: "default", | |||||
| Labels: map[string]string{ | |||||
| "jointinferenceservice.sedna.io/service-name": "test-ji-service", | |||||
| }, | |||||
| OwnerReferences: []metav1.OwnerReference{ | |||||
| { | |||||
| APIVersion: "apps/v1", | |||||
| Kind: "Deployment", | |||||
| Name: cloudDeployment.Name, | |||||
| UID: cloudDeployment.UID, | |||||
| }, | |||||
| }, | |||||
| }, | |||||
| Spec: cloudDeployment.Spec.Template.Spec, | |||||
| } | |||||
| // Add pods to the fake client | |||||
| _, err = fakeKubeClient.CoreV1().Pods("default").Create(context.TODO(), edgePod, metav1.CreateOptions{}) | |||||
| if err != nil { | |||||
| t.Fatalf("Failed to create edge pod: %v", err) | |||||
| } | |||||
| _, err = fakeKubeClient.CoreV1().Pods("default").Create(context.TODO(), cloudPod, metav1.CreateOptions{}) | |||||
| if err != nil { | |||||
| t.Fatalf("Failed to create cloud pod: %v", err) | |||||
| } | |||||
| cfg := &config.ControllerConfig{ | |||||
| LC: config.LCConfig{ | |||||
| Server: "http://test-lc-server:8080", | |||||
| }, | |||||
| } | |||||
| eventBroadcaster := record.NewBroadcaster() | |||||
| eventBroadcaster.StartRecordingToSink(&v1core.EventSinkImpl{Interface: fakeKubeClient.CoreV1().Events("")}) | |||||
| // Create a controller with the fake clients | |||||
| c := &Controller{ | |||||
| kubeClient: fakeKubeClient, | |||||
| client: fakeSednaClient.SednaV1alpha1(), | |||||
| queue: workqueue.NewNamedRateLimitingQueue(workqueue.NewItemExponentialFailureRateLimiter(runtime.DefaultBackOff, runtime.MaxBackOff), "test-ji-service"), | |||||
| recorder: eventBroadcaster.NewRecorder(scheme.Scheme, v1.EventSource{Component: "test-ji-service"}), | |||||
| cfg: cfg, | |||||
| deploymentsLister: &mockDeploymentLister{deployments: []*appsv1.Deployment{edgeDeployment, cloudDeployment}}, | |||||
| sendToEdgeFunc: func(nodeName string, eventType watch.EventType, job interface{}) error { | |||||
| return nil | |||||
| }, | |||||
| } | |||||
| // Update the service | |||||
| newService := oldService.DeepCopy() | |||||
| // change parameter of hard example mining | |||||
| newService.Spec.EdgeWorker.HardExampleMining.Parameters[0].Value = "value2" | |||||
| newService.Generation = 2 | |||||
| newService.ResourceVersion = "2" | |||||
| // Call updateService function | |||||
| c.createOrUpdateWorker(newService, jointInferenceForCloud, "test-ji-service.default", 8080, true) | |||||
| c.createOrUpdateWorker(newService, jointInferenceForEdge, "test-ji-service.default", 8080, true) | |||||
| // update service in fakeSednaClient | |||||
| _, err = fakeSednaClient.SednaV1alpha1().JointInferenceServices("default").Update(context.TODO(), newService, metav1.UpdateOptions{}) | |||||
| if err != nil { | |||||
| t.Fatalf("Failed to update service: %v", err) | |||||
| } | |||||
| // Verify that the services were deleted and recreated | |||||
| updatedService, err := fakeSednaClient.SednaV1alpha1().JointInferenceServices("default").Get(context.TODO(), "test-ji-service", metav1.GetOptions{}) | |||||
| if err != nil { | |||||
| t.Fatalf("Failed to get updated deployment: %v", err) | |||||
| } | |||||
| if updatedService.Spec.EdgeWorker.HardExampleMining.Parameters[0].Value != "value2" { | |||||
| t.Fatalf("Service was not updated correctly") | |||||
| } | |||||
| }) | |||||
| } | |||||
| @@ -501,7 +501,7 @@ func (c *Controller) createWorkers(service *sednav1.ObjectSearchService) (active | |||||
| // create reid worker deployment | // create reid worker deployment | ||||
| var reidWorkerParam runtime.WorkerParam | var reidWorkerParam runtime.WorkerParam | ||||
| reidWorkerParam.WorkerType = objectSearchReidWorker | reidWorkerParam.WorkerType = objectSearchReidWorker | ||||
| _, err = runtime.CreateDeploymentWithTemplate(c.kubeClient, service, &service.Spec.ReidWorkers.DeploymentSpec, &reidWorkerParam, reidServicePort) | |||||
| _, err = runtime.CreateDeploymentWithTemplate(c.kubeClient, service, &service.Spec.ReidWorkers.DeploymentSpec, &reidWorkerParam) | |||||
| if err != nil { | if err != nil { | ||||
| return activePods, activeDeployments, fmt.Errorf("failed to create reid worker deployment: %w", err) | return activePods, activeDeployments, fmt.Errorf("failed to create reid worker deployment: %w", err) | ||||
| } | } | ||||
| @@ -528,7 +528,7 @@ func (c *Controller) createWorkers(service *sednav1.ObjectSearchService) (active | |||||
| "SERVICE_NAME": service.Name, | "SERVICE_NAME": service.Name, | ||||
| "WORKER_NAME": "userworker-" + utilrand.String(5), | "WORKER_NAME": "userworker-" + utilrand.String(5), | ||||
| } | } | ||||
| _, err = runtime.CreateDeploymentWithTemplate(c.kubeClient, service, userWorkerDeployment, &userWorkerParam, userWorkerPort) | |||||
| _, err = runtime.CreateDeploymentWithTemplate(c.kubeClient, service, userWorkerDeployment, &userWorkerParam) | |||||
| if err != nil { | if err != nil { | ||||
| return activePods, activeDeployments, fmt.Errorf("failed to create user worker: %w", err) | return activePods, activeDeployments, fmt.Errorf("failed to create user worker: %w", err) | ||||
| @@ -212,8 +212,7 @@ func CreateEdgeMeshService(kubeClient kubernetes.Interface, object CommonInterfa | |||||
| { | { | ||||
| // TODO: be clean, Port.Name is currently required by edgemesh(v1.8.0). | // TODO: be clean, Port.Name is currently required by edgemesh(v1.8.0). | ||||
| // and should be <protocol>-<suffix> | // and should be <protocol>-<suffix> | ||||
| Name: "tcp-0", | |||||
| Name: "tcp-0", | |||||
| Protocol: "TCP", | Protocol: "TCP", | ||||
| Port: servicePort, | Port: servicePort, | ||||
| TargetPort: targetPort, | TargetPort: targetPort, | ||||
| @@ -232,12 +231,12 @@ func CreateEdgeMeshService(kubeClient kubernetes.Interface, object CommonInterfa | |||||
| } | } | ||||
| // CreateDeploymentWithTemplate creates and returns a deployment object given a crd object, deployment template | // CreateDeploymentWithTemplate creates and returns a deployment object given a crd object, deployment template | ||||
| func CreateDeploymentWithTemplate(client kubernetes.Interface, object CommonInterface, spec *appsv1.DeploymentSpec, workerParam *WorkerParam, port int32) (*appsv1.Deployment, error) { | |||||
| func CreateDeploymentWithTemplate(client kubernetes.Interface, object CommonInterface, spec *appsv1.DeploymentSpec, workerParam *WorkerParam) (*appsv1.Deployment, error) { | |||||
| objectKind := object.GroupVersionKind() | objectKind := object.GroupVersionKind() | ||||
| objectName := object.GetNamespace() + "/" + object.GetName() | objectName := object.GetNamespace() + "/" + object.GetName() | ||||
| deployment := newDeployment(object, spec, workerParam) | deployment := newDeployment(object, spec, workerParam) | ||||
| injectDeploymentParam(deployment, workerParam, object, port) | |||||
| injectDeploymentParam(deployment, workerParam, object) | |||||
| createdDeployment, err := client.AppsV1().Deployments(object.GetNamespace()).Create(context.TODO(), deployment, metav1.CreateOptions{}) | createdDeployment, err := client.AppsV1().Deployments(object.GetNamespace()).Create(context.TODO(), deployment, metav1.CreateOptions{}) | ||||
| if err != nil { | if err != nil { | ||||
| @@ -248,14 +247,33 @@ func CreateDeploymentWithTemplate(client kubernetes.Interface, object CommonInte | |||||
| return createdDeployment, nil | return createdDeployment, nil | ||||
| } | } | ||||
| // UpdateDeploymentWithTemplate updates an existing deployment object given a crd object, deployment template, and worker parameters | |||||
| func UpdateDeploymentWithTemplate(client kubernetes.Interface, object CommonInterface, newDeployment *appsv1.Deployment, workerParam *WorkerParam) (*appsv1.Deployment, error) { | |||||
| objectKind := object.GroupVersionKind() | |||||
| objectName := object.GetNamespace() + "/" + object.GetName() | |||||
| // Inject worker parameters. | |||||
| injectDeploymentParam(newDeployment, workerParam, object) | |||||
| // Call the Kubernetes API to perform the update. | |||||
| updatedDeployment, err := client.AppsV1().Deployments(newDeployment.Namespace).Update(context.TODO(), newDeployment, metav1.UpdateOptions{}) | |||||
| if err != nil { | |||||
| klog.Warningf("failed to update deployment for %s %s, err: %s", objectKind, objectName, err) | |||||
| return nil, fmt.Errorf("failed to update deployment: %w", err) | |||||
| } | |||||
| klog.V(2).Infof("deployment %s is updated successfully for %s %s", updatedDeployment.Name, objectKind, objectName) | |||||
| return updatedDeployment, nil | |||||
| } | |||||
| func newDeployment(object CommonInterface, spec *appsv1.DeploymentSpec, workerParam *WorkerParam) *appsv1.Deployment { | func newDeployment(object CommonInterface, spec *appsv1.DeploymentSpec, workerParam *WorkerParam) *appsv1.Deployment { | ||||
| nameSpace := object.GetNamespace() | nameSpace := object.GetNamespace() | ||||
| deploymentName := object.GetName() + "-" + "deployment" + "-" + strings.ToLower(workerParam.WorkerType) + "-" | |||||
| deploymentName := object.GetName() + "-" + "deployment" + "-" + strings.ToLower(workerParam.WorkerType) | |||||
| matchLabel := make(map[string]string) | matchLabel := make(map[string]string) | ||||
| return &appsv1.Deployment{ | return &appsv1.Deployment{ | ||||
| ObjectMeta: metav1.ObjectMeta{ | ObjectMeta: metav1.ObjectMeta{ | ||||
| GenerateName: deploymentName, | |||||
| Namespace: nameSpace, | |||||
| Name: deploymentName, | |||||
| Namespace: nameSpace, | |||||
| OwnerReferences: []metav1.OwnerReference{ | OwnerReferences: []metav1.OwnerReference{ | ||||
| *metav1.NewControllerRef(object, object.GroupVersionKind()), | *metav1.NewControllerRef(object, object.GroupVersionKind()), | ||||
| }, | }, | ||||
| @@ -271,7 +289,7 @@ func newDeployment(object CommonInterface, spec *appsv1.DeploymentSpec, workerPa | |||||
| } | } | ||||
| // injectDeploymentParam modifies deployment in-place | // injectDeploymentParam modifies deployment in-place | ||||
| func injectDeploymentParam(deployment *appsv1.Deployment, workerParam *WorkerParam, object CommonInterface, _port int32) { | |||||
| func injectDeploymentParam(deployment *appsv1.Deployment, workerParam *WorkerParam, object CommonInterface) { | |||||
| var appLabelKey = "app.sedna.io" | var appLabelKey = "app.sedna.io" | ||||
| var appLabelValue = object.GetName() + "-" + workerParam.WorkerType + "-" + "svc" | var appLabelValue = object.GetName() + "-" + workerParam.WorkerType + "-" + "svc" | ||||
| @@ -0,0 +1,376 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "k8s.io/apimachinery/pkg/runtime" | |||||
| "k8s.io/apimachinery/pkg/watch" | |||||
| "k8s.io/client-go/discovery" | |||||
| fakediscovery "k8s.io/client-go/discovery/fake" | |||||
| clientset "k8s.io/client-go/kubernetes" | |||||
| admissionregistrationv1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1" | |||||
| fakeadmissionregistrationv1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake" | |||||
| admissionregistrationv1beta1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1" | |||||
| fakeadmissionregistrationv1beta1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake" | |||||
| internalv1alpha1 "k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1" | |||||
| fakeinternalv1alpha1 "k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1/fake" | |||||
| appsv1 "k8s.io/client-go/kubernetes/typed/apps/v1" | |||||
| fakeappsv1 "k8s.io/client-go/kubernetes/typed/apps/v1/fake" | |||||
| appsv1beta1 "k8s.io/client-go/kubernetes/typed/apps/v1beta1" | |||||
| fakeappsv1beta1 "k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake" | |||||
| appsv1beta2 "k8s.io/client-go/kubernetes/typed/apps/v1beta2" | |||||
| fakeappsv1beta2 "k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake" | |||||
| authenticationv1 "k8s.io/client-go/kubernetes/typed/authentication/v1" | |||||
| fakeauthenticationv1 "k8s.io/client-go/kubernetes/typed/authentication/v1/fake" | |||||
| authenticationv1beta1 "k8s.io/client-go/kubernetes/typed/authentication/v1beta1" | |||||
| fakeauthenticationv1beta1 "k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake" | |||||
| authorizationv1 "k8s.io/client-go/kubernetes/typed/authorization/v1" | |||||
| fakeauthorizationv1 "k8s.io/client-go/kubernetes/typed/authorization/v1/fake" | |||||
| authorizationv1beta1 "k8s.io/client-go/kubernetes/typed/authorization/v1beta1" | |||||
| fakeauthorizationv1beta1 "k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake" | |||||
| autoscalingv1 "k8s.io/client-go/kubernetes/typed/autoscaling/v1" | |||||
| fakeautoscalingv1 "k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake" | |||||
| autoscalingv2beta1 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1" | |||||
| fakeautoscalingv2beta1 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake" | |||||
| autoscalingv2beta2 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2" | |||||
| fakeautoscalingv2beta2 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake" | |||||
| batchv1 "k8s.io/client-go/kubernetes/typed/batch/v1" | |||||
| fakebatchv1 "k8s.io/client-go/kubernetes/typed/batch/v1/fake" | |||||
| batchv1beta1 "k8s.io/client-go/kubernetes/typed/batch/v1beta1" | |||||
| fakebatchv1beta1 "k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake" | |||||
| certificatesv1 "k8s.io/client-go/kubernetes/typed/certificates/v1" | |||||
| fakecertificatesv1 "k8s.io/client-go/kubernetes/typed/certificates/v1/fake" | |||||
| certificatesv1beta1 "k8s.io/client-go/kubernetes/typed/certificates/v1beta1" | |||||
| fakecertificatesv1beta1 "k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake" | |||||
| coordinationv1 "k8s.io/client-go/kubernetes/typed/coordination/v1" | |||||
| fakecoordinationv1 "k8s.io/client-go/kubernetes/typed/coordination/v1/fake" | |||||
| coordinationv1beta1 "k8s.io/client-go/kubernetes/typed/coordination/v1beta1" | |||||
| fakecoordinationv1beta1 "k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake" | |||||
| corev1 "k8s.io/client-go/kubernetes/typed/core/v1" | |||||
| fakecorev1 "k8s.io/client-go/kubernetes/typed/core/v1/fake" | |||||
| discoveryv1 "k8s.io/client-go/kubernetes/typed/discovery/v1" | |||||
| fakediscoveryv1 "k8s.io/client-go/kubernetes/typed/discovery/v1/fake" | |||||
| discoveryv1beta1 "k8s.io/client-go/kubernetes/typed/discovery/v1beta1" | |||||
| fakediscoveryv1beta1 "k8s.io/client-go/kubernetes/typed/discovery/v1beta1/fake" | |||||
| eventsv1 "k8s.io/client-go/kubernetes/typed/events/v1" | |||||
| fakeeventsv1 "k8s.io/client-go/kubernetes/typed/events/v1/fake" | |||||
| eventsv1beta1 "k8s.io/client-go/kubernetes/typed/events/v1beta1" | |||||
| fakeeventsv1beta1 "k8s.io/client-go/kubernetes/typed/events/v1beta1/fake" | |||||
| extensionsv1beta1 "k8s.io/client-go/kubernetes/typed/extensions/v1beta1" | |||||
| fakeextensionsv1beta1 "k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake" | |||||
| flowcontrolv1alpha1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1" | |||||
| fakeflowcontrolv1alpha1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/fake" | |||||
| flowcontrolv1beta1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1" | |||||
| fakeflowcontrolv1beta1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/fake" | |||||
| networkingv1 "k8s.io/client-go/kubernetes/typed/networking/v1" | |||||
| fakenetworkingv1 "k8s.io/client-go/kubernetes/typed/networking/v1/fake" | |||||
| networkingv1beta1 "k8s.io/client-go/kubernetes/typed/networking/v1beta1" | |||||
| fakenetworkingv1beta1 "k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake" | |||||
| nodev1 "k8s.io/client-go/kubernetes/typed/node/v1" | |||||
| fakenodev1 "k8s.io/client-go/kubernetes/typed/node/v1/fake" | |||||
| nodev1alpha1 "k8s.io/client-go/kubernetes/typed/node/v1alpha1" | |||||
| fakenodev1alpha1 "k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake" | |||||
| nodev1beta1 "k8s.io/client-go/kubernetes/typed/node/v1beta1" | |||||
| fakenodev1beta1 "k8s.io/client-go/kubernetes/typed/node/v1beta1/fake" | |||||
| policyv1 "k8s.io/client-go/kubernetes/typed/policy/v1" | |||||
| fakepolicyv1 "k8s.io/client-go/kubernetes/typed/policy/v1/fake" | |||||
| policyv1beta1 "k8s.io/client-go/kubernetes/typed/policy/v1beta1" | |||||
| fakepolicyv1beta1 "k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake" | |||||
| rbacv1 "k8s.io/client-go/kubernetes/typed/rbac/v1" | |||||
| fakerbacv1 "k8s.io/client-go/kubernetes/typed/rbac/v1/fake" | |||||
| rbacv1alpha1 "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1" | |||||
| fakerbacv1alpha1 "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake" | |||||
| rbacv1beta1 "k8s.io/client-go/kubernetes/typed/rbac/v1beta1" | |||||
| fakerbacv1beta1 "k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake" | |||||
| schedulingv1 "k8s.io/client-go/kubernetes/typed/scheduling/v1" | |||||
| fakeschedulingv1 "k8s.io/client-go/kubernetes/typed/scheduling/v1/fake" | |||||
| schedulingv1alpha1 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1" | |||||
| fakeschedulingv1alpha1 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake" | |||||
| schedulingv1beta1 "k8s.io/client-go/kubernetes/typed/scheduling/v1beta1" | |||||
| fakeschedulingv1beta1 "k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/fake" | |||||
| storagev1 "k8s.io/client-go/kubernetes/typed/storage/v1" | |||||
| fakestoragev1 "k8s.io/client-go/kubernetes/typed/storage/v1/fake" | |||||
| storagev1alpha1 "k8s.io/client-go/kubernetes/typed/storage/v1alpha1" | |||||
| fakestoragev1alpha1 "k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake" | |||||
| storagev1beta1 "k8s.io/client-go/kubernetes/typed/storage/v1beta1" | |||||
| fakestoragev1beta1 "k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake" | |||||
| "k8s.io/client-go/testing" | |||||
| ) | |||||
| // NewSimpleClientset returns a clientset that will respond with the provided objects. | |||||
| // It's backed by a very simple object tracker that processes creates, updates and deletions as-is, | |||||
| // without applying any validations and/or defaults. It shouldn't be considered a replacement | |||||
| // for a real clientset and is mostly useful in simple unit tests. | |||||
| func NewSimpleClientset(objects ...runtime.Object) *Clientset { | |||||
| o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) | |||||
| for _, obj := range objects { | |||||
| if err := o.Add(obj); err != nil { | |||||
| panic(err) | |||||
| } | |||||
| } | |||||
| cs := &Clientset{tracker: o} | |||||
| cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} | |||||
| cs.AddReactor("*", "*", testing.ObjectReaction(o)) | |||||
| cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { | |||||
| gvr := action.GetResource() | |||||
| ns := action.GetNamespace() | |||||
| watch, err := o.Watch(gvr, ns) | |||||
| if err != nil { | |||||
| return false, nil, err | |||||
| } | |||||
| return true, watch, nil | |||||
| }) | |||||
| return cs | |||||
| } | |||||
| // Clientset implements clientset.Interface. Meant to be embedded into a | |||||
| // struct to get a default implementation. This makes faking out just the method | |||||
| // you want to test easier. | |||||
| type Clientset struct { | |||||
| testing.Fake | |||||
| discovery *fakediscovery.FakeDiscovery | |||||
| tracker testing.ObjectTracker | |||||
| } | |||||
| func (c *Clientset) Discovery() discovery.DiscoveryInterface { | |||||
| return c.discovery | |||||
| } | |||||
| func (c *Clientset) Tracker() testing.ObjectTracker { | |||||
| return c.tracker | |||||
| } | |||||
| var _ clientset.Interface = &Clientset{} | |||||
| // AdmissionregistrationV1 retrieves the AdmissionregistrationV1Client | |||||
| func (c *Clientset) AdmissionregistrationV1() admissionregistrationv1.AdmissionregistrationV1Interface { | |||||
| return &fakeadmissionregistrationv1.FakeAdmissionregistrationV1{Fake: &c.Fake} | |||||
| } | |||||
| // AdmissionregistrationV1beta1 retrieves the AdmissionregistrationV1beta1Client | |||||
| func (c *Clientset) AdmissionregistrationV1beta1() admissionregistrationv1beta1.AdmissionregistrationV1beta1Interface { | |||||
| return &fakeadmissionregistrationv1beta1.FakeAdmissionregistrationV1beta1{Fake: &c.Fake} | |||||
| } | |||||
| // InternalV1alpha1 retrieves the InternalV1alpha1Client | |||||
| func (c *Clientset) InternalV1alpha1() internalv1alpha1.InternalV1alpha1Interface { | |||||
| return &fakeinternalv1alpha1.FakeInternalV1alpha1{Fake: &c.Fake} | |||||
| } | |||||
| // AppsV1 retrieves the AppsV1Client | |||||
| func (c *Clientset) AppsV1() appsv1.AppsV1Interface { | |||||
| return &fakeappsv1.FakeAppsV1{Fake: &c.Fake} | |||||
| } | |||||
| // AppsV1beta1 retrieves the AppsV1beta1Client | |||||
| func (c *Clientset) AppsV1beta1() appsv1beta1.AppsV1beta1Interface { | |||||
| return &fakeappsv1beta1.FakeAppsV1beta1{Fake: &c.Fake} | |||||
| } | |||||
| // AppsV1beta2 retrieves the AppsV1beta2Client | |||||
| func (c *Clientset) AppsV1beta2() appsv1beta2.AppsV1beta2Interface { | |||||
| return &fakeappsv1beta2.FakeAppsV1beta2{Fake: &c.Fake} | |||||
| } | |||||
| // AuthenticationV1 retrieves the AuthenticationV1Client | |||||
| func (c *Clientset) AuthenticationV1() authenticationv1.AuthenticationV1Interface { | |||||
| return &fakeauthenticationv1.FakeAuthenticationV1{Fake: &c.Fake} | |||||
| } | |||||
| // AuthenticationV1beta1 retrieves the AuthenticationV1beta1Client | |||||
| func (c *Clientset) AuthenticationV1beta1() authenticationv1beta1.AuthenticationV1beta1Interface { | |||||
| return &fakeauthenticationv1beta1.FakeAuthenticationV1beta1{Fake: &c.Fake} | |||||
| } | |||||
| // AuthorizationV1 retrieves the AuthorizationV1Client | |||||
| func (c *Clientset) AuthorizationV1() authorizationv1.AuthorizationV1Interface { | |||||
| return &fakeauthorizationv1.FakeAuthorizationV1{Fake: &c.Fake} | |||||
| } | |||||
| // AuthorizationV1beta1 retrieves the AuthorizationV1beta1Client | |||||
| func (c *Clientset) AuthorizationV1beta1() authorizationv1beta1.AuthorizationV1beta1Interface { | |||||
| return &fakeauthorizationv1beta1.FakeAuthorizationV1beta1{Fake: &c.Fake} | |||||
| } | |||||
| // AutoscalingV1 retrieves the AutoscalingV1Client | |||||
| func (c *Clientset) AutoscalingV1() autoscalingv1.AutoscalingV1Interface { | |||||
| return &fakeautoscalingv1.FakeAutoscalingV1{Fake: &c.Fake} | |||||
| } | |||||
| // AutoscalingV2beta1 retrieves the AutoscalingV2beta1Client | |||||
| func (c *Clientset) AutoscalingV2beta1() autoscalingv2beta1.AutoscalingV2beta1Interface { | |||||
| return &fakeautoscalingv2beta1.FakeAutoscalingV2beta1{Fake: &c.Fake} | |||||
| } | |||||
| // AutoscalingV2beta2 retrieves the AutoscalingV2beta2Client | |||||
| func (c *Clientset) AutoscalingV2beta2() autoscalingv2beta2.AutoscalingV2beta2Interface { | |||||
| return &fakeautoscalingv2beta2.FakeAutoscalingV2beta2{Fake: &c.Fake} | |||||
| } | |||||
| // BatchV1 retrieves the BatchV1Client | |||||
| func (c *Clientset) BatchV1() batchv1.BatchV1Interface { | |||||
| return &fakebatchv1.FakeBatchV1{Fake: &c.Fake} | |||||
| } | |||||
| // BatchV1beta1 retrieves the BatchV1beta1Client | |||||
| func (c *Clientset) BatchV1beta1() batchv1beta1.BatchV1beta1Interface { | |||||
| return &fakebatchv1beta1.FakeBatchV1beta1{Fake: &c.Fake} | |||||
| } | |||||
| // CertificatesV1 retrieves the CertificatesV1Client | |||||
| func (c *Clientset) CertificatesV1() certificatesv1.CertificatesV1Interface { | |||||
| return &fakecertificatesv1.FakeCertificatesV1{Fake: &c.Fake} | |||||
| } | |||||
| // CertificatesV1beta1 retrieves the CertificatesV1beta1Client | |||||
| func (c *Clientset) CertificatesV1beta1() certificatesv1beta1.CertificatesV1beta1Interface { | |||||
| return &fakecertificatesv1beta1.FakeCertificatesV1beta1{Fake: &c.Fake} | |||||
| } | |||||
| // CoordinationV1beta1 retrieves the CoordinationV1beta1Client | |||||
| func (c *Clientset) CoordinationV1beta1() coordinationv1beta1.CoordinationV1beta1Interface { | |||||
| return &fakecoordinationv1beta1.FakeCoordinationV1beta1{Fake: &c.Fake} | |||||
| } | |||||
| // CoordinationV1 retrieves the CoordinationV1Client | |||||
| func (c *Clientset) CoordinationV1() coordinationv1.CoordinationV1Interface { | |||||
| return &fakecoordinationv1.FakeCoordinationV1{Fake: &c.Fake} | |||||
| } | |||||
| // CoreV1 retrieves the CoreV1Client | |||||
| func (c *Clientset) CoreV1() corev1.CoreV1Interface { | |||||
| return &fakecorev1.FakeCoreV1{Fake: &c.Fake} | |||||
| } | |||||
| // DiscoveryV1 retrieves the DiscoveryV1Client | |||||
| func (c *Clientset) DiscoveryV1() discoveryv1.DiscoveryV1Interface { | |||||
| return &fakediscoveryv1.FakeDiscoveryV1{Fake: &c.Fake} | |||||
| } | |||||
| // DiscoveryV1beta1 retrieves the DiscoveryV1beta1Client | |||||
| func (c *Clientset) DiscoveryV1beta1() discoveryv1beta1.DiscoveryV1beta1Interface { | |||||
| return &fakediscoveryv1beta1.FakeDiscoveryV1beta1{Fake: &c.Fake} | |||||
| } | |||||
| // EventsV1 retrieves the EventsV1Client | |||||
| func (c *Clientset) EventsV1() eventsv1.EventsV1Interface { | |||||
| return &fakeeventsv1.FakeEventsV1{Fake: &c.Fake} | |||||
| } | |||||
| // EventsV1beta1 retrieves the EventsV1beta1Client | |||||
| func (c *Clientset) EventsV1beta1() eventsv1beta1.EventsV1beta1Interface { | |||||
| return &fakeeventsv1beta1.FakeEventsV1beta1{Fake: &c.Fake} | |||||
| } | |||||
| // ExtensionsV1beta1 retrieves the ExtensionsV1beta1Client | |||||
| func (c *Clientset) ExtensionsV1beta1() extensionsv1beta1.ExtensionsV1beta1Interface { | |||||
| return &fakeextensionsv1beta1.FakeExtensionsV1beta1{Fake: &c.Fake} | |||||
| } | |||||
| // FlowcontrolV1alpha1 retrieves the FlowcontrolV1alpha1Client | |||||
| func (c *Clientset) FlowcontrolV1alpha1() flowcontrolv1alpha1.FlowcontrolV1alpha1Interface { | |||||
| return &fakeflowcontrolv1alpha1.FakeFlowcontrolV1alpha1{Fake: &c.Fake} | |||||
| } | |||||
| // FlowcontrolV1beta1 retrieves the FlowcontrolV1beta1Client | |||||
| func (c *Clientset) FlowcontrolV1beta1() flowcontrolv1beta1.FlowcontrolV1beta1Interface { | |||||
| return &fakeflowcontrolv1beta1.FakeFlowcontrolV1beta1{Fake: &c.Fake} | |||||
| } | |||||
| // NetworkingV1 retrieves the NetworkingV1Client | |||||
| func (c *Clientset) NetworkingV1() networkingv1.NetworkingV1Interface { | |||||
| return &fakenetworkingv1.FakeNetworkingV1{Fake: &c.Fake} | |||||
| } | |||||
| // NetworkingV1beta1 retrieves the NetworkingV1beta1Client | |||||
| func (c *Clientset) NetworkingV1beta1() networkingv1beta1.NetworkingV1beta1Interface { | |||||
| return &fakenetworkingv1beta1.FakeNetworkingV1beta1{Fake: &c.Fake} | |||||
| } | |||||
| // NodeV1 retrieves the NodeV1Client | |||||
| func (c *Clientset) NodeV1() nodev1.NodeV1Interface { | |||||
| return &fakenodev1.FakeNodeV1{Fake: &c.Fake} | |||||
| } | |||||
| // NodeV1alpha1 retrieves the NodeV1alpha1Client | |||||
| func (c *Clientset) NodeV1alpha1() nodev1alpha1.NodeV1alpha1Interface { | |||||
| return &fakenodev1alpha1.FakeNodeV1alpha1{Fake: &c.Fake} | |||||
| } | |||||
| // NodeV1beta1 retrieves the NodeV1beta1Client | |||||
| func (c *Clientset) NodeV1beta1() nodev1beta1.NodeV1beta1Interface { | |||||
| return &fakenodev1beta1.FakeNodeV1beta1{Fake: &c.Fake} | |||||
| } | |||||
| // PolicyV1 retrieves the PolicyV1Client | |||||
| func (c *Clientset) PolicyV1() policyv1.PolicyV1Interface { | |||||
| return &fakepolicyv1.FakePolicyV1{Fake: &c.Fake} | |||||
| } | |||||
| // PolicyV1beta1 retrieves the PolicyV1beta1Client | |||||
| func (c *Clientset) PolicyV1beta1() policyv1beta1.PolicyV1beta1Interface { | |||||
| return &fakepolicyv1beta1.FakePolicyV1beta1{Fake: &c.Fake} | |||||
| } | |||||
| // RbacV1 retrieves the RbacV1Client | |||||
| func (c *Clientset) RbacV1() rbacv1.RbacV1Interface { | |||||
| return &fakerbacv1.FakeRbacV1{Fake: &c.Fake} | |||||
| } | |||||
| // RbacV1beta1 retrieves the RbacV1beta1Client | |||||
| func (c *Clientset) RbacV1beta1() rbacv1beta1.RbacV1beta1Interface { | |||||
| return &fakerbacv1beta1.FakeRbacV1beta1{Fake: &c.Fake} | |||||
| } | |||||
| // RbacV1alpha1 retrieves the RbacV1alpha1Client | |||||
| func (c *Clientset) RbacV1alpha1() rbacv1alpha1.RbacV1alpha1Interface { | |||||
| return &fakerbacv1alpha1.FakeRbacV1alpha1{Fake: &c.Fake} | |||||
| } | |||||
| // SchedulingV1alpha1 retrieves the SchedulingV1alpha1Client | |||||
| func (c *Clientset) SchedulingV1alpha1() schedulingv1alpha1.SchedulingV1alpha1Interface { | |||||
| return &fakeschedulingv1alpha1.FakeSchedulingV1alpha1{Fake: &c.Fake} | |||||
| } | |||||
| // SchedulingV1beta1 retrieves the SchedulingV1beta1Client | |||||
| func (c *Clientset) SchedulingV1beta1() schedulingv1beta1.SchedulingV1beta1Interface { | |||||
| return &fakeschedulingv1beta1.FakeSchedulingV1beta1{Fake: &c.Fake} | |||||
| } | |||||
| // SchedulingV1 retrieves the SchedulingV1Client | |||||
| func (c *Clientset) SchedulingV1() schedulingv1.SchedulingV1Interface { | |||||
| return &fakeschedulingv1.FakeSchedulingV1{Fake: &c.Fake} | |||||
| } | |||||
| // StorageV1beta1 retrieves the StorageV1beta1Client | |||||
| func (c *Clientset) StorageV1beta1() storagev1beta1.StorageV1beta1Interface { | |||||
| return &fakestoragev1beta1.FakeStorageV1beta1{Fake: &c.Fake} | |||||
| } | |||||
| // StorageV1 retrieves the StorageV1Client | |||||
| func (c *Clientset) StorageV1() storagev1.StorageV1Interface { | |||||
| return &fakestoragev1.FakeStorageV1{Fake: &c.Fake} | |||||
| } | |||||
| // StorageV1alpha1 retrieves the StorageV1alpha1Client | |||||
| func (c *Clientset) StorageV1alpha1() storagev1alpha1.StorageV1alpha1Interface { | |||||
| return &fakestoragev1alpha1.FakeStorageV1alpha1{Fake: &c.Fake} | |||||
| } | |||||
| @@ -0,0 +1,20 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| // This package has the automatically generated fake clientset. | |||||
| package fake | |||||
| @@ -0,0 +1,140 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| admissionregistrationv1 "k8s.io/api/admissionregistration/v1" | |||||
| admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" | |||||
| internalv1alpha1 "k8s.io/api/apiserverinternal/v1alpha1" | |||||
| appsv1 "k8s.io/api/apps/v1" | |||||
| appsv1beta1 "k8s.io/api/apps/v1beta1" | |||||
| appsv1beta2 "k8s.io/api/apps/v1beta2" | |||||
| authenticationv1 "k8s.io/api/authentication/v1" | |||||
| authenticationv1beta1 "k8s.io/api/authentication/v1beta1" | |||||
| authorizationv1 "k8s.io/api/authorization/v1" | |||||
| authorizationv1beta1 "k8s.io/api/authorization/v1beta1" | |||||
| autoscalingv1 "k8s.io/api/autoscaling/v1" | |||||
| autoscalingv2beta1 "k8s.io/api/autoscaling/v2beta1" | |||||
| autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2" | |||||
| batchv1 "k8s.io/api/batch/v1" | |||||
| batchv1beta1 "k8s.io/api/batch/v1beta1" | |||||
| certificatesv1 "k8s.io/api/certificates/v1" | |||||
| certificatesv1beta1 "k8s.io/api/certificates/v1beta1" | |||||
| coordinationv1 "k8s.io/api/coordination/v1" | |||||
| coordinationv1beta1 "k8s.io/api/coordination/v1beta1" | |||||
| corev1 "k8s.io/api/core/v1" | |||||
| discoveryv1 "k8s.io/api/discovery/v1" | |||||
| discoveryv1beta1 "k8s.io/api/discovery/v1beta1" | |||||
| eventsv1 "k8s.io/api/events/v1" | |||||
| eventsv1beta1 "k8s.io/api/events/v1beta1" | |||||
| extensionsv1beta1 "k8s.io/api/extensions/v1beta1" | |||||
| flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" | |||||
| flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" | |||||
| networkingv1 "k8s.io/api/networking/v1" | |||||
| networkingv1beta1 "k8s.io/api/networking/v1beta1" | |||||
| nodev1 "k8s.io/api/node/v1" | |||||
| nodev1alpha1 "k8s.io/api/node/v1alpha1" | |||||
| nodev1beta1 "k8s.io/api/node/v1beta1" | |||||
| policyv1 "k8s.io/api/policy/v1" | |||||
| policyv1beta1 "k8s.io/api/policy/v1beta1" | |||||
| rbacv1 "k8s.io/api/rbac/v1" | |||||
| rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" | |||||
| rbacv1beta1 "k8s.io/api/rbac/v1beta1" | |||||
| schedulingv1 "k8s.io/api/scheduling/v1" | |||||
| schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1" | |||||
| schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" | |||||
| storagev1 "k8s.io/api/storage/v1" | |||||
| storagev1alpha1 "k8s.io/api/storage/v1alpha1" | |||||
| storagev1beta1 "k8s.io/api/storage/v1beta1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| runtime "k8s.io/apimachinery/pkg/runtime" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| serializer "k8s.io/apimachinery/pkg/runtime/serializer" | |||||
| utilruntime "k8s.io/apimachinery/pkg/util/runtime" | |||||
| ) | |||||
| var scheme = runtime.NewScheme() | |||||
| var codecs = serializer.NewCodecFactory(scheme) | |||||
| var localSchemeBuilder = runtime.SchemeBuilder{ | |||||
| admissionregistrationv1.AddToScheme, | |||||
| admissionregistrationv1beta1.AddToScheme, | |||||
| internalv1alpha1.AddToScheme, | |||||
| appsv1.AddToScheme, | |||||
| appsv1beta1.AddToScheme, | |||||
| appsv1beta2.AddToScheme, | |||||
| authenticationv1.AddToScheme, | |||||
| authenticationv1beta1.AddToScheme, | |||||
| authorizationv1.AddToScheme, | |||||
| authorizationv1beta1.AddToScheme, | |||||
| autoscalingv1.AddToScheme, | |||||
| autoscalingv2beta1.AddToScheme, | |||||
| autoscalingv2beta2.AddToScheme, | |||||
| batchv1.AddToScheme, | |||||
| batchv1beta1.AddToScheme, | |||||
| certificatesv1.AddToScheme, | |||||
| certificatesv1beta1.AddToScheme, | |||||
| coordinationv1beta1.AddToScheme, | |||||
| coordinationv1.AddToScheme, | |||||
| corev1.AddToScheme, | |||||
| discoveryv1.AddToScheme, | |||||
| discoveryv1beta1.AddToScheme, | |||||
| eventsv1.AddToScheme, | |||||
| eventsv1beta1.AddToScheme, | |||||
| extensionsv1beta1.AddToScheme, | |||||
| flowcontrolv1alpha1.AddToScheme, | |||||
| flowcontrolv1beta1.AddToScheme, | |||||
| networkingv1.AddToScheme, | |||||
| networkingv1beta1.AddToScheme, | |||||
| nodev1.AddToScheme, | |||||
| nodev1alpha1.AddToScheme, | |||||
| nodev1beta1.AddToScheme, | |||||
| policyv1.AddToScheme, | |||||
| policyv1beta1.AddToScheme, | |||||
| rbacv1.AddToScheme, | |||||
| rbacv1beta1.AddToScheme, | |||||
| rbacv1alpha1.AddToScheme, | |||||
| schedulingv1alpha1.AddToScheme, | |||||
| schedulingv1beta1.AddToScheme, | |||||
| schedulingv1.AddToScheme, | |||||
| storagev1beta1.AddToScheme, | |||||
| storagev1.AddToScheme, | |||||
| storagev1alpha1.AddToScheme, | |||||
| } | |||||
| // AddToScheme adds all types of this clientset into the given scheme. This allows composition | |||||
| // of clientsets, like in: | |||||
| // | |||||
| // import ( | |||||
| // "k8s.io/client-go/kubernetes" | |||||
| // clientsetscheme "k8s.io/client-go/kubernetes/scheme" | |||||
| // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" | |||||
| // ) | |||||
| // | |||||
| // kclientset, _ := kubernetes.NewForConfig(c) | |||||
| // _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) | |||||
| // | |||||
| // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types | |||||
| // correctly. | |||||
| var AddToScheme = localSchemeBuilder.AddToScheme | |||||
| func init() { | |||||
| v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) | |||||
| utilruntime.Must(AddToScheme(scheme)) | |||||
| } | |||||
| @@ -0,0 +1,20 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| // Package fake has the automatically generated clients. | |||||
| package fake | |||||
| @@ -0,0 +1,44 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| v1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1" | |||||
| rest "k8s.io/client-go/rest" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| type FakeAdmissionregistrationV1 struct { | |||||
| *testing.Fake | |||||
| } | |||||
| func (c *FakeAdmissionregistrationV1) MutatingWebhookConfigurations() v1.MutatingWebhookConfigurationInterface { | |||||
| return &FakeMutatingWebhookConfigurations{c} | |||||
| } | |||||
| func (c *FakeAdmissionregistrationV1) ValidatingWebhookConfigurations() v1.ValidatingWebhookConfigurationInterface { | |||||
| return &FakeValidatingWebhookConfigurations{c} | |||||
| } | |||||
| // RESTClient returns a RESTClient that is used to communicate | |||||
| // with API server by this client implementation. | |||||
| func (c *FakeAdmissionregistrationV1) RESTClient() rest.Interface { | |||||
| var ret *rest.RESTClient | |||||
| return ret | |||||
| } | |||||
| @@ -0,0 +1,146 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| admissionregistrationv1 "k8s.io/api/admissionregistration/v1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| applyconfigurationsadmissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeMutatingWebhookConfigurations implements MutatingWebhookConfigurationInterface | |||||
| type FakeMutatingWebhookConfigurations struct { | |||||
| Fake *FakeAdmissionregistrationV1 | |||||
| } | |||||
| var mutatingwebhookconfigurationsResource = schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1", Resource: "mutatingwebhookconfigurations"} | |||||
| var mutatingwebhookconfigurationsKind = schema.GroupVersionKind{Group: "admissionregistration.k8s.io", Version: "v1", Kind: "MutatingWebhookConfiguration"} | |||||
| // Get takes name of the mutatingWebhookConfiguration, and returns the corresponding mutatingWebhookConfiguration object, and an error if there is any. | |||||
| func (c *FakeMutatingWebhookConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *admissionregistrationv1.MutatingWebhookConfiguration, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootGetAction(mutatingwebhookconfigurationsResource, name), &admissionregistrationv1.MutatingWebhookConfiguration{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*admissionregistrationv1.MutatingWebhookConfiguration), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors. | |||||
| func (c *FakeMutatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *admissionregistrationv1.MutatingWebhookConfigurationList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootListAction(mutatingwebhookconfigurationsResource, mutatingwebhookconfigurationsKind, opts), &admissionregistrationv1.MutatingWebhookConfigurationList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &admissionregistrationv1.MutatingWebhookConfigurationList{ListMeta: obj.(*admissionregistrationv1.MutatingWebhookConfigurationList).ListMeta} | |||||
| for _, item := range obj.(*admissionregistrationv1.MutatingWebhookConfigurationList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested mutatingWebhookConfigurations. | |||||
| func (c *FakeMutatingWebhookConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewRootWatchAction(mutatingwebhookconfigurationsResource, opts)) | |||||
| } | |||||
| // Create takes the representation of a mutatingWebhookConfiguration and creates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. | |||||
| func (c *FakeMutatingWebhookConfigurations) Create(ctx context.Context, mutatingWebhookConfiguration *admissionregistrationv1.MutatingWebhookConfiguration, opts v1.CreateOptions) (result *admissionregistrationv1.MutatingWebhookConfiguration, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootCreateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), &admissionregistrationv1.MutatingWebhookConfiguration{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*admissionregistrationv1.MutatingWebhookConfiguration), err | |||||
| } | |||||
| // Update takes the representation of a mutatingWebhookConfiguration and updates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. | |||||
| func (c *FakeMutatingWebhookConfigurations) Update(ctx context.Context, mutatingWebhookConfiguration *admissionregistrationv1.MutatingWebhookConfiguration, opts v1.UpdateOptions) (result *admissionregistrationv1.MutatingWebhookConfiguration, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootUpdateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), &admissionregistrationv1.MutatingWebhookConfiguration{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*admissionregistrationv1.MutatingWebhookConfiguration), err | |||||
| } | |||||
| // Delete takes name of the mutatingWebhookConfiguration and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeMutatingWebhookConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewRootDeleteAction(mutatingwebhookconfigurationsResource, name), &admissionregistrationv1.MutatingWebhookConfiguration{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeMutatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewRootDeleteCollectionAction(mutatingwebhookconfigurationsResource, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &admissionregistrationv1.MutatingWebhookConfigurationList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched mutatingWebhookConfiguration. | |||||
| func (c *FakeMutatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *admissionregistrationv1.MutatingWebhookConfiguration, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootPatchSubresourceAction(mutatingwebhookconfigurationsResource, name, pt, data, subresources...), &admissionregistrationv1.MutatingWebhookConfiguration{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*admissionregistrationv1.MutatingWebhookConfiguration), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied mutatingWebhookConfiguration. | |||||
| func (c *FakeMutatingWebhookConfigurations) Apply(ctx context.Context, mutatingWebhookConfiguration *applyconfigurationsadmissionregistrationv1.MutatingWebhookConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *admissionregistrationv1.MutatingWebhookConfiguration, err error) { | |||||
| if mutatingWebhookConfiguration == nil { | |||||
| return nil, fmt.Errorf("mutatingWebhookConfiguration provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(mutatingWebhookConfiguration) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := mutatingWebhookConfiguration.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("mutatingWebhookConfiguration.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootPatchSubresourceAction(mutatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data), &admissionregistrationv1.MutatingWebhookConfiguration{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*admissionregistrationv1.MutatingWebhookConfiguration), err | |||||
| } | |||||
| @@ -0,0 +1,146 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| admissionregistrationv1 "k8s.io/api/admissionregistration/v1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| applyconfigurationsadmissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeValidatingWebhookConfigurations implements ValidatingWebhookConfigurationInterface | |||||
| type FakeValidatingWebhookConfigurations struct { | |||||
| Fake *FakeAdmissionregistrationV1 | |||||
| } | |||||
| var validatingwebhookconfigurationsResource = schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1", Resource: "validatingwebhookconfigurations"} | |||||
| var validatingwebhookconfigurationsKind = schema.GroupVersionKind{Group: "admissionregistration.k8s.io", Version: "v1", Kind: "ValidatingWebhookConfiguration"} | |||||
| // Get takes name of the validatingWebhookConfiguration, and returns the corresponding validatingWebhookConfiguration object, and an error if there is any. | |||||
| func (c *FakeValidatingWebhookConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *admissionregistrationv1.ValidatingWebhookConfiguration, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootGetAction(validatingwebhookconfigurationsResource, name), &admissionregistrationv1.ValidatingWebhookConfiguration{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*admissionregistrationv1.ValidatingWebhookConfiguration), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors. | |||||
| func (c *FakeValidatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *admissionregistrationv1.ValidatingWebhookConfigurationList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootListAction(validatingwebhookconfigurationsResource, validatingwebhookconfigurationsKind, opts), &admissionregistrationv1.ValidatingWebhookConfigurationList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &admissionregistrationv1.ValidatingWebhookConfigurationList{ListMeta: obj.(*admissionregistrationv1.ValidatingWebhookConfigurationList).ListMeta} | |||||
| for _, item := range obj.(*admissionregistrationv1.ValidatingWebhookConfigurationList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested validatingWebhookConfigurations. | |||||
| func (c *FakeValidatingWebhookConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewRootWatchAction(validatingwebhookconfigurationsResource, opts)) | |||||
| } | |||||
| // Create takes the representation of a validatingWebhookConfiguration and creates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any. | |||||
| func (c *FakeValidatingWebhookConfigurations) Create(ctx context.Context, validatingWebhookConfiguration *admissionregistrationv1.ValidatingWebhookConfiguration, opts v1.CreateOptions) (result *admissionregistrationv1.ValidatingWebhookConfiguration, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootCreateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), &admissionregistrationv1.ValidatingWebhookConfiguration{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*admissionregistrationv1.ValidatingWebhookConfiguration), err | |||||
| } | |||||
| // Update takes the representation of a validatingWebhookConfiguration and updates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any. | |||||
| func (c *FakeValidatingWebhookConfigurations) Update(ctx context.Context, validatingWebhookConfiguration *admissionregistrationv1.ValidatingWebhookConfiguration, opts v1.UpdateOptions) (result *admissionregistrationv1.ValidatingWebhookConfiguration, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootUpdateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), &admissionregistrationv1.ValidatingWebhookConfiguration{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*admissionregistrationv1.ValidatingWebhookConfiguration), err | |||||
| } | |||||
| // Delete takes name of the validatingWebhookConfiguration and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeValidatingWebhookConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewRootDeleteAction(validatingwebhookconfigurationsResource, name), &admissionregistrationv1.ValidatingWebhookConfiguration{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeValidatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewRootDeleteCollectionAction(validatingwebhookconfigurationsResource, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &admissionregistrationv1.ValidatingWebhookConfigurationList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched validatingWebhookConfiguration. | |||||
| func (c *FakeValidatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *admissionregistrationv1.ValidatingWebhookConfiguration, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, name, pt, data, subresources...), &admissionregistrationv1.ValidatingWebhookConfiguration{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*admissionregistrationv1.ValidatingWebhookConfiguration), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied validatingWebhookConfiguration. | |||||
| func (c *FakeValidatingWebhookConfigurations) Apply(ctx context.Context, validatingWebhookConfiguration *applyconfigurationsadmissionregistrationv1.ValidatingWebhookConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *admissionregistrationv1.ValidatingWebhookConfiguration, err error) { | |||||
| if validatingWebhookConfiguration == nil { | |||||
| return nil, fmt.Errorf("validatingWebhookConfiguration provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(validatingWebhookConfiguration) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := validatingWebhookConfiguration.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("validatingWebhookConfiguration.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data), &admissionregistrationv1.ValidatingWebhookConfiguration{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*admissionregistrationv1.ValidatingWebhookConfiguration), err | |||||
| } | |||||
| @@ -0,0 +1,20 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| // Package fake has the automatically generated clients. | |||||
| package fake | |||||
| @@ -0,0 +1,44 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| v1beta1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1" | |||||
| rest "k8s.io/client-go/rest" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| type FakeAdmissionregistrationV1beta1 struct { | |||||
| *testing.Fake | |||||
| } | |||||
| func (c *FakeAdmissionregistrationV1beta1) MutatingWebhookConfigurations() v1beta1.MutatingWebhookConfigurationInterface { | |||||
| return &FakeMutatingWebhookConfigurations{c} | |||||
| } | |||||
| func (c *FakeAdmissionregistrationV1beta1) ValidatingWebhookConfigurations() v1beta1.ValidatingWebhookConfigurationInterface { | |||||
| return &FakeValidatingWebhookConfigurations{c} | |||||
| } | |||||
| // RESTClient returns a RESTClient that is used to communicate | |||||
| // with API server by this client implementation. | |||||
| func (c *FakeAdmissionregistrationV1beta1) RESTClient() rest.Interface { | |||||
| var ret *rest.RESTClient | |||||
| return ret | |||||
| } | |||||
| @@ -0,0 +1,146 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| v1beta1 "k8s.io/api/admissionregistration/v1beta1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeMutatingWebhookConfigurations implements MutatingWebhookConfigurationInterface | |||||
| type FakeMutatingWebhookConfigurations struct { | |||||
| Fake *FakeAdmissionregistrationV1beta1 | |||||
| } | |||||
| var mutatingwebhookconfigurationsResource = schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1beta1", Resource: "mutatingwebhookconfigurations"} | |||||
| var mutatingwebhookconfigurationsKind = schema.GroupVersionKind{Group: "admissionregistration.k8s.io", Version: "v1beta1", Kind: "MutatingWebhookConfiguration"} | |||||
| // Get takes name of the mutatingWebhookConfiguration, and returns the corresponding mutatingWebhookConfiguration object, and an error if there is any. | |||||
| func (c *FakeMutatingWebhookConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootGetAction(mutatingwebhookconfigurationsResource, name), &v1beta1.MutatingWebhookConfiguration{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.MutatingWebhookConfiguration), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors. | |||||
| func (c *FakeMutatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.MutatingWebhookConfigurationList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootListAction(mutatingwebhookconfigurationsResource, mutatingwebhookconfigurationsKind, opts), &v1beta1.MutatingWebhookConfigurationList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &v1beta1.MutatingWebhookConfigurationList{ListMeta: obj.(*v1beta1.MutatingWebhookConfigurationList).ListMeta} | |||||
| for _, item := range obj.(*v1beta1.MutatingWebhookConfigurationList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested mutatingWebhookConfigurations. | |||||
| func (c *FakeMutatingWebhookConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewRootWatchAction(mutatingwebhookconfigurationsResource, opts)) | |||||
| } | |||||
| // Create takes the representation of a mutatingWebhookConfiguration and creates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. | |||||
| func (c *FakeMutatingWebhookConfigurations) Create(ctx context.Context, mutatingWebhookConfiguration *v1beta1.MutatingWebhookConfiguration, opts v1.CreateOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootCreateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), &v1beta1.MutatingWebhookConfiguration{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.MutatingWebhookConfiguration), err | |||||
| } | |||||
| // Update takes the representation of a mutatingWebhookConfiguration and updates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. | |||||
| func (c *FakeMutatingWebhookConfigurations) Update(ctx context.Context, mutatingWebhookConfiguration *v1beta1.MutatingWebhookConfiguration, opts v1.UpdateOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootUpdateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), &v1beta1.MutatingWebhookConfiguration{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.MutatingWebhookConfiguration), err | |||||
| } | |||||
| // Delete takes name of the mutatingWebhookConfiguration and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeMutatingWebhookConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewRootDeleteAction(mutatingwebhookconfigurationsResource, name), &v1beta1.MutatingWebhookConfiguration{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeMutatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewRootDeleteCollectionAction(mutatingwebhookconfigurationsResource, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &v1beta1.MutatingWebhookConfigurationList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched mutatingWebhookConfiguration. | |||||
| func (c *FakeMutatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.MutatingWebhookConfiguration, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootPatchSubresourceAction(mutatingwebhookconfigurationsResource, name, pt, data, subresources...), &v1beta1.MutatingWebhookConfiguration{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.MutatingWebhookConfiguration), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied mutatingWebhookConfiguration. | |||||
| func (c *FakeMutatingWebhookConfigurations) Apply(ctx context.Context, mutatingWebhookConfiguration *admissionregistrationv1beta1.MutatingWebhookConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) { | |||||
| if mutatingWebhookConfiguration == nil { | |||||
| return nil, fmt.Errorf("mutatingWebhookConfiguration provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(mutatingWebhookConfiguration) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := mutatingWebhookConfiguration.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("mutatingWebhookConfiguration.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootPatchSubresourceAction(mutatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data), &v1beta1.MutatingWebhookConfiguration{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.MutatingWebhookConfiguration), err | |||||
| } | |||||
| @@ -0,0 +1,146 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| v1beta1 "k8s.io/api/admissionregistration/v1beta1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeValidatingWebhookConfigurations implements ValidatingWebhookConfigurationInterface | |||||
| type FakeValidatingWebhookConfigurations struct { | |||||
| Fake *FakeAdmissionregistrationV1beta1 | |||||
| } | |||||
| var validatingwebhookconfigurationsResource = schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1beta1", Resource: "validatingwebhookconfigurations"} | |||||
| var validatingwebhookconfigurationsKind = schema.GroupVersionKind{Group: "admissionregistration.k8s.io", Version: "v1beta1", Kind: "ValidatingWebhookConfiguration"} | |||||
| // Get takes name of the validatingWebhookConfiguration, and returns the corresponding validatingWebhookConfiguration object, and an error if there is any. | |||||
| func (c *FakeValidatingWebhookConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootGetAction(validatingwebhookconfigurationsResource, name), &v1beta1.ValidatingWebhookConfiguration{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.ValidatingWebhookConfiguration), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors. | |||||
| func (c *FakeValidatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingWebhookConfigurationList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootListAction(validatingwebhookconfigurationsResource, validatingwebhookconfigurationsKind, opts), &v1beta1.ValidatingWebhookConfigurationList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &v1beta1.ValidatingWebhookConfigurationList{ListMeta: obj.(*v1beta1.ValidatingWebhookConfigurationList).ListMeta} | |||||
| for _, item := range obj.(*v1beta1.ValidatingWebhookConfigurationList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested validatingWebhookConfigurations. | |||||
| func (c *FakeValidatingWebhookConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewRootWatchAction(validatingwebhookconfigurationsResource, opts)) | |||||
| } | |||||
| // Create takes the representation of a validatingWebhookConfiguration and creates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any. | |||||
| func (c *FakeValidatingWebhookConfigurations) Create(ctx context.Context, validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration, opts v1.CreateOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootCreateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), &v1beta1.ValidatingWebhookConfiguration{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.ValidatingWebhookConfiguration), err | |||||
| } | |||||
| // Update takes the representation of a validatingWebhookConfiguration and updates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any. | |||||
| func (c *FakeValidatingWebhookConfigurations) Update(ctx context.Context, validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration, opts v1.UpdateOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootUpdateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), &v1beta1.ValidatingWebhookConfiguration{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.ValidatingWebhookConfiguration), err | |||||
| } | |||||
| // Delete takes name of the validatingWebhookConfiguration and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeValidatingWebhookConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewRootDeleteAction(validatingwebhookconfigurationsResource, name), &v1beta1.ValidatingWebhookConfiguration{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeValidatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewRootDeleteCollectionAction(validatingwebhookconfigurationsResource, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &v1beta1.ValidatingWebhookConfigurationList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched validatingWebhookConfiguration. | |||||
| func (c *FakeValidatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingWebhookConfiguration, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, name, pt, data, subresources...), &v1beta1.ValidatingWebhookConfiguration{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.ValidatingWebhookConfiguration), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied validatingWebhookConfiguration. | |||||
| func (c *FakeValidatingWebhookConfigurations) Apply(ctx context.Context, validatingWebhookConfiguration *admissionregistrationv1beta1.ValidatingWebhookConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) { | |||||
| if validatingWebhookConfiguration == nil { | |||||
| return nil, fmt.Errorf("validatingWebhookConfiguration provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(validatingWebhookConfiguration) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := validatingWebhookConfiguration.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("validatingWebhookConfiguration.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data), &v1beta1.ValidatingWebhookConfiguration{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.ValidatingWebhookConfiguration), err | |||||
| } | |||||
| @@ -0,0 +1,20 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| // Package fake has the automatically generated clients. | |||||
| package fake | |||||
| @@ -0,0 +1,40 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| v1alpha1 "k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1" | |||||
| rest "k8s.io/client-go/rest" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| type FakeInternalV1alpha1 struct { | |||||
| *testing.Fake | |||||
| } | |||||
| func (c *FakeInternalV1alpha1) StorageVersions() v1alpha1.StorageVersionInterface { | |||||
| return &FakeStorageVersions{c} | |||||
| } | |||||
| // RESTClient returns a RESTClient that is used to communicate | |||||
| // with API server by this client implementation. | |||||
| func (c *FakeInternalV1alpha1) RESTClient() rest.Interface { | |||||
| var ret *rest.RESTClient | |||||
| return ret | |||||
| } | |||||
| @@ -0,0 +1,179 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| v1alpha1 "k8s.io/api/apiserverinternal/v1alpha1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| apiserverinternalv1alpha1 "k8s.io/client-go/applyconfigurations/apiserverinternal/v1alpha1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeStorageVersions implements StorageVersionInterface | |||||
| type FakeStorageVersions struct { | |||||
| Fake *FakeInternalV1alpha1 | |||||
| } | |||||
| var storageversionsResource = schema.GroupVersionResource{Group: "internal.apiserver.k8s.io", Version: "v1alpha1", Resource: "storageversions"} | |||||
| var storageversionsKind = schema.GroupVersionKind{Group: "internal.apiserver.k8s.io", Version: "v1alpha1", Kind: "StorageVersion"} | |||||
| // Get takes name of the storageVersion, and returns the corresponding storageVersion object, and an error if there is any. | |||||
| func (c *FakeStorageVersions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.StorageVersion, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootGetAction(storageversionsResource, name), &v1alpha1.StorageVersion{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1alpha1.StorageVersion), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of StorageVersions that match those selectors. | |||||
| func (c *FakeStorageVersions) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.StorageVersionList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootListAction(storageversionsResource, storageversionsKind, opts), &v1alpha1.StorageVersionList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &v1alpha1.StorageVersionList{ListMeta: obj.(*v1alpha1.StorageVersionList).ListMeta} | |||||
| for _, item := range obj.(*v1alpha1.StorageVersionList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested storageVersions. | |||||
| func (c *FakeStorageVersions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewRootWatchAction(storageversionsResource, opts)) | |||||
| } | |||||
| // Create takes the representation of a storageVersion and creates it. Returns the server's representation of the storageVersion, and an error, if there is any. | |||||
| func (c *FakeStorageVersions) Create(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.CreateOptions) (result *v1alpha1.StorageVersion, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootCreateAction(storageversionsResource, storageVersion), &v1alpha1.StorageVersion{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1alpha1.StorageVersion), err | |||||
| } | |||||
| // Update takes the representation of a storageVersion and updates it. Returns the server's representation of the storageVersion, and an error, if there is any. | |||||
| func (c *FakeStorageVersions) Update(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.UpdateOptions) (result *v1alpha1.StorageVersion, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootUpdateAction(storageversionsResource, storageVersion), &v1alpha1.StorageVersion{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1alpha1.StorageVersion), err | |||||
| } | |||||
| // UpdateStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). | |||||
| func (c *FakeStorageVersions) UpdateStatus(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.UpdateOptions) (*v1alpha1.StorageVersion, error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootUpdateSubresourceAction(storageversionsResource, "status", storageVersion), &v1alpha1.StorageVersion{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1alpha1.StorageVersion), err | |||||
| } | |||||
| // Delete takes name of the storageVersion and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeStorageVersions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewRootDeleteAction(storageversionsResource, name), &v1alpha1.StorageVersion{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeStorageVersions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewRootDeleteCollectionAction(storageversionsResource, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &v1alpha1.StorageVersionList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched storageVersion. | |||||
| func (c *FakeStorageVersions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.StorageVersion, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootPatchSubresourceAction(storageversionsResource, name, pt, data, subresources...), &v1alpha1.StorageVersion{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1alpha1.StorageVersion), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied storageVersion. | |||||
| func (c *FakeStorageVersions) Apply(ctx context.Context, storageVersion *apiserverinternalv1alpha1.StorageVersionApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.StorageVersion, err error) { | |||||
| if storageVersion == nil { | |||||
| return nil, fmt.Errorf("storageVersion provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(storageVersion) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := storageVersion.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("storageVersion.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootPatchSubresourceAction(storageversionsResource, *name, types.ApplyPatchType, data), &v1alpha1.StorageVersion{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1alpha1.StorageVersion), err | |||||
| } | |||||
| // ApplyStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). | |||||
| func (c *FakeStorageVersions) ApplyStatus(ctx context.Context, storageVersion *apiserverinternalv1alpha1.StorageVersionApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.StorageVersion, err error) { | |||||
| if storageVersion == nil { | |||||
| return nil, fmt.Errorf("storageVersion provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(storageVersion) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := storageVersion.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("storageVersion.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootPatchSubresourceAction(storageversionsResource, *name, types.ApplyPatchType, data, "status"), &v1alpha1.StorageVersion{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1alpha1.StorageVersion), err | |||||
| } | |||||
| @@ -0,0 +1,20 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| // Package fake has the automatically generated clients. | |||||
| package fake | |||||
| @@ -0,0 +1,56 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| v1 "k8s.io/client-go/kubernetes/typed/apps/v1" | |||||
| rest "k8s.io/client-go/rest" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| type FakeAppsV1 struct { | |||||
| *testing.Fake | |||||
| } | |||||
| func (c *FakeAppsV1) ControllerRevisions(namespace string) v1.ControllerRevisionInterface { | |||||
| return &FakeControllerRevisions{c, namespace} | |||||
| } | |||||
| func (c *FakeAppsV1) DaemonSets(namespace string) v1.DaemonSetInterface { | |||||
| return &FakeDaemonSets{c, namespace} | |||||
| } | |||||
| func (c *FakeAppsV1) Deployments(namespace string) v1.DeploymentInterface { | |||||
| return &FakeDeployments{c, namespace} | |||||
| } | |||||
| func (c *FakeAppsV1) ReplicaSets(namespace string) v1.ReplicaSetInterface { | |||||
| return &FakeReplicaSets{c, namespace} | |||||
| } | |||||
| func (c *FakeAppsV1) StatefulSets(namespace string) v1.StatefulSetInterface { | |||||
| return &FakeStatefulSets{c, namespace} | |||||
| } | |||||
| // RESTClient returns a RESTClient that is used to communicate | |||||
| // with API server by this client implementation. | |||||
| func (c *FakeAppsV1) RESTClient() rest.Interface { | |||||
| var ret *rest.RESTClient | |||||
| return ret | |||||
| } | |||||
| @@ -0,0 +1,155 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| appsv1 "k8s.io/api/apps/v1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| applyconfigurationsappsv1 "k8s.io/client-go/applyconfigurations/apps/v1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeControllerRevisions implements ControllerRevisionInterface | |||||
| type FakeControllerRevisions struct { | |||||
| Fake *FakeAppsV1 | |||||
| ns string | |||||
| } | |||||
| var controllerrevisionsResource = schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "controllerrevisions"} | |||||
| var controllerrevisionsKind = schema.GroupVersionKind{Group: "apps", Version: "v1", Kind: "ControllerRevision"} | |||||
| // Get takes name of the controllerRevision, and returns the corresponding controllerRevision object, and an error if there is any. | |||||
| func (c *FakeControllerRevisions) Get(ctx context.Context, name string, options v1.GetOptions) (result *appsv1.ControllerRevision, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetAction(controllerrevisionsResource, c.ns, name), &appsv1.ControllerRevision{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.ControllerRevision), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. | |||||
| func (c *FakeControllerRevisions) List(ctx context.Context, opts v1.ListOptions) (result *appsv1.ControllerRevisionList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewListAction(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), &appsv1.ControllerRevisionList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &appsv1.ControllerRevisionList{ListMeta: obj.(*appsv1.ControllerRevisionList).ListMeta} | |||||
| for _, item := range obj.(*appsv1.ControllerRevisionList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested controllerRevisions. | |||||
| func (c *FakeControllerRevisions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewWatchAction(controllerrevisionsResource, c.ns, opts)) | |||||
| } | |||||
| // Create takes the representation of a controllerRevision and creates it. Returns the server's representation of the controllerRevision, and an error, if there is any. | |||||
| func (c *FakeControllerRevisions) Create(ctx context.Context, controllerRevision *appsv1.ControllerRevision, opts v1.CreateOptions) (result *appsv1.ControllerRevision, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewCreateAction(controllerrevisionsResource, c.ns, controllerRevision), &appsv1.ControllerRevision{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.ControllerRevision), err | |||||
| } | |||||
| // Update takes the representation of a controllerRevision and updates it. Returns the server's representation of the controllerRevision, and an error, if there is any. | |||||
| func (c *FakeControllerRevisions) Update(ctx context.Context, controllerRevision *appsv1.ControllerRevision, opts v1.UpdateOptions) (result *appsv1.ControllerRevision, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateAction(controllerrevisionsResource, c.ns, controllerRevision), &appsv1.ControllerRevision{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.ControllerRevision), err | |||||
| } | |||||
| // Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewDeleteAction(controllerrevisionsResource, c.ns, name), &appsv1.ControllerRevision{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewDeleteCollectionAction(controllerrevisionsResource, c.ns, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &appsv1.ControllerRevisionList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched controllerRevision. | |||||
| func (c *FakeControllerRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *appsv1.ControllerRevision, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, name, pt, data, subresources...), &appsv1.ControllerRevision{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.ControllerRevision), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied controllerRevision. | |||||
| func (c *FakeControllerRevisions) Apply(ctx context.Context, controllerRevision *applyconfigurationsappsv1.ControllerRevisionApplyConfiguration, opts v1.ApplyOptions) (result *appsv1.ControllerRevision, err error) { | |||||
| if controllerRevision == nil { | |||||
| return nil, fmt.Errorf("controllerRevision provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(controllerRevision) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := controllerRevision.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("controllerRevision.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data), &appsv1.ControllerRevision{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.ControllerRevision), err | |||||
| } | |||||
| @@ -0,0 +1,190 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| appsv1 "k8s.io/api/apps/v1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| applyconfigurationsappsv1 "k8s.io/client-go/applyconfigurations/apps/v1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeDaemonSets implements DaemonSetInterface | |||||
| type FakeDaemonSets struct { | |||||
| Fake *FakeAppsV1 | |||||
| ns string | |||||
| } | |||||
| var daemonsetsResource = schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "daemonsets"} | |||||
| var daemonsetsKind = schema.GroupVersionKind{Group: "apps", Version: "v1", Kind: "DaemonSet"} | |||||
| // Get takes name of the daemonSet, and returns the corresponding daemonSet object, and an error if there is any. | |||||
| func (c *FakeDaemonSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *appsv1.DaemonSet, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetAction(daemonsetsResource, c.ns, name), &appsv1.DaemonSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.DaemonSet), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of DaemonSets that match those selectors. | |||||
| func (c *FakeDaemonSets) List(ctx context.Context, opts v1.ListOptions) (result *appsv1.DaemonSetList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewListAction(daemonsetsResource, daemonsetsKind, c.ns, opts), &appsv1.DaemonSetList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &appsv1.DaemonSetList{ListMeta: obj.(*appsv1.DaemonSetList).ListMeta} | |||||
| for _, item := range obj.(*appsv1.DaemonSetList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested daemonSets. | |||||
| func (c *FakeDaemonSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewWatchAction(daemonsetsResource, c.ns, opts)) | |||||
| } | |||||
| // Create takes the representation of a daemonSet and creates it. Returns the server's representation of the daemonSet, and an error, if there is any. | |||||
| func (c *FakeDaemonSets) Create(ctx context.Context, daemonSet *appsv1.DaemonSet, opts v1.CreateOptions) (result *appsv1.DaemonSet, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewCreateAction(daemonsetsResource, c.ns, daemonSet), &appsv1.DaemonSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.DaemonSet), err | |||||
| } | |||||
| // Update takes the representation of a daemonSet and updates it. Returns the server's representation of the daemonSet, and an error, if there is any. | |||||
| func (c *FakeDaemonSets) Update(ctx context.Context, daemonSet *appsv1.DaemonSet, opts v1.UpdateOptions) (result *appsv1.DaemonSet, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateAction(daemonsetsResource, c.ns, daemonSet), &appsv1.DaemonSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.DaemonSet), err | |||||
| } | |||||
| // UpdateStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). | |||||
| func (c *FakeDaemonSets) UpdateStatus(ctx context.Context, daemonSet *appsv1.DaemonSet, opts v1.UpdateOptions) (*appsv1.DaemonSet, error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateSubresourceAction(daemonsetsResource, "status", c.ns, daemonSet), &appsv1.DaemonSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.DaemonSet), err | |||||
| } | |||||
| // Delete takes name of the daemonSet and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeDaemonSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewDeleteAction(daemonsetsResource, c.ns, name), &appsv1.DaemonSet{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeDaemonSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewDeleteCollectionAction(daemonsetsResource, c.ns, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &appsv1.DaemonSetList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched daemonSet. | |||||
| func (c *FakeDaemonSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *appsv1.DaemonSet, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, name, pt, data, subresources...), &appsv1.DaemonSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.DaemonSet), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied daemonSet. | |||||
| func (c *FakeDaemonSets) Apply(ctx context.Context, daemonSet *applyconfigurationsappsv1.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *appsv1.DaemonSet, err error) { | |||||
| if daemonSet == nil { | |||||
| return nil, fmt.Errorf("daemonSet provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(daemonSet) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := daemonSet.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("daemonSet.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data), &appsv1.DaemonSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.DaemonSet), err | |||||
| } | |||||
| // ApplyStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). | |||||
| func (c *FakeDaemonSets) ApplyStatus(ctx context.Context, daemonSet *applyconfigurationsappsv1.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *appsv1.DaemonSet, err error) { | |||||
| if daemonSet == nil { | |||||
| return nil, fmt.Errorf("daemonSet provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(daemonSet) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := daemonSet.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("daemonSet.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &appsv1.DaemonSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.DaemonSet), err | |||||
| } | |||||
| @@ -0,0 +1,213 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| appsv1 "k8s.io/api/apps/v1" | |||||
| autoscalingv1 "k8s.io/api/autoscaling/v1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| applyconfigurationsappsv1 "k8s.io/client-go/applyconfigurations/apps/v1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeDeployments implements DeploymentInterface | |||||
| type FakeDeployments struct { | |||||
| Fake *FakeAppsV1 | |||||
| ns string | |||||
| } | |||||
| var deploymentsResource = schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "deployments"} | |||||
| var deploymentsKind = schema.GroupVersionKind{Group: "apps", Version: "v1", Kind: "Deployment"} | |||||
| // Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any. | |||||
| func (c *FakeDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *appsv1.Deployment, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetAction(deploymentsResource, c.ns, name), &appsv1.Deployment{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.Deployment), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of Deployments that match those selectors. | |||||
| func (c *FakeDeployments) List(ctx context.Context, opts v1.ListOptions) (result *appsv1.DeploymentList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewListAction(deploymentsResource, deploymentsKind, c.ns, opts), &appsv1.DeploymentList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &appsv1.DeploymentList{ListMeta: obj.(*appsv1.DeploymentList).ListMeta} | |||||
| for _, item := range obj.(*appsv1.DeploymentList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested deployments. | |||||
| func (c *FakeDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewWatchAction(deploymentsResource, c.ns, opts)) | |||||
| } | |||||
| // Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any. | |||||
| func (c *FakeDeployments) Create(ctx context.Context, deployment *appsv1.Deployment, opts v1.CreateOptions) (result *appsv1.Deployment, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewCreateAction(deploymentsResource, c.ns, deployment), &appsv1.Deployment{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.Deployment), err | |||||
| } | |||||
| // Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any. | |||||
| func (c *FakeDeployments) Update(ctx context.Context, deployment *appsv1.Deployment, opts v1.UpdateOptions) (result *appsv1.Deployment, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateAction(deploymentsResource, c.ns, deployment), &appsv1.Deployment{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.Deployment), err | |||||
| } | |||||
| // UpdateStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). | |||||
| func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *appsv1.Deployment, opts v1.UpdateOptions) (*appsv1.Deployment, error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), &appsv1.Deployment{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.Deployment), err | |||||
| } | |||||
| // Delete takes name of the deployment and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeDeployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewDeleteAction(deploymentsResource, c.ns, name), &appsv1.Deployment{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewDeleteCollectionAction(deploymentsResource, c.ns, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &appsv1.DeploymentList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched deployment. | |||||
| func (c *FakeDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *appsv1.Deployment, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, name, pt, data, subresources...), &appsv1.Deployment{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.Deployment), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied deployment. | |||||
| func (c *FakeDeployments) Apply(ctx context.Context, deployment *applyconfigurationsappsv1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *appsv1.Deployment, err error) { | |||||
| if deployment == nil { | |||||
| return nil, fmt.Errorf("deployment provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(deployment) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := deployment.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("deployment.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data), &appsv1.Deployment{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.Deployment), err | |||||
| } | |||||
| // ApplyStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). | |||||
| func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *applyconfigurationsappsv1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *appsv1.Deployment, err error) { | |||||
| if deployment == nil { | |||||
| return nil, fmt.Errorf("deployment provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(deployment) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := deployment.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("deployment.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &appsv1.Deployment{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.Deployment), err | |||||
| } | |||||
| // GetScale takes name of the deployment, and returns the corresponding scale object, and an error if there is any. | |||||
| func (c *FakeDeployments) GetScale(ctx context.Context, deploymentName string, options v1.GetOptions) (result *autoscalingv1.Scale, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetSubresourceAction(deploymentsResource, c.ns, "scale", deploymentName), &autoscalingv1.Scale{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*autoscalingv1.Scale), err | |||||
| } | |||||
| // UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. | |||||
| func (c *FakeDeployments) UpdateScale(ctx context.Context, deploymentName string, scale *autoscalingv1.Scale, opts v1.UpdateOptions) (result *autoscalingv1.Scale, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "scale", c.ns, scale), &autoscalingv1.Scale{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*autoscalingv1.Scale), err | |||||
| } | |||||
| @@ -0,0 +1,213 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| appsv1 "k8s.io/api/apps/v1" | |||||
| autoscalingv1 "k8s.io/api/autoscaling/v1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| applyconfigurationsappsv1 "k8s.io/client-go/applyconfigurations/apps/v1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeReplicaSets implements ReplicaSetInterface | |||||
| type FakeReplicaSets struct { | |||||
| Fake *FakeAppsV1 | |||||
| ns string | |||||
| } | |||||
| var replicasetsResource = schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "replicasets"} | |||||
| var replicasetsKind = schema.GroupVersionKind{Group: "apps", Version: "v1", Kind: "ReplicaSet"} | |||||
| // Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any. | |||||
| func (c *FakeReplicaSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *appsv1.ReplicaSet, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetAction(replicasetsResource, c.ns, name), &appsv1.ReplicaSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.ReplicaSet), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. | |||||
| func (c *FakeReplicaSets) List(ctx context.Context, opts v1.ListOptions) (result *appsv1.ReplicaSetList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewListAction(replicasetsResource, replicasetsKind, c.ns, opts), &appsv1.ReplicaSetList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &appsv1.ReplicaSetList{ListMeta: obj.(*appsv1.ReplicaSetList).ListMeta} | |||||
| for _, item := range obj.(*appsv1.ReplicaSetList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested replicaSets. | |||||
| func (c *FakeReplicaSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewWatchAction(replicasetsResource, c.ns, opts)) | |||||
| } | |||||
| // Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any. | |||||
| func (c *FakeReplicaSets) Create(ctx context.Context, replicaSet *appsv1.ReplicaSet, opts v1.CreateOptions) (result *appsv1.ReplicaSet, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewCreateAction(replicasetsResource, c.ns, replicaSet), &appsv1.ReplicaSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.ReplicaSet), err | |||||
| } | |||||
| // Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any. | |||||
| func (c *FakeReplicaSets) Update(ctx context.Context, replicaSet *appsv1.ReplicaSet, opts v1.UpdateOptions) (result *appsv1.ReplicaSet, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateAction(replicasetsResource, c.ns, replicaSet), &appsv1.ReplicaSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.ReplicaSet), err | |||||
| } | |||||
| // UpdateStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). | |||||
| func (c *FakeReplicaSets) UpdateStatus(ctx context.Context, replicaSet *appsv1.ReplicaSet, opts v1.UpdateOptions) (*appsv1.ReplicaSet, error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "status", c.ns, replicaSet), &appsv1.ReplicaSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.ReplicaSet), err | |||||
| } | |||||
| // Delete takes name of the replicaSet and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeReplicaSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewDeleteAction(replicasetsResource, c.ns, name), &appsv1.ReplicaSet{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeReplicaSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewDeleteCollectionAction(replicasetsResource, c.ns, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &appsv1.ReplicaSetList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched replicaSet. | |||||
| func (c *FakeReplicaSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *appsv1.ReplicaSet, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, name, pt, data, subresources...), &appsv1.ReplicaSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.ReplicaSet), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied replicaSet. | |||||
| func (c *FakeReplicaSets) Apply(ctx context.Context, replicaSet *applyconfigurationsappsv1.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *appsv1.ReplicaSet, err error) { | |||||
| if replicaSet == nil { | |||||
| return nil, fmt.Errorf("replicaSet provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(replicaSet) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := replicaSet.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("replicaSet.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data), &appsv1.ReplicaSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.ReplicaSet), err | |||||
| } | |||||
| // ApplyStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). | |||||
| func (c *FakeReplicaSets) ApplyStatus(ctx context.Context, replicaSet *applyconfigurationsappsv1.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *appsv1.ReplicaSet, err error) { | |||||
| if replicaSet == nil { | |||||
| return nil, fmt.Errorf("replicaSet provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(replicaSet) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := replicaSet.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("replicaSet.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &appsv1.ReplicaSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.ReplicaSet), err | |||||
| } | |||||
| // GetScale takes name of the replicaSet, and returns the corresponding scale object, and an error if there is any. | |||||
| func (c *FakeReplicaSets) GetScale(ctx context.Context, replicaSetName string, options v1.GetOptions) (result *autoscalingv1.Scale, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetSubresourceAction(replicasetsResource, c.ns, "scale", replicaSetName), &autoscalingv1.Scale{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*autoscalingv1.Scale), err | |||||
| } | |||||
| // UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. | |||||
| func (c *FakeReplicaSets) UpdateScale(ctx context.Context, replicaSetName string, scale *autoscalingv1.Scale, opts v1.UpdateOptions) (result *autoscalingv1.Scale, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "scale", c.ns, scale), &autoscalingv1.Scale{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*autoscalingv1.Scale), err | |||||
| } | |||||
| @@ -0,0 +1,213 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| appsv1 "k8s.io/api/apps/v1" | |||||
| autoscalingv1 "k8s.io/api/autoscaling/v1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| applyconfigurationsappsv1 "k8s.io/client-go/applyconfigurations/apps/v1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeStatefulSets implements StatefulSetInterface | |||||
| type FakeStatefulSets struct { | |||||
| Fake *FakeAppsV1 | |||||
| ns string | |||||
| } | |||||
| var statefulsetsResource = schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "statefulsets"} | |||||
| var statefulsetsKind = schema.GroupVersionKind{Group: "apps", Version: "v1", Kind: "StatefulSet"} | |||||
| // Get takes name of the statefulSet, and returns the corresponding statefulSet object, and an error if there is any. | |||||
| func (c *FakeStatefulSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *appsv1.StatefulSet, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetAction(statefulsetsResource, c.ns, name), &appsv1.StatefulSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.StatefulSet), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of StatefulSets that match those selectors. | |||||
| func (c *FakeStatefulSets) List(ctx context.Context, opts v1.ListOptions) (result *appsv1.StatefulSetList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewListAction(statefulsetsResource, statefulsetsKind, c.ns, opts), &appsv1.StatefulSetList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &appsv1.StatefulSetList{ListMeta: obj.(*appsv1.StatefulSetList).ListMeta} | |||||
| for _, item := range obj.(*appsv1.StatefulSetList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested statefulSets. | |||||
| func (c *FakeStatefulSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewWatchAction(statefulsetsResource, c.ns, opts)) | |||||
| } | |||||
| // Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any. | |||||
| func (c *FakeStatefulSets) Create(ctx context.Context, statefulSet *appsv1.StatefulSet, opts v1.CreateOptions) (result *appsv1.StatefulSet, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewCreateAction(statefulsetsResource, c.ns, statefulSet), &appsv1.StatefulSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.StatefulSet), err | |||||
| } | |||||
| // Update takes the representation of a statefulSet and updates it. Returns the server's representation of the statefulSet, and an error, if there is any. | |||||
| func (c *FakeStatefulSets) Update(ctx context.Context, statefulSet *appsv1.StatefulSet, opts v1.UpdateOptions) (result *appsv1.StatefulSet, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateAction(statefulsetsResource, c.ns, statefulSet), &appsv1.StatefulSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.StatefulSet), err | |||||
| } | |||||
| // UpdateStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). | |||||
| func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *appsv1.StatefulSet, opts v1.UpdateOptions) (*appsv1.StatefulSet, error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "status", c.ns, statefulSet), &appsv1.StatefulSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.StatefulSet), err | |||||
| } | |||||
| // Delete takes name of the statefulSet and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeStatefulSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewDeleteAction(statefulsetsResource, c.ns, name), &appsv1.StatefulSet{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewDeleteCollectionAction(statefulsetsResource, c.ns, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &appsv1.StatefulSetList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched statefulSet. | |||||
| func (c *FakeStatefulSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *appsv1.StatefulSet, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, name, pt, data, subresources...), &appsv1.StatefulSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.StatefulSet), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied statefulSet. | |||||
| func (c *FakeStatefulSets) Apply(ctx context.Context, statefulSet *applyconfigurationsappsv1.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *appsv1.StatefulSet, err error) { | |||||
| if statefulSet == nil { | |||||
| return nil, fmt.Errorf("statefulSet provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(statefulSet) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := statefulSet.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data), &appsv1.StatefulSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.StatefulSet), err | |||||
| } | |||||
| // ApplyStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). | |||||
| func (c *FakeStatefulSets) ApplyStatus(ctx context.Context, statefulSet *applyconfigurationsappsv1.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *appsv1.StatefulSet, err error) { | |||||
| if statefulSet == nil { | |||||
| return nil, fmt.Errorf("statefulSet provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(statefulSet) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := statefulSet.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &appsv1.StatefulSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*appsv1.StatefulSet), err | |||||
| } | |||||
| // GetScale takes name of the statefulSet, and returns the corresponding scale object, and an error if there is any. | |||||
| func (c *FakeStatefulSets) GetScale(ctx context.Context, statefulSetName string, options v1.GetOptions) (result *autoscalingv1.Scale, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetSubresourceAction(statefulsetsResource, c.ns, "scale", statefulSetName), &autoscalingv1.Scale{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*autoscalingv1.Scale), err | |||||
| } | |||||
| // UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. | |||||
| func (c *FakeStatefulSets) UpdateScale(ctx context.Context, statefulSetName string, scale *autoscalingv1.Scale, opts v1.UpdateOptions) (result *autoscalingv1.Scale, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "scale", c.ns, scale), &autoscalingv1.Scale{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*autoscalingv1.Scale), err | |||||
| } | |||||
| @@ -0,0 +1,20 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| // Package fake has the automatically generated clients. | |||||
| package fake | |||||
| @@ -0,0 +1,48 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| v1beta1 "k8s.io/client-go/kubernetes/typed/apps/v1beta1" | |||||
| rest "k8s.io/client-go/rest" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| type FakeAppsV1beta1 struct { | |||||
| *testing.Fake | |||||
| } | |||||
| func (c *FakeAppsV1beta1) ControllerRevisions(namespace string) v1beta1.ControllerRevisionInterface { | |||||
| return &FakeControllerRevisions{c, namespace} | |||||
| } | |||||
| func (c *FakeAppsV1beta1) Deployments(namespace string) v1beta1.DeploymentInterface { | |||||
| return &FakeDeployments{c, namespace} | |||||
| } | |||||
| func (c *FakeAppsV1beta1) StatefulSets(namespace string) v1beta1.StatefulSetInterface { | |||||
| return &FakeStatefulSets{c, namespace} | |||||
| } | |||||
| // RESTClient returns a RESTClient that is used to communicate | |||||
| // with API server by this client implementation. | |||||
| func (c *FakeAppsV1beta1) RESTClient() rest.Interface { | |||||
| var ret *rest.RESTClient | |||||
| return ret | |||||
| } | |||||
| @@ -0,0 +1,155 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| v1beta1 "k8s.io/api/apps/v1beta1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeControllerRevisions implements ControllerRevisionInterface | |||||
| type FakeControllerRevisions struct { | |||||
| Fake *FakeAppsV1beta1 | |||||
| ns string | |||||
| } | |||||
| var controllerrevisionsResource = schema.GroupVersionResource{Group: "apps", Version: "v1beta1", Resource: "controllerrevisions"} | |||||
| var controllerrevisionsKind = schema.GroupVersionKind{Group: "apps", Version: "v1beta1", Kind: "ControllerRevision"} | |||||
| // Get takes name of the controllerRevision, and returns the corresponding controllerRevision object, and an error if there is any. | |||||
| func (c *FakeControllerRevisions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ControllerRevision, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetAction(controllerrevisionsResource, c.ns, name), &v1beta1.ControllerRevision{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.ControllerRevision), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. | |||||
| func (c *FakeControllerRevisions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ControllerRevisionList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewListAction(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), &v1beta1.ControllerRevisionList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &v1beta1.ControllerRevisionList{ListMeta: obj.(*v1beta1.ControllerRevisionList).ListMeta} | |||||
| for _, item := range obj.(*v1beta1.ControllerRevisionList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested controllerRevisions. | |||||
| func (c *FakeControllerRevisions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewWatchAction(controllerrevisionsResource, c.ns, opts)) | |||||
| } | |||||
| // Create takes the representation of a controllerRevision and creates it. Returns the server's representation of the controllerRevision, and an error, if there is any. | |||||
| func (c *FakeControllerRevisions) Create(ctx context.Context, controllerRevision *v1beta1.ControllerRevision, opts v1.CreateOptions) (result *v1beta1.ControllerRevision, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewCreateAction(controllerrevisionsResource, c.ns, controllerRevision), &v1beta1.ControllerRevision{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.ControllerRevision), err | |||||
| } | |||||
| // Update takes the representation of a controllerRevision and updates it. Returns the server's representation of the controllerRevision, and an error, if there is any. | |||||
| func (c *FakeControllerRevisions) Update(ctx context.Context, controllerRevision *v1beta1.ControllerRevision, opts v1.UpdateOptions) (result *v1beta1.ControllerRevision, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateAction(controllerrevisionsResource, c.ns, controllerRevision), &v1beta1.ControllerRevision{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.ControllerRevision), err | |||||
| } | |||||
| // Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewDeleteAction(controllerrevisionsResource, c.ns, name), &v1beta1.ControllerRevision{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewDeleteCollectionAction(controllerrevisionsResource, c.ns, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &v1beta1.ControllerRevisionList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched controllerRevision. | |||||
| func (c *FakeControllerRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ControllerRevision, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, name, pt, data, subresources...), &v1beta1.ControllerRevision{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.ControllerRevision), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied controllerRevision. | |||||
| func (c *FakeControllerRevisions) Apply(ctx context.Context, controllerRevision *appsv1beta1.ControllerRevisionApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ControllerRevision, err error) { | |||||
| if controllerRevision == nil { | |||||
| return nil, fmt.Errorf("controllerRevision provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(controllerRevision) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := controllerRevision.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("controllerRevision.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.ControllerRevision{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.ControllerRevision), err | |||||
| } | |||||
| @@ -0,0 +1,190 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| v1beta1 "k8s.io/api/apps/v1beta1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeDeployments implements DeploymentInterface | |||||
| type FakeDeployments struct { | |||||
| Fake *FakeAppsV1beta1 | |||||
| ns string | |||||
| } | |||||
| var deploymentsResource = schema.GroupVersionResource{Group: "apps", Version: "v1beta1", Resource: "deployments"} | |||||
| var deploymentsKind = schema.GroupVersionKind{Group: "apps", Version: "v1beta1", Kind: "Deployment"} | |||||
| // Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any. | |||||
| func (c *FakeDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Deployment, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetAction(deploymentsResource, c.ns, name), &v1beta1.Deployment{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.Deployment), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of Deployments that match those selectors. | |||||
| func (c *FakeDeployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewListAction(deploymentsResource, deploymentsKind, c.ns, opts), &v1beta1.DeploymentList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &v1beta1.DeploymentList{ListMeta: obj.(*v1beta1.DeploymentList).ListMeta} | |||||
| for _, item := range obj.(*v1beta1.DeploymentList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested deployments. | |||||
| func (c *FakeDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewWatchAction(deploymentsResource, c.ns, opts)) | |||||
| } | |||||
| // Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any. | |||||
| func (c *FakeDeployments) Create(ctx context.Context, deployment *v1beta1.Deployment, opts v1.CreateOptions) (result *v1beta1.Deployment, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewCreateAction(deploymentsResource, c.ns, deployment), &v1beta1.Deployment{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.Deployment), err | |||||
| } | |||||
| // Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any. | |||||
| func (c *FakeDeployments) Update(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (result *v1beta1.Deployment, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateAction(deploymentsResource, c.ns, deployment), &v1beta1.Deployment{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.Deployment), err | |||||
| } | |||||
| // UpdateStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). | |||||
| func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (*v1beta1.Deployment, error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), &v1beta1.Deployment{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.Deployment), err | |||||
| } | |||||
| // Delete takes name of the deployment and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeDeployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewDeleteAction(deploymentsResource, c.ns, name), &v1beta1.Deployment{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewDeleteCollectionAction(deploymentsResource, c.ns, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &v1beta1.DeploymentList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched deployment. | |||||
| func (c *FakeDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Deployment, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, name, pt, data, subresources...), &v1beta1.Deployment{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.Deployment), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied deployment. | |||||
| func (c *FakeDeployments) Apply(ctx context.Context, deployment *appsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error) { | |||||
| if deployment == nil { | |||||
| return nil, fmt.Errorf("deployment provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(deployment) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := deployment.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("deployment.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.Deployment{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.Deployment), err | |||||
| } | |||||
| // ApplyStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). | |||||
| func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *appsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error) { | |||||
| if deployment == nil { | |||||
| return nil, fmt.Errorf("deployment provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(deployment) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := deployment.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("deployment.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.Deployment{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.Deployment), err | |||||
| } | |||||
| @@ -0,0 +1,190 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| v1beta1 "k8s.io/api/apps/v1beta1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeStatefulSets implements StatefulSetInterface | |||||
| type FakeStatefulSets struct { | |||||
| Fake *FakeAppsV1beta1 | |||||
| ns string | |||||
| } | |||||
| var statefulsetsResource = schema.GroupVersionResource{Group: "apps", Version: "v1beta1", Resource: "statefulsets"} | |||||
| var statefulsetsKind = schema.GroupVersionKind{Group: "apps", Version: "v1beta1", Kind: "StatefulSet"} | |||||
| // Get takes name of the statefulSet, and returns the corresponding statefulSet object, and an error if there is any. | |||||
| func (c *FakeStatefulSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.StatefulSet, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetAction(statefulsetsResource, c.ns, name), &v1beta1.StatefulSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.StatefulSet), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of StatefulSets that match those selectors. | |||||
| func (c *FakeStatefulSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StatefulSetList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewListAction(statefulsetsResource, statefulsetsKind, c.ns, opts), &v1beta1.StatefulSetList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &v1beta1.StatefulSetList{ListMeta: obj.(*v1beta1.StatefulSetList).ListMeta} | |||||
| for _, item := range obj.(*v1beta1.StatefulSetList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested statefulSets. | |||||
| func (c *FakeStatefulSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewWatchAction(statefulsetsResource, c.ns, opts)) | |||||
| } | |||||
| // Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any. | |||||
| func (c *FakeStatefulSets) Create(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.CreateOptions) (result *v1beta1.StatefulSet, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewCreateAction(statefulsetsResource, c.ns, statefulSet), &v1beta1.StatefulSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.StatefulSet), err | |||||
| } | |||||
| // Update takes the representation of a statefulSet and updates it. Returns the server's representation of the statefulSet, and an error, if there is any. | |||||
| func (c *FakeStatefulSets) Update(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (result *v1beta1.StatefulSet, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateAction(statefulsetsResource, c.ns, statefulSet), &v1beta1.StatefulSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.StatefulSet), err | |||||
| } | |||||
| // UpdateStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). | |||||
| func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (*v1beta1.StatefulSet, error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "status", c.ns, statefulSet), &v1beta1.StatefulSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.StatefulSet), err | |||||
| } | |||||
| // Delete takes name of the statefulSet and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeStatefulSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewDeleteAction(statefulsetsResource, c.ns, name), &v1beta1.StatefulSet{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewDeleteCollectionAction(statefulsetsResource, c.ns, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &v1beta1.StatefulSetList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched statefulSet. | |||||
| func (c *FakeStatefulSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.StatefulSet, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, name, pt, data, subresources...), &v1beta1.StatefulSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.StatefulSet), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied statefulSet. | |||||
| func (c *FakeStatefulSets) Apply(ctx context.Context, statefulSet *appsv1beta1.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.StatefulSet, err error) { | |||||
| if statefulSet == nil { | |||||
| return nil, fmt.Errorf("statefulSet provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(statefulSet) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := statefulSet.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.StatefulSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.StatefulSet), err | |||||
| } | |||||
| // ApplyStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). | |||||
| func (c *FakeStatefulSets) ApplyStatus(ctx context.Context, statefulSet *appsv1beta1.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.StatefulSet, err error) { | |||||
| if statefulSet == nil { | |||||
| return nil, fmt.Errorf("statefulSet provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(statefulSet) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := statefulSet.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.StatefulSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.StatefulSet), err | |||||
| } | |||||
| @@ -0,0 +1,20 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| // Package fake has the automatically generated clients. | |||||
| package fake | |||||
| @@ -0,0 +1,56 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| v1beta2 "k8s.io/client-go/kubernetes/typed/apps/v1beta2" | |||||
| rest "k8s.io/client-go/rest" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| type FakeAppsV1beta2 struct { | |||||
| *testing.Fake | |||||
| } | |||||
| func (c *FakeAppsV1beta2) ControllerRevisions(namespace string) v1beta2.ControllerRevisionInterface { | |||||
| return &FakeControllerRevisions{c, namespace} | |||||
| } | |||||
| func (c *FakeAppsV1beta2) DaemonSets(namespace string) v1beta2.DaemonSetInterface { | |||||
| return &FakeDaemonSets{c, namespace} | |||||
| } | |||||
| func (c *FakeAppsV1beta2) Deployments(namespace string) v1beta2.DeploymentInterface { | |||||
| return &FakeDeployments{c, namespace} | |||||
| } | |||||
| func (c *FakeAppsV1beta2) ReplicaSets(namespace string) v1beta2.ReplicaSetInterface { | |||||
| return &FakeReplicaSets{c, namespace} | |||||
| } | |||||
| func (c *FakeAppsV1beta2) StatefulSets(namespace string) v1beta2.StatefulSetInterface { | |||||
| return &FakeStatefulSets{c, namespace} | |||||
| } | |||||
| // RESTClient returns a RESTClient that is used to communicate | |||||
| // with API server by this client implementation. | |||||
| func (c *FakeAppsV1beta2) RESTClient() rest.Interface { | |||||
| var ret *rest.RESTClient | |||||
| return ret | |||||
| } | |||||
| @@ -0,0 +1,155 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| v1beta2 "k8s.io/api/apps/v1beta2" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeControllerRevisions implements ControllerRevisionInterface | |||||
| type FakeControllerRevisions struct { | |||||
| Fake *FakeAppsV1beta2 | |||||
| ns string | |||||
| } | |||||
| var controllerrevisionsResource = schema.GroupVersionResource{Group: "apps", Version: "v1beta2", Resource: "controllerrevisions"} | |||||
| var controllerrevisionsKind = schema.GroupVersionKind{Group: "apps", Version: "v1beta2", Kind: "ControllerRevision"} | |||||
| // Get takes name of the controllerRevision, and returns the corresponding controllerRevision object, and an error if there is any. | |||||
| func (c *FakeControllerRevisions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.ControllerRevision, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetAction(controllerrevisionsResource, c.ns, name), &v1beta2.ControllerRevision{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.ControllerRevision), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. | |||||
| func (c *FakeControllerRevisions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ControllerRevisionList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewListAction(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), &v1beta2.ControllerRevisionList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &v1beta2.ControllerRevisionList{ListMeta: obj.(*v1beta2.ControllerRevisionList).ListMeta} | |||||
| for _, item := range obj.(*v1beta2.ControllerRevisionList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested controllerRevisions. | |||||
| func (c *FakeControllerRevisions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewWatchAction(controllerrevisionsResource, c.ns, opts)) | |||||
| } | |||||
| // Create takes the representation of a controllerRevision and creates it. Returns the server's representation of the controllerRevision, and an error, if there is any. | |||||
| func (c *FakeControllerRevisions) Create(ctx context.Context, controllerRevision *v1beta2.ControllerRevision, opts v1.CreateOptions) (result *v1beta2.ControllerRevision, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewCreateAction(controllerrevisionsResource, c.ns, controllerRevision), &v1beta2.ControllerRevision{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.ControllerRevision), err | |||||
| } | |||||
| // Update takes the representation of a controllerRevision and updates it. Returns the server's representation of the controllerRevision, and an error, if there is any. | |||||
| func (c *FakeControllerRevisions) Update(ctx context.Context, controllerRevision *v1beta2.ControllerRevision, opts v1.UpdateOptions) (result *v1beta2.ControllerRevision, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateAction(controllerrevisionsResource, c.ns, controllerRevision), &v1beta2.ControllerRevision{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.ControllerRevision), err | |||||
| } | |||||
| // Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewDeleteAction(controllerrevisionsResource, c.ns, name), &v1beta2.ControllerRevision{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewDeleteCollectionAction(controllerrevisionsResource, c.ns, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &v1beta2.ControllerRevisionList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched controllerRevision. | |||||
| func (c *FakeControllerRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ControllerRevision, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, name, pt, data, subresources...), &v1beta2.ControllerRevision{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.ControllerRevision), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied controllerRevision. | |||||
| func (c *FakeControllerRevisions) Apply(ctx context.Context, controllerRevision *appsv1beta2.ControllerRevisionApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.ControllerRevision, err error) { | |||||
| if controllerRevision == nil { | |||||
| return nil, fmt.Errorf("controllerRevision provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(controllerRevision) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := controllerRevision.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("controllerRevision.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta2.ControllerRevision{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.ControllerRevision), err | |||||
| } | |||||
| @@ -0,0 +1,190 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| v1beta2 "k8s.io/api/apps/v1beta2" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeDaemonSets implements DaemonSetInterface | |||||
| type FakeDaemonSets struct { | |||||
| Fake *FakeAppsV1beta2 | |||||
| ns string | |||||
| } | |||||
| var daemonsetsResource = schema.GroupVersionResource{Group: "apps", Version: "v1beta2", Resource: "daemonsets"} | |||||
| var daemonsetsKind = schema.GroupVersionKind{Group: "apps", Version: "v1beta2", Kind: "DaemonSet"} | |||||
| // Get takes name of the daemonSet, and returns the corresponding daemonSet object, and an error if there is any. | |||||
| func (c *FakeDaemonSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.DaemonSet, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetAction(daemonsetsResource, c.ns, name), &v1beta2.DaemonSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.DaemonSet), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of DaemonSets that match those selectors. | |||||
| func (c *FakeDaemonSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DaemonSetList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewListAction(daemonsetsResource, daemonsetsKind, c.ns, opts), &v1beta2.DaemonSetList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &v1beta2.DaemonSetList{ListMeta: obj.(*v1beta2.DaemonSetList).ListMeta} | |||||
| for _, item := range obj.(*v1beta2.DaemonSetList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested daemonSets. | |||||
| func (c *FakeDaemonSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewWatchAction(daemonsetsResource, c.ns, opts)) | |||||
| } | |||||
| // Create takes the representation of a daemonSet and creates it. Returns the server's representation of the daemonSet, and an error, if there is any. | |||||
| func (c *FakeDaemonSets) Create(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.CreateOptions) (result *v1beta2.DaemonSet, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewCreateAction(daemonsetsResource, c.ns, daemonSet), &v1beta2.DaemonSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.DaemonSet), err | |||||
| } | |||||
| // Update takes the representation of a daemonSet and updates it. Returns the server's representation of the daemonSet, and an error, if there is any. | |||||
| func (c *FakeDaemonSets) Update(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.UpdateOptions) (result *v1beta2.DaemonSet, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateAction(daemonsetsResource, c.ns, daemonSet), &v1beta2.DaemonSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.DaemonSet), err | |||||
| } | |||||
| // UpdateStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). | |||||
| func (c *FakeDaemonSets) UpdateStatus(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.UpdateOptions) (*v1beta2.DaemonSet, error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateSubresourceAction(daemonsetsResource, "status", c.ns, daemonSet), &v1beta2.DaemonSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.DaemonSet), err | |||||
| } | |||||
| // Delete takes name of the daemonSet and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeDaemonSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewDeleteAction(daemonsetsResource, c.ns, name), &v1beta2.DaemonSet{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeDaemonSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewDeleteCollectionAction(daemonsetsResource, c.ns, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &v1beta2.DaemonSetList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched daemonSet. | |||||
| func (c *FakeDaemonSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.DaemonSet, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, name, pt, data, subresources...), &v1beta2.DaemonSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.DaemonSet), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied daemonSet. | |||||
| func (c *FakeDaemonSets) Apply(ctx context.Context, daemonSet *appsv1beta2.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.DaemonSet, err error) { | |||||
| if daemonSet == nil { | |||||
| return nil, fmt.Errorf("daemonSet provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(daemonSet) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := daemonSet.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("daemonSet.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta2.DaemonSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.DaemonSet), err | |||||
| } | |||||
| // ApplyStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). | |||||
| func (c *FakeDaemonSets) ApplyStatus(ctx context.Context, daemonSet *appsv1beta2.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.DaemonSet, err error) { | |||||
| if daemonSet == nil { | |||||
| return nil, fmt.Errorf("daemonSet provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(daemonSet) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := daemonSet.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("daemonSet.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta2.DaemonSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.DaemonSet), err | |||||
| } | |||||
| @@ -0,0 +1,190 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| v1beta2 "k8s.io/api/apps/v1beta2" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeDeployments implements DeploymentInterface | |||||
| type FakeDeployments struct { | |||||
| Fake *FakeAppsV1beta2 | |||||
| ns string | |||||
| } | |||||
| var deploymentsResource = schema.GroupVersionResource{Group: "apps", Version: "v1beta2", Resource: "deployments"} | |||||
| var deploymentsKind = schema.GroupVersionKind{Group: "apps", Version: "v1beta2", Kind: "Deployment"} | |||||
| // Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any. | |||||
| func (c *FakeDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.Deployment, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetAction(deploymentsResource, c.ns, name), &v1beta2.Deployment{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.Deployment), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of Deployments that match those selectors. | |||||
| func (c *FakeDeployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DeploymentList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewListAction(deploymentsResource, deploymentsKind, c.ns, opts), &v1beta2.DeploymentList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &v1beta2.DeploymentList{ListMeta: obj.(*v1beta2.DeploymentList).ListMeta} | |||||
| for _, item := range obj.(*v1beta2.DeploymentList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested deployments. | |||||
| func (c *FakeDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewWatchAction(deploymentsResource, c.ns, opts)) | |||||
| } | |||||
| // Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any. | |||||
| func (c *FakeDeployments) Create(ctx context.Context, deployment *v1beta2.Deployment, opts v1.CreateOptions) (result *v1beta2.Deployment, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewCreateAction(deploymentsResource, c.ns, deployment), &v1beta2.Deployment{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.Deployment), err | |||||
| } | |||||
| // Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any. | |||||
| func (c *FakeDeployments) Update(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (result *v1beta2.Deployment, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateAction(deploymentsResource, c.ns, deployment), &v1beta2.Deployment{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.Deployment), err | |||||
| } | |||||
| // UpdateStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). | |||||
| func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (*v1beta2.Deployment, error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), &v1beta2.Deployment{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.Deployment), err | |||||
| } | |||||
| // Delete takes name of the deployment and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeDeployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewDeleteAction(deploymentsResource, c.ns, name), &v1beta2.Deployment{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewDeleteCollectionAction(deploymentsResource, c.ns, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &v1beta2.DeploymentList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched deployment. | |||||
| func (c *FakeDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.Deployment, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, name, pt, data, subresources...), &v1beta2.Deployment{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.Deployment), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied deployment. | |||||
| func (c *FakeDeployments) Apply(ctx context.Context, deployment *appsv1beta2.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.Deployment, err error) { | |||||
| if deployment == nil { | |||||
| return nil, fmt.Errorf("deployment provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(deployment) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := deployment.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("deployment.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta2.Deployment{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.Deployment), err | |||||
| } | |||||
| // ApplyStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). | |||||
| func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *appsv1beta2.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.Deployment, err error) { | |||||
| if deployment == nil { | |||||
| return nil, fmt.Errorf("deployment provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(deployment) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := deployment.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("deployment.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta2.Deployment{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.Deployment), err | |||||
| } | |||||
| @@ -0,0 +1,190 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| v1beta2 "k8s.io/api/apps/v1beta2" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeReplicaSets implements ReplicaSetInterface | |||||
| type FakeReplicaSets struct { | |||||
| Fake *FakeAppsV1beta2 | |||||
| ns string | |||||
| } | |||||
| var replicasetsResource = schema.GroupVersionResource{Group: "apps", Version: "v1beta2", Resource: "replicasets"} | |||||
| var replicasetsKind = schema.GroupVersionKind{Group: "apps", Version: "v1beta2", Kind: "ReplicaSet"} | |||||
| // Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any. | |||||
| func (c *FakeReplicaSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.ReplicaSet, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetAction(replicasetsResource, c.ns, name), &v1beta2.ReplicaSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.ReplicaSet), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. | |||||
| func (c *FakeReplicaSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ReplicaSetList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewListAction(replicasetsResource, replicasetsKind, c.ns, opts), &v1beta2.ReplicaSetList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &v1beta2.ReplicaSetList{ListMeta: obj.(*v1beta2.ReplicaSetList).ListMeta} | |||||
| for _, item := range obj.(*v1beta2.ReplicaSetList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested replicaSets. | |||||
| func (c *FakeReplicaSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewWatchAction(replicasetsResource, c.ns, opts)) | |||||
| } | |||||
| // Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any. | |||||
| func (c *FakeReplicaSets) Create(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.CreateOptions) (result *v1beta2.ReplicaSet, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewCreateAction(replicasetsResource, c.ns, replicaSet), &v1beta2.ReplicaSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.ReplicaSet), err | |||||
| } | |||||
| // Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any. | |||||
| func (c *FakeReplicaSets) Update(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (result *v1beta2.ReplicaSet, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateAction(replicasetsResource, c.ns, replicaSet), &v1beta2.ReplicaSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.ReplicaSet), err | |||||
| } | |||||
| // UpdateStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). | |||||
| func (c *FakeReplicaSets) UpdateStatus(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (*v1beta2.ReplicaSet, error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "status", c.ns, replicaSet), &v1beta2.ReplicaSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.ReplicaSet), err | |||||
| } | |||||
| // Delete takes name of the replicaSet and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeReplicaSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewDeleteAction(replicasetsResource, c.ns, name), &v1beta2.ReplicaSet{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeReplicaSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewDeleteCollectionAction(replicasetsResource, c.ns, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &v1beta2.ReplicaSetList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched replicaSet. | |||||
| func (c *FakeReplicaSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ReplicaSet, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, name, pt, data, subresources...), &v1beta2.ReplicaSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.ReplicaSet), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied replicaSet. | |||||
| func (c *FakeReplicaSets) Apply(ctx context.Context, replicaSet *appsv1beta2.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.ReplicaSet, err error) { | |||||
| if replicaSet == nil { | |||||
| return nil, fmt.Errorf("replicaSet provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(replicaSet) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := replicaSet.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("replicaSet.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta2.ReplicaSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.ReplicaSet), err | |||||
| } | |||||
| // ApplyStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). | |||||
| func (c *FakeReplicaSets) ApplyStatus(ctx context.Context, replicaSet *appsv1beta2.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.ReplicaSet, err error) { | |||||
| if replicaSet == nil { | |||||
| return nil, fmt.Errorf("replicaSet provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(replicaSet) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := replicaSet.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("replicaSet.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta2.ReplicaSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.ReplicaSet), err | |||||
| } | |||||
| @@ -0,0 +1,212 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| v1beta2 "k8s.io/api/apps/v1beta2" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeStatefulSets implements StatefulSetInterface | |||||
| type FakeStatefulSets struct { | |||||
| Fake *FakeAppsV1beta2 | |||||
| ns string | |||||
| } | |||||
| var statefulsetsResource = schema.GroupVersionResource{Group: "apps", Version: "v1beta2", Resource: "statefulsets"} | |||||
| var statefulsetsKind = schema.GroupVersionKind{Group: "apps", Version: "v1beta2", Kind: "StatefulSet"} | |||||
| // Get takes name of the statefulSet, and returns the corresponding statefulSet object, and an error if there is any. | |||||
| func (c *FakeStatefulSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.StatefulSet, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetAction(statefulsetsResource, c.ns, name), &v1beta2.StatefulSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.StatefulSet), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of StatefulSets that match those selectors. | |||||
| func (c *FakeStatefulSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.StatefulSetList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewListAction(statefulsetsResource, statefulsetsKind, c.ns, opts), &v1beta2.StatefulSetList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &v1beta2.StatefulSetList{ListMeta: obj.(*v1beta2.StatefulSetList).ListMeta} | |||||
| for _, item := range obj.(*v1beta2.StatefulSetList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested statefulSets. | |||||
| func (c *FakeStatefulSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewWatchAction(statefulsetsResource, c.ns, opts)) | |||||
| } | |||||
| // Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any. | |||||
| func (c *FakeStatefulSets) Create(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.CreateOptions) (result *v1beta2.StatefulSet, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewCreateAction(statefulsetsResource, c.ns, statefulSet), &v1beta2.StatefulSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.StatefulSet), err | |||||
| } | |||||
| // Update takes the representation of a statefulSet and updates it. Returns the server's representation of the statefulSet, and an error, if there is any. | |||||
| func (c *FakeStatefulSets) Update(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (result *v1beta2.StatefulSet, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateAction(statefulsetsResource, c.ns, statefulSet), &v1beta2.StatefulSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.StatefulSet), err | |||||
| } | |||||
| // UpdateStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). | |||||
| func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (*v1beta2.StatefulSet, error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "status", c.ns, statefulSet), &v1beta2.StatefulSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.StatefulSet), err | |||||
| } | |||||
| // Delete takes name of the statefulSet and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeStatefulSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewDeleteAction(statefulsetsResource, c.ns, name), &v1beta2.StatefulSet{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewDeleteCollectionAction(statefulsetsResource, c.ns, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &v1beta2.StatefulSetList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched statefulSet. | |||||
| func (c *FakeStatefulSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.StatefulSet, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, name, pt, data, subresources...), &v1beta2.StatefulSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.StatefulSet), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied statefulSet. | |||||
| func (c *FakeStatefulSets) Apply(ctx context.Context, statefulSet *appsv1beta2.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.StatefulSet, err error) { | |||||
| if statefulSet == nil { | |||||
| return nil, fmt.Errorf("statefulSet provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(statefulSet) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := statefulSet.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta2.StatefulSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.StatefulSet), err | |||||
| } | |||||
| // ApplyStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). | |||||
| func (c *FakeStatefulSets) ApplyStatus(ctx context.Context, statefulSet *appsv1beta2.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.StatefulSet, err error) { | |||||
| if statefulSet == nil { | |||||
| return nil, fmt.Errorf("statefulSet provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(statefulSet) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := statefulSet.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta2.StatefulSet{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.StatefulSet), err | |||||
| } | |||||
| // GetScale takes name of the statefulSet, and returns the corresponding scale object, and an error if there is any. | |||||
| func (c *FakeStatefulSets) GetScale(ctx context.Context, statefulSetName string, options v1.GetOptions) (result *v1beta2.Scale, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetSubresourceAction(statefulsetsResource, c.ns, "scale", statefulSetName), &v1beta2.Scale{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.Scale), err | |||||
| } | |||||
| // UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. | |||||
| func (c *FakeStatefulSets) UpdateScale(ctx context.Context, statefulSetName string, scale *v1beta2.Scale, opts v1.UpdateOptions) (result *v1beta2.Scale, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "scale", c.ns, scale), &v1beta2.Scale{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta2.Scale), err | |||||
| } | |||||
| @@ -0,0 +1,20 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| // Package fake has the automatically generated clients. | |||||
| package fake | |||||
| @@ -0,0 +1,40 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| v1 "k8s.io/client-go/kubernetes/typed/authentication/v1" | |||||
| rest "k8s.io/client-go/rest" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| type FakeAuthenticationV1 struct { | |||||
| *testing.Fake | |||||
| } | |||||
| func (c *FakeAuthenticationV1) TokenReviews() v1.TokenReviewInterface { | |||||
| return &FakeTokenReviews{c} | |||||
| } | |||||
| // RESTClient returns a RESTClient that is used to communicate | |||||
| // with API server by this client implementation. | |||||
| func (c *FakeAuthenticationV1) RESTClient() rest.Interface { | |||||
| var ret *rest.RESTClient | |||||
| return ret | |||||
| } | |||||
| @@ -0,0 +1,47 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| v1 "k8s.io/api/authentication/v1" | |||||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeTokenReviews implements TokenReviewInterface | |||||
| type FakeTokenReviews struct { | |||||
| Fake *FakeAuthenticationV1 | |||||
| } | |||||
| var tokenreviewsResource = schema.GroupVersionResource{Group: "authentication.k8s.io", Version: "v1", Resource: "tokenreviews"} | |||||
| var tokenreviewsKind = schema.GroupVersionKind{Group: "authentication.k8s.io", Version: "v1", Kind: "TokenReview"} | |||||
| // Create takes the representation of a tokenReview and creates it. Returns the server's representation of the tokenReview, and an error, if there is any. | |||||
| func (c *FakeTokenReviews) Create(ctx context.Context, tokenReview *v1.TokenReview, opts metav1.CreateOptions) (result *v1.TokenReview, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootCreateAction(tokenreviewsResource, tokenReview), &v1.TokenReview{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1.TokenReview), err | |||||
| } | |||||
| @@ -0,0 +1,20 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| // Package fake has the automatically generated clients. | |||||
| package fake | |||||
| @@ -0,0 +1,40 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| v1beta1 "k8s.io/client-go/kubernetes/typed/authentication/v1beta1" | |||||
| rest "k8s.io/client-go/rest" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| type FakeAuthenticationV1beta1 struct { | |||||
| *testing.Fake | |||||
| } | |||||
| func (c *FakeAuthenticationV1beta1) TokenReviews() v1beta1.TokenReviewInterface { | |||||
| return &FakeTokenReviews{c} | |||||
| } | |||||
| // RESTClient returns a RESTClient that is used to communicate | |||||
| // with API server by this client implementation. | |||||
| func (c *FakeAuthenticationV1beta1) RESTClient() rest.Interface { | |||||
| var ret *rest.RESTClient | |||||
| return ret | |||||
| } | |||||
| @@ -0,0 +1,47 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| v1beta1 "k8s.io/api/authentication/v1beta1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeTokenReviews implements TokenReviewInterface | |||||
| type FakeTokenReviews struct { | |||||
| Fake *FakeAuthenticationV1beta1 | |||||
| } | |||||
| var tokenreviewsResource = schema.GroupVersionResource{Group: "authentication.k8s.io", Version: "v1beta1", Resource: "tokenreviews"} | |||||
| var tokenreviewsKind = schema.GroupVersionKind{Group: "authentication.k8s.io", Version: "v1beta1", Kind: "TokenReview"} | |||||
| // Create takes the representation of a tokenReview and creates it. Returns the server's representation of the tokenReview, and an error, if there is any. | |||||
| func (c *FakeTokenReviews) Create(ctx context.Context, tokenReview *v1beta1.TokenReview, opts v1.CreateOptions) (result *v1beta1.TokenReview, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootCreateAction(tokenreviewsResource, tokenReview), &v1beta1.TokenReview{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.TokenReview), err | |||||
| } | |||||
| @@ -0,0 +1,20 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| // Package fake has the automatically generated clients. | |||||
| package fake | |||||
| @@ -0,0 +1,52 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| v1 "k8s.io/client-go/kubernetes/typed/authorization/v1" | |||||
| rest "k8s.io/client-go/rest" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| type FakeAuthorizationV1 struct { | |||||
| *testing.Fake | |||||
| } | |||||
| func (c *FakeAuthorizationV1) LocalSubjectAccessReviews(namespace string) v1.LocalSubjectAccessReviewInterface { | |||||
| return &FakeLocalSubjectAccessReviews{c, namespace} | |||||
| } | |||||
| func (c *FakeAuthorizationV1) SelfSubjectAccessReviews() v1.SelfSubjectAccessReviewInterface { | |||||
| return &FakeSelfSubjectAccessReviews{c} | |||||
| } | |||||
| func (c *FakeAuthorizationV1) SelfSubjectRulesReviews() v1.SelfSubjectRulesReviewInterface { | |||||
| return &FakeSelfSubjectRulesReviews{c} | |||||
| } | |||||
| func (c *FakeAuthorizationV1) SubjectAccessReviews() v1.SubjectAccessReviewInterface { | |||||
| return &FakeSubjectAccessReviews{c} | |||||
| } | |||||
| // RESTClient returns a RESTClient that is used to communicate | |||||
| // with API server by this client implementation. | |||||
| func (c *FakeAuthorizationV1) RESTClient() rest.Interface { | |||||
| var ret *rest.RESTClient | |||||
| return ret | |||||
| } | |||||
| @@ -0,0 +1,49 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| v1 "k8s.io/api/authorization/v1" | |||||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeLocalSubjectAccessReviews implements LocalSubjectAccessReviewInterface | |||||
| type FakeLocalSubjectAccessReviews struct { | |||||
| Fake *FakeAuthorizationV1 | |||||
| ns string | |||||
| } | |||||
| var localsubjectaccessreviewsResource = schema.GroupVersionResource{Group: "authorization.k8s.io", Version: "v1", Resource: "localsubjectaccessreviews"} | |||||
| var localsubjectaccessreviewsKind = schema.GroupVersionKind{Group: "authorization.k8s.io", Version: "v1", Kind: "LocalSubjectAccessReview"} | |||||
| // Create takes the representation of a localSubjectAccessReview and creates it. Returns the server's representation of the localSubjectAccessReview, and an error, if there is any. | |||||
| func (c *FakeLocalSubjectAccessReviews) Create(ctx context.Context, localSubjectAccessReview *v1.LocalSubjectAccessReview, opts metav1.CreateOptions) (result *v1.LocalSubjectAccessReview, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewCreateAction(localsubjectaccessreviewsResource, c.ns, localSubjectAccessReview), &v1.LocalSubjectAccessReview{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1.LocalSubjectAccessReview), err | |||||
| } | |||||
| @@ -0,0 +1,47 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| v1 "k8s.io/api/authorization/v1" | |||||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeSelfSubjectAccessReviews implements SelfSubjectAccessReviewInterface | |||||
| type FakeSelfSubjectAccessReviews struct { | |||||
| Fake *FakeAuthorizationV1 | |||||
| } | |||||
| var selfsubjectaccessreviewsResource = schema.GroupVersionResource{Group: "authorization.k8s.io", Version: "v1", Resource: "selfsubjectaccessreviews"} | |||||
| var selfsubjectaccessreviewsKind = schema.GroupVersionKind{Group: "authorization.k8s.io", Version: "v1", Kind: "SelfSubjectAccessReview"} | |||||
| // Create takes the representation of a selfSubjectAccessReview and creates it. Returns the server's representation of the selfSubjectAccessReview, and an error, if there is any. | |||||
| func (c *FakeSelfSubjectAccessReviews) Create(ctx context.Context, selfSubjectAccessReview *v1.SelfSubjectAccessReview, opts metav1.CreateOptions) (result *v1.SelfSubjectAccessReview, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootCreateAction(selfsubjectaccessreviewsResource, selfSubjectAccessReview), &v1.SelfSubjectAccessReview{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1.SelfSubjectAccessReview), err | |||||
| } | |||||
| @@ -0,0 +1,47 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| v1 "k8s.io/api/authorization/v1" | |||||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeSelfSubjectRulesReviews implements SelfSubjectRulesReviewInterface | |||||
| type FakeSelfSubjectRulesReviews struct { | |||||
| Fake *FakeAuthorizationV1 | |||||
| } | |||||
| var selfsubjectrulesreviewsResource = schema.GroupVersionResource{Group: "authorization.k8s.io", Version: "v1", Resource: "selfsubjectrulesreviews"} | |||||
| var selfsubjectrulesreviewsKind = schema.GroupVersionKind{Group: "authorization.k8s.io", Version: "v1", Kind: "SelfSubjectRulesReview"} | |||||
| // Create takes the representation of a selfSubjectRulesReview and creates it. Returns the server's representation of the selfSubjectRulesReview, and an error, if there is any. | |||||
| func (c *FakeSelfSubjectRulesReviews) Create(ctx context.Context, selfSubjectRulesReview *v1.SelfSubjectRulesReview, opts metav1.CreateOptions) (result *v1.SelfSubjectRulesReview, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootCreateAction(selfsubjectrulesreviewsResource, selfSubjectRulesReview), &v1.SelfSubjectRulesReview{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1.SelfSubjectRulesReview), err | |||||
| } | |||||
| @@ -0,0 +1,47 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| v1 "k8s.io/api/authorization/v1" | |||||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeSubjectAccessReviews implements SubjectAccessReviewInterface | |||||
| type FakeSubjectAccessReviews struct { | |||||
| Fake *FakeAuthorizationV1 | |||||
| } | |||||
| var subjectaccessreviewsResource = schema.GroupVersionResource{Group: "authorization.k8s.io", Version: "v1", Resource: "subjectaccessreviews"} | |||||
| var subjectaccessreviewsKind = schema.GroupVersionKind{Group: "authorization.k8s.io", Version: "v1", Kind: "SubjectAccessReview"} | |||||
| // Create takes the representation of a subjectAccessReview and creates it. Returns the server's representation of the subjectAccessReview, and an error, if there is any. | |||||
| func (c *FakeSubjectAccessReviews) Create(ctx context.Context, subjectAccessReview *v1.SubjectAccessReview, opts metav1.CreateOptions) (result *v1.SubjectAccessReview, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootCreateAction(subjectaccessreviewsResource, subjectAccessReview), &v1.SubjectAccessReview{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1.SubjectAccessReview), err | |||||
| } | |||||
| @@ -0,0 +1,20 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| // Package fake has the automatically generated clients. | |||||
| package fake | |||||
| @@ -0,0 +1,52 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| v1beta1 "k8s.io/client-go/kubernetes/typed/authorization/v1beta1" | |||||
| rest "k8s.io/client-go/rest" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| type FakeAuthorizationV1beta1 struct { | |||||
| *testing.Fake | |||||
| } | |||||
| func (c *FakeAuthorizationV1beta1) LocalSubjectAccessReviews(namespace string) v1beta1.LocalSubjectAccessReviewInterface { | |||||
| return &FakeLocalSubjectAccessReviews{c, namespace} | |||||
| } | |||||
| func (c *FakeAuthorizationV1beta1) SelfSubjectAccessReviews() v1beta1.SelfSubjectAccessReviewInterface { | |||||
| return &FakeSelfSubjectAccessReviews{c} | |||||
| } | |||||
| func (c *FakeAuthorizationV1beta1) SelfSubjectRulesReviews() v1beta1.SelfSubjectRulesReviewInterface { | |||||
| return &FakeSelfSubjectRulesReviews{c} | |||||
| } | |||||
| func (c *FakeAuthorizationV1beta1) SubjectAccessReviews() v1beta1.SubjectAccessReviewInterface { | |||||
| return &FakeSubjectAccessReviews{c} | |||||
| } | |||||
| // RESTClient returns a RESTClient that is used to communicate | |||||
| // with API server by this client implementation. | |||||
| func (c *FakeAuthorizationV1beta1) RESTClient() rest.Interface { | |||||
| var ret *rest.RESTClient | |||||
| return ret | |||||
| } | |||||
| @@ -0,0 +1,49 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| v1beta1 "k8s.io/api/authorization/v1beta1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeLocalSubjectAccessReviews implements LocalSubjectAccessReviewInterface | |||||
| type FakeLocalSubjectAccessReviews struct { | |||||
| Fake *FakeAuthorizationV1beta1 | |||||
| ns string | |||||
| } | |||||
| var localsubjectaccessreviewsResource = schema.GroupVersionResource{Group: "authorization.k8s.io", Version: "v1beta1", Resource: "localsubjectaccessreviews"} | |||||
| var localsubjectaccessreviewsKind = schema.GroupVersionKind{Group: "authorization.k8s.io", Version: "v1beta1", Kind: "LocalSubjectAccessReview"} | |||||
| // Create takes the representation of a localSubjectAccessReview and creates it. Returns the server's representation of the localSubjectAccessReview, and an error, if there is any. | |||||
| func (c *FakeLocalSubjectAccessReviews) Create(ctx context.Context, localSubjectAccessReview *v1beta1.LocalSubjectAccessReview, opts v1.CreateOptions) (result *v1beta1.LocalSubjectAccessReview, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewCreateAction(localsubjectaccessreviewsResource, c.ns, localSubjectAccessReview), &v1beta1.LocalSubjectAccessReview{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.LocalSubjectAccessReview), err | |||||
| } | |||||
| @@ -0,0 +1,47 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| v1beta1 "k8s.io/api/authorization/v1beta1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeSelfSubjectAccessReviews implements SelfSubjectAccessReviewInterface | |||||
| type FakeSelfSubjectAccessReviews struct { | |||||
| Fake *FakeAuthorizationV1beta1 | |||||
| } | |||||
| var selfsubjectaccessreviewsResource = schema.GroupVersionResource{Group: "authorization.k8s.io", Version: "v1beta1", Resource: "selfsubjectaccessreviews"} | |||||
| var selfsubjectaccessreviewsKind = schema.GroupVersionKind{Group: "authorization.k8s.io", Version: "v1beta1", Kind: "SelfSubjectAccessReview"} | |||||
| // Create takes the representation of a selfSubjectAccessReview and creates it. Returns the server's representation of the selfSubjectAccessReview, and an error, if there is any. | |||||
| func (c *FakeSelfSubjectAccessReviews) Create(ctx context.Context, selfSubjectAccessReview *v1beta1.SelfSubjectAccessReview, opts v1.CreateOptions) (result *v1beta1.SelfSubjectAccessReview, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootCreateAction(selfsubjectaccessreviewsResource, selfSubjectAccessReview), &v1beta1.SelfSubjectAccessReview{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.SelfSubjectAccessReview), err | |||||
| } | |||||
| @@ -0,0 +1,47 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| v1beta1 "k8s.io/api/authorization/v1beta1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeSelfSubjectRulesReviews implements SelfSubjectRulesReviewInterface | |||||
| type FakeSelfSubjectRulesReviews struct { | |||||
| Fake *FakeAuthorizationV1beta1 | |||||
| } | |||||
| var selfsubjectrulesreviewsResource = schema.GroupVersionResource{Group: "authorization.k8s.io", Version: "v1beta1", Resource: "selfsubjectrulesreviews"} | |||||
| var selfsubjectrulesreviewsKind = schema.GroupVersionKind{Group: "authorization.k8s.io", Version: "v1beta1", Kind: "SelfSubjectRulesReview"} | |||||
| // Create takes the representation of a selfSubjectRulesReview and creates it. Returns the server's representation of the selfSubjectRulesReview, and an error, if there is any. | |||||
| func (c *FakeSelfSubjectRulesReviews) Create(ctx context.Context, selfSubjectRulesReview *v1beta1.SelfSubjectRulesReview, opts v1.CreateOptions) (result *v1beta1.SelfSubjectRulesReview, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootCreateAction(selfsubjectrulesreviewsResource, selfSubjectRulesReview), &v1beta1.SelfSubjectRulesReview{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.SelfSubjectRulesReview), err | |||||
| } | |||||
| @@ -0,0 +1,47 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| v1beta1 "k8s.io/api/authorization/v1beta1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeSubjectAccessReviews implements SubjectAccessReviewInterface | |||||
| type FakeSubjectAccessReviews struct { | |||||
| Fake *FakeAuthorizationV1beta1 | |||||
| } | |||||
| var subjectaccessreviewsResource = schema.GroupVersionResource{Group: "authorization.k8s.io", Version: "v1beta1", Resource: "subjectaccessreviews"} | |||||
| var subjectaccessreviewsKind = schema.GroupVersionKind{Group: "authorization.k8s.io", Version: "v1beta1", Kind: "SubjectAccessReview"} | |||||
| // Create takes the representation of a subjectAccessReview and creates it. Returns the server's representation of the subjectAccessReview, and an error, if there is any. | |||||
| func (c *FakeSubjectAccessReviews) Create(ctx context.Context, subjectAccessReview *v1beta1.SubjectAccessReview, opts v1.CreateOptions) (result *v1beta1.SubjectAccessReview, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootCreateAction(subjectaccessreviewsResource, subjectAccessReview), &v1beta1.SubjectAccessReview{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.SubjectAccessReview), err | |||||
| } | |||||
| @@ -0,0 +1,20 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| // Package fake has the automatically generated clients. | |||||
| package fake | |||||
| @@ -0,0 +1,40 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| v1 "k8s.io/client-go/kubernetes/typed/autoscaling/v1" | |||||
| rest "k8s.io/client-go/rest" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| type FakeAutoscalingV1 struct { | |||||
| *testing.Fake | |||||
| } | |||||
| func (c *FakeAutoscalingV1) HorizontalPodAutoscalers(namespace string) v1.HorizontalPodAutoscalerInterface { | |||||
| return &FakeHorizontalPodAutoscalers{c, namespace} | |||||
| } | |||||
| // RESTClient returns a RESTClient that is used to communicate | |||||
| // with API server by this client implementation. | |||||
| func (c *FakeAutoscalingV1) RESTClient() rest.Interface { | |||||
| var ret *rest.RESTClient | |||||
| return ret | |||||
| } | |||||
| @@ -0,0 +1,190 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| autoscalingv1 "k8s.io/api/autoscaling/v1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeHorizontalPodAutoscalers implements HorizontalPodAutoscalerInterface | |||||
| type FakeHorizontalPodAutoscalers struct { | |||||
| Fake *FakeAutoscalingV1 | |||||
| ns string | |||||
| } | |||||
| var horizontalpodautoscalersResource = schema.GroupVersionResource{Group: "autoscaling", Version: "v1", Resource: "horizontalpodautoscalers"} | |||||
| var horizontalpodautoscalersKind = schema.GroupVersionKind{Group: "autoscaling", Version: "v1", Kind: "HorizontalPodAutoscaler"} | |||||
| // Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any. | |||||
| func (c *FakeHorizontalPodAutoscalers) Get(ctx context.Context, name string, options v1.GetOptions) (result *autoscalingv1.HorizontalPodAutoscaler, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetAction(horizontalpodautoscalersResource, c.ns, name), &autoscalingv1.HorizontalPodAutoscaler{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*autoscalingv1.HorizontalPodAutoscaler), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. | |||||
| func (c *FakeHorizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *autoscalingv1.HorizontalPodAutoscalerList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewListAction(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), &autoscalingv1.HorizontalPodAutoscalerList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &autoscalingv1.HorizontalPodAutoscalerList{ListMeta: obj.(*autoscalingv1.HorizontalPodAutoscalerList).ListMeta} | |||||
| for _, item := range obj.(*autoscalingv1.HorizontalPodAutoscalerList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. | |||||
| func (c *FakeHorizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewWatchAction(horizontalpodautoscalersResource, c.ns, opts)) | |||||
| } | |||||
| // Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. | |||||
| func (c *FakeHorizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *autoscalingv1.HorizontalPodAutoscaler, opts v1.CreateOptions) (result *autoscalingv1.HorizontalPodAutoscaler, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &autoscalingv1.HorizontalPodAutoscaler{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*autoscalingv1.HorizontalPodAutoscaler), err | |||||
| } | |||||
| // Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. | |||||
| func (c *FakeHorizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *autoscalingv1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *autoscalingv1.HorizontalPodAutoscaler, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &autoscalingv1.HorizontalPodAutoscaler{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*autoscalingv1.HorizontalPodAutoscaler), err | |||||
| } | |||||
| // UpdateStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). | |||||
| func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*autoscalingv1.HorizontalPodAutoscaler, error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), &autoscalingv1.HorizontalPodAutoscaler{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*autoscalingv1.HorizontalPodAutoscaler), err | |||||
| } | |||||
| // Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewDeleteAction(horizontalpodautoscalersResource, c.ns, name), &autoscalingv1.HorizontalPodAutoscaler{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewDeleteCollectionAction(horizontalpodautoscalersResource, c.ns, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &autoscalingv1.HorizontalPodAutoscalerList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched horizontalPodAutoscaler. | |||||
| func (c *FakeHorizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *autoscalingv1.HorizontalPodAutoscaler, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, pt, data, subresources...), &autoscalingv1.HorizontalPodAutoscaler{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*autoscalingv1.HorizontalPodAutoscaler), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied horizontalPodAutoscaler. | |||||
| func (c *FakeHorizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodAutoscaler *applyconfigurationsautoscalingv1.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *autoscalingv1.HorizontalPodAutoscaler, err error) { | |||||
| if horizontalPodAutoscaler == nil { | |||||
| return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(horizontalPodAutoscaler) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := horizontalPodAutoscaler.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data), &autoscalingv1.HorizontalPodAutoscaler{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*autoscalingv1.HorizontalPodAutoscaler), err | |||||
| } | |||||
| // ApplyStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). | |||||
| func (c *FakeHorizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizontalPodAutoscaler *applyconfigurationsautoscalingv1.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *autoscalingv1.HorizontalPodAutoscaler, err error) { | |||||
| if horizontalPodAutoscaler == nil { | |||||
| return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(horizontalPodAutoscaler) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := horizontalPodAutoscaler.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, "status"), &autoscalingv1.HorizontalPodAutoscaler{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*autoscalingv1.HorizontalPodAutoscaler), err | |||||
| } | |||||
| @@ -0,0 +1,20 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| // Package fake has the automatically generated clients. | |||||
| package fake | |||||
| @@ -0,0 +1,40 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| v2beta1 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1" | |||||
| rest "k8s.io/client-go/rest" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| type FakeAutoscalingV2beta1 struct { | |||||
| *testing.Fake | |||||
| } | |||||
| func (c *FakeAutoscalingV2beta1) HorizontalPodAutoscalers(namespace string) v2beta1.HorizontalPodAutoscalerInterface { | |||||
| return &FakeHorizontalPodAutoscalers{c, namespace} | |||||
| } | |||||
| // RESTClient returns a RESTClient that is used to communicate | |||||
| // with API server by this client implementation. | |||||
| func (c *FakeAutoscalingV2beta1) RESTClient() rest.Interface { | |||||
| var ret *rest.RESTClient | |||||
| return ret | |||||
| } | |||||
| @@ -0,0 +1,190 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| v2beta1 "k8s.io/api/autoscaling/v2beta1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| autoscalingv2beta1 "k8s.io/client-go/applyconfigurations/autoscaling/v2beta1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeHorizontalPodAutoscalers implements HorizontalPodAutoscalerInterface | |||||
| type FakeHorizontalPodAutoscalers struct { | |||||
| Fake *FakeAutoscalingV2beta1 | |||||
| ns string | |||||
| } | |||||
| var horizontalpodautoscalersResource = schema.GroupVersionResource{Group: "autoscaling", Version: "v2beta1", Resource: "horizontalpodautoscalers"} | |||||
| var horizontalpodautoscalersKind = schema.GroupVersionKind{Group: "autoscaling", Version: "v2beta1", Kind: "HorizontalPodAutoscaler"} | |||||
| // Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any. | |||||
| func (c *FakeHorizontalPodAutoscalers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetAction(horizontalpodautoscalersResource, c.ns, name), &v2beta1.HorizontalPodAutoscaler{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v2beta1.HorizontalPodAutoscaler), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. | |||||
| func (c *FakeHorizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2beta1.HorizontalPodAutoscalerList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewListAction(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), &v2beta1.HorizontalPodAutoscalerList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &v2beta1.HorizontalPodAutoscalerList{ListMeta: obj.(*v2beta1.HorizontalPodAutoscalerList).ListMeta} | |||||
| for _, item := range obj.(*v2beta1.HorizontalPodAutoscalerList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. | |||||
| func (c *FakeHorizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewWatchAction(horizontalpodautoscalersResource, c.ns, opts)) | |||||
| } | |||||
| // Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. | |||||
| func (c *FakeHorizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.CreateOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v2beta1.HorizontalPodAutoscaler{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v2beta1.HorizontalPodAutoscaler), err | |||||
| } | |||||
| // Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. | |||||
| func (c *FakeHorizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v2beta1.HorizontalPodAutoscaler{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v2beta1.HorizontalPodAutoscaler), err | |||||
| } | |||||
| // UpdateStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). | |||||
| func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2beta1.HorizontalPodAutoscaler, error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), &v2beta1.HorizontalPodAutoscaler{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v2beta1.HorizontalPodAutoscaler), err | |||||
| } | |||||
| // Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewDeleteAction(horizontalpodautoscalersResource, c.ns, name), &v2beta1.HorizontalPodAutoscaler{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewDeleteCollectionAction(horizontalpodautoscalersResource, c.ns, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &v2beta1.HorizontalPodAutoscalerList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched horizontalPodAutoscaler. | |||||
| func (c *FakeHorizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta1.HorizontalPodAutoscaler, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, pt, data, subresources...), &v2beta1.HorizontalPodAutoscaler{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v2beta1.HorizontalPodAutoscaler), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied horizontalPodAutoscaler. | |||||
| func (c *FakeHorizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta1.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { | |||||
| if horizontalPodAutoscaler == nil { | |||||
| return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(horizontalPodAutoscaler) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := horizontalPodAutoscaler.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data), &v2beta1.HorizontalPodAutoscaler{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v2beta1.HorizontalPodAutoscaler), err | |||||
| } | |||||
| // ApplyStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). | |||||
| func (c *FakeHorizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta1.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { | |||||
| if horizontalPodAutoscaler == nil { | |||||
| return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(horizontalPodAutoscaler) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := horizontalPodAutoscaler.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v2beta1.HorizontalPodAutoscaler{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v2beta1.HorizontalPodAutoscaler), err | |||||
| } | |||||
| @@ -0,0 +1,20 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| // Package fake has the automatically generated clients. | |||||
| package fake | |||||
| @@ -0,0 +1,40 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| v2beta2 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2" | |||||
| rest "k8s.io/client-go/rest" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| type FakeAutoscalingV2beta2 struct { | |||||
| *testing.Fake | |||||
| } | |||||
| func (c *FakeAutoscalingV2beta2) HorizontalPodAutoscalers(namespace string) v2beta2.HorizontalPodAutoscalerInterface { | |||||
| return &FakeHorizontalPodAutoscalers{c, namespace} | |||||
| } | |||||
| // RESTClient returns a RESTClient that is used to communicate | |||||
| // with API server by this client implementation. | |||||
| func (c *FakeAutoscalingV2beta2) RESTClient() rest.Interface { | |||||
| var ret *rest.RESTClient | |||||
| return ret | |||||
| } | |||||
| @@ -0,0 +1,190 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| v2beta2 "k8s.io/api/autoscaling/v2beta2" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| autoscalingv2beta2 "k8s.io/client-go/applyconfigurations/autoscaling/v2beta2" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeHorizontalPodAutoscalers implements HorizontalPodAutoscalerInterface | |||||
| type FakeHorizontalPodAutoscalers struct { | |||||
| Fake *FakeAutoscalingV2beta2 | |||||
| ns string | |||||
| } | |||||
| var horizontalpodautoscalersResource = schema.GroupVersionResource{Group: "autoscaling", Version: "v2beta2", Resource: "horizontalpodautoscalers"} | |||||
| var horizontalpodautoscalersKind = schema.GroupVersionKind{Group: "autoscaling", Version: "v2beta2", Kind: "HorizontalPodAutoscaler"} | |||||
| // Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any. | |||||
| func (c *FakeHorizontalPodAutoscalers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetAction(horizontalpodautoscalersResource, c.ns, name), &v2beta2.HorizontalPodAutoscaler{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v2beta2.HorizontalPodAutoscaler), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. | |||||
| func (c *FakeHorizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2beta2.HorizontalPodAutoscalerList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewListAction(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), &v2beta2.HorizontalPodAutoscalerList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &v2beta2.HorizontalPodAutoscalerList{ListMeta: obj.(*v2beta2.HorizontalPodAutoscalerList).ListMeta} | |||||
| for _, item := range obj.(*v2beta2.HorizontalPodAutoscalerList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. | |||||
| func (c *FakeHorizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewWatchAction(horizontalpodautoscalersResource, c.ns, opts)) | |||||
| } | |||||
| // Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. | |||||
| func (c *FakeHorizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.CreateOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v2beta2.HorizontalPodAutoscaler{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v2beta2.HorizontalPodAutoscaler), err | |||||
| } | |||||
| // Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. | |||||
| func (c *FakeHorizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v2beta2.HorizontalPodAutoscaler{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v2beta2.HorizontalPodAutoscaler), err | |||||
| } | |||||
| // UpdateStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). | |||||
| func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2beta2.HorizontalPodAutoscaler, error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), &v2beta2.HorizontalPodAutoscaler{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v2beta2.HorizontalPodAutoscaler), err | |||||
| } | |||||
| // Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewDeleteAction(horizontalpodautoscalersResource, c.ns, name), &v2beta2.HorizontalPodAutoscaler{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewDeleteCollectionAction(horizontalpodautoscalersResource, c.ns, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &v2beta2.HorizontalPodAutoscalerList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched horizontalPodAutoscaler. | |||||
| func (c *FakeHorizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta2.HorizontalPodAutoscaler, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, pt, data, subresources...), &v2beta2.HorizontalPodAutoscaler{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v2beta2.HorizontalPodAutoscaler), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied horizontalPodAutoscaler. | |||||
| func (c *FakeHorizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta2.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { | |||||
| if horizontalPodAutoscaler == nil { | |||||
| return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(horizontalPodAutoscaler) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := horizontalPodAutoscaler.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data), &v2beta2.HorizontalPodAutoscaler{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v2beta2.HorizontalPodAutoscaler), err | |||||
| } | |||||
| // ApplyStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). | |||||
| func (c *FakeHorizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta2.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { | |||||
| if horizontalPodAutoscaler == nil { | |||||
| return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(horizontalPodAutoscaler) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := horizontalPodAutoscaler.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v2beta2.HorizontalPodAutoscaler{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v2beta2.HorizontalPodAutoscaler), err | |||||
| } | |||||
| @@ -0,0 +1,20 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| // Package fake has the automatically generated clients. | |||||
| package fake | |||||
| @@ -0,0 +1,44 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| v1 "k8s.io/client-go/kubernetes/typed/batch/v1" | |||||
| rest "k8s.io/client-go/rest" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| type FakeBatchV1 struct { | |||||
| *testing.Fake | |||||
| } | |||||
| func (c *FakeBatchV1) CronJobs(namespace string) v1.CronJobInterface { | |||||
| return &FakeCronJobs{c, namespace} | |||||
| } | |||||
| func (c *FakeBatchV1) Jobs(namespace string) v1.JobInterface { | |||||
| return &FakeJobs{c, namespace} | |||||
| } | |||||
| // RESTClient returns a RESTClient that is used to communicate | |||||
| // with API server by this client implementation. | |||||
| func (c *FakeBatchV1) RESTClient() rest.Interface { | |||||
| var ret *rest.RESTClient | |||||
| return ret | |||||
| } | |||||
| @@ -0,0 +1,190 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| batchv1 "k8s.io/api/batch/v1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| applyconfigurationsbatchv1 "k8s.io/client-go/applyconfigurations/batch/v1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeCronJobs implements CronJobInterface | |||||
| type FakeCronJobs struct { | |||||
| Fake *FakeBatchV1 | |||||
| ns string | |||||
| } | |||||
| var cronjobsResource = schema.GroupVersionResource{Group: "batch", Version: "v1", Resource: "cronjobs"} | |||||
| var cronjobsKind = schema.GroupVersionKind{Group: "batch", Version: "v1", Kind: "CronJob"} | |||||
| // Get takes name of the cronJob, and returns the corresponding cronJob object, and an error if there is any. | |||||
| func (c *FakeCronJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *batchv1.CronJob, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetAction(cronjobsResource, c.ns, name), &batchv1.CronJob{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*batchv1.CronJob), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of CronJobs that match those selectors. | |||||
| func (c *FakeCronJobs) List(ctx context.Context, opts v1.ListOptions) (result *batchv1.CronJobList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewListAction(cronjobsResource, cronjobsKind, c.ns, opts), &batchv1.CronJobList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &batchv1.CronJobList{ListMeta: obj.(*batchv1.CronJobList).ListMeta} | |||||
| for _, item := range obj.(*batchv1.CronJobList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested cronJobs. | |||||
| func (c *FakeCronJobs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewWatchAction(cronjobsResource, c.ns, opts)) | |||||
| } | |||||
| // Create takes the representation of a cronJob and creates it. Returns the server's representation of the cronJob, and an error, if there is any. | |||||
| func (c *FakeCronJobs) Create(ctx context.Context, cronJob *batchv1.CronJob, opts v1.CreateOptions) (result *batchv1.CronJob, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewCreateAction(cronjobsResource, c.ns, cronJob), &batchv1.CronJob{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*batchv1.CronJob), err | |||||
| } | |||||
| // Update takes the representation of a cronJob and updates it. Returns the server's representation of the cronJob, and an error, if there is any. | |||||
| func (c *FakeCronJobs) Update(ctx context.Context, cronJob *batchv1.CronJob, opts v1.UpdateOptions) (result *batchv1.CronJob, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateAction(cronjobsResource, c.ns, cronJob), &batchv1.CronJob{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*batchv1.CronJob), err | |||||
| } | |||||
| // UpdateStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). | |||||
| func (c *FakeCronJobs) UpdateStatus(ctx context.Context, cronJob *batchv1.CronJob, opts v1.UpdateOptions) (*batchv1.CronJob, error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateSubresourceAction(cronjobsResource, "status", c.ns, cronJob), &batchv1.CronJob{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*batchv1.CronJob), err | |||||
| } | |||||
| // Delete takes name of the cronJob and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeCronJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewDeleteAction(cronjobsResource, c.ns, name), &batchv1.CronJob{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeCronJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewDeleteCollectionAction(cronjobsResource, c.ns, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &batchv1.CronJobList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched cronJob. | |||||
| func (c *FakeCronJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *batchv1.CronJob, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, name, pt, data, subresources...), &batchv1.CronJob{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*batchv1.CronJob), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied cronJob. | |||||
| func (c *FakeCronJobs) Apply(ctx context.Context, cronJob *applyconfigurationsbatchv1.CronJobApplyConfiguration, opts v1.ApplyOptions) (result *batchv1.CronJob, err error) { | |||||
| if cronJob == nil { | |||||
| return nil, fmt.Errorf("cronJob provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(cronJob) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := cronJob.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("cronJob.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, *name, types.ApplyPatchType, data), &batchv1.CronJob{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*batchv1.CronJob), err | |||||
| } | |||||
| // ApplyStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). | |||||
| func (c *FakeCronJobs) ApplyStatus(ctx context.Context, cronJob *applyconfigurationsbatchv1.CronJobApplyConfiguration, opts v1.ApplyOptions) (result *batchv1.CronJob, err error) { | |||||
| if cronJob == nil { | |||||
| return nil, fmt.Errorf("cronJob provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(cronJob) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := cronJob.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("cronJob.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &batchv1.CronJob{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*batchv1.CronJob), err | |||||
| } | |||||
| @@ -0,0 +1,190 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| batchv1 "k8s.io/api/batch/v1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| applyconfigurationsbatchv1 "k8s.io/client-go/applyconfigurations/batch/v1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeJobs implements JobInterface | |||||
| type FakeJobs struct { | |||||
| Fake *FakeBatchV1 | |||||
| ns string | |||||
| } | |||||
| var jobsResource = schema.GroupVersionResource{Group: "batch", Version: "v1", Resource: "jobs"} | |||||
| var jobsKind = schema.GroupVersionKind{Group: "batch", Version: "v1", Kind: "Job"} | |||||
| // Get takes name of the job, and returns the corresponding job object, and an error if there is any. | |||||
| func (c *FakeJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *batchv1.Job, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetAction(jobsResource, c.ns, name), &batchv1.Job{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*batchv1.Job), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of Jobs that match those selectors. | |||||
| func (c *FakeJobs) List(ctx context.Context, opts v1.ListOptions) (result *batchv1.JobList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewListAction(jobsResource, jobsKind, c.ns, opts), &batchv1.JobList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &batchv1.JobList{ListMeta: obj.(*batchv1.JobList).ListMeta} | |||||
| for _, item := range obj.(*batchv1.JobList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested jobs. | |||||
| func (c *FakeJobs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewWatchAction(jobsResource, c.ns, opts)) | |||||
| } | |||||
| // Create takes the representation of a job and creates it. Returns the server's representation of the job, and an error, if there is any. | |||||
| func (c *FakeJobs) Create(ctx context.Context, job *batchv1.Job, opts v1.CreateOptions) (result *batchv1.Job, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewCreateAction(jobsResource, c.ns, job), &batchv1.Job{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*batchv1.Job), err | |||||
| } | |||||
| // Update takes the representation of a job and updates it. Returns the server's representation of the job, and an error, if there is any. | |||||
| func (c *FakeJobs) Update(ctx context.Context, job *batchv1.Job, opts v1.UpdateOptions) (result *batchv1.Job, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateAction(jobsResource, c.ns, job), &batchv1.Job{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*batchv1.Job), err | |||||
| } | |||||
| // UpdateStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). | |||||
| func (c *FakeJobs) UpdateStatus(ctx context.Context, job *batchv1.Job, opts v1.UpdateOptions) (*batchv1.Job, error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateSubresourceAction(jobsResource, "status", c.ns, job), &batchv1.Job{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*batchv1.Job), err | |||||
| } | |||||
| // Delete takes name of the job and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewDeleteAction(jobsResource, c.ns, name), &batchv1.Job{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewDeleteCollectionAction(jobsResource, c.ns, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &batchv1.JobList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched job. | |||||
| func (c *FakeJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *batchv1.Job, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, name, pt, data, subresources...), &batchv1.Job{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*batchv1.Job), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied job. | |||||
| func (c *FakeJobs) Apply(ctx context.Context, job *applyconfigurationsbatchv1.JobApplyConfiguration, opts v1.ApplyOptions) (result *batchv1.Job, err error) { | |||||
| if job == nil { | |||||
| return nil, fmt.Errorf("job provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(job) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := job.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("job.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, *name, types.ApplyPatchType, data), &batchv1.Job{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*batchv1.Job), err | |||||
| } | |||||
| // ApplyStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). | |||||
| func (c *FakeJobs) ApplyStatus(ctx context.Context, job *applyconfigurationsbatchv1.JobApplyConfiguration, opts v1.ApplyOptions) (result *batchv1.Job, err error) { | |||||
| if job == nil { | |||||
| return nil, fmt.Errorf("job provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(job) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := job.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("job.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &batchv1.Job{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*batchv1.Job), err | |||||
| } | |||||
| @@ -0,0 +1,20 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| // Package fake has the automatically generated clients. | |||||
| package fake | |||||
| @@ -0,0 +1,40 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| v1beta1 "k8s.io/client-go/kubernetes/typed/batch/v1beta1" | |||||
| rest "k8s.io/client-go/rest" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| type FakeBatchV1beta1 struct { | |||||
| *testing.Fake | |||||
| } | |||||
| func (c *FakeBatchV1beta1) CronJobs(namespace string) v1beta1.CronJobInterface { | |||||
| return &FakeCronJobs{c, namespace} | |||||
| } | |||||
| // RESTClient returns a RESTClient that is used to communicate | |||||
| // with API server by this client implementation. | |||||
| func (c *FakeBatchV1beta1) RESTClient() rest.Interface { | |||||
| var ret *rest.RESTClient | |||||
| return ret | |||||
| } | |||||
| @@ -0,0 +1,190 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| v1beta1 "k8s.io/api/batch/v1beta1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| batchv1beta1 "k8s.io/client-go/applyconfigurations/batch/v1beta1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeCronJobs implements CronJobInterface | |||||
| type FakeCronJobs struct { | |||||
| Fake *FakeBatchV1beta1 | |||||
| ns string | |||||
| } | |||||
| var cronjobsResource = schema.GroupVersionResource{Group: "batch", Version: "v1beta1", Resource: "cronjobs"} | |||||
| var cronjobsKind = schema.GroupVersionKind{Group: "batch", Version: "v1beta1", Kind: "CronJob"} | |||||
| // Get takes name of the cronJob, and returns the corresponding cronJob object, and an error if there is any. | |||||
| func (c *FakeCronJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CronJob, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetAction(cronjobsResource, c.ns, name), &v1beta1.CronJob{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.CronJob), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of CronJobs that match those selectors. | |||||
| func (c *FakeCronJobs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CronJobList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewListAction(cronjobsResource, cronjobsKind, c.ns, opts), &v1beta1.CronJobList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &v1beta1.CronJobList{ListMeta: obj.(*v1beta1.CronJobList).ListMeta} | |||||
| for _, item := range obj.(*v1beta1.CronJobList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested cronJobs. | |||||
| func (c *FakeCronJobs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewWatchAction(cronjobsResource, c.ns, opts)) | |||||
| } | |||||
| // Create takes the representation of a cronJob and creates it. Returns the server's representation of the cronJob, and an error, if there is any. | |||||
| func (c *FakeCronJobs) Create(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.CreateOptions) (result *v1beta1.CronJob, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewCreateAction(cronjobsResource, c.ns, cronJob), &v1beta1.CronJob{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.CronJob), err | |||||
| } | |||||
| // Update takes the representation of a cronJob and updates it. Returns the server's representation of the cronJob, and an error, if there is any. | |||||
| func (c *FakeCronJobs) Update(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.UpdateOptions) (result *v1beta1.CronJob, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateAction(cronjobsResource, c.ns, cronJob), &v1beta1.CronJob{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.CronJob), err | |||||
| } | |||||
| // UpdateStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). | |||||
| func (c *FakeCronJobs) UpdateStatus(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.UpdateOptions) (*v1beta1.CronJob, error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateSubresourceAction(cronjobsResource, "status", c.ns, cronJob), &v1beta1.CronJob{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.CronJob), err | |||||
| } | |||||
| // Delete takes name of the cronJob and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeCronJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewDeleteAction(cronjobsResource, c.ns, name), &v1beta1.CronJob{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeCronJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewDeleteCollectionAction(cronjobsResource, c.ns, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &v1beta1.CronJobList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched cronJob. | |||||
| func (c *FakeCronJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CronJob, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, name, pt, data, subresources...), &v1beta1.CronJob{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.CronJob), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied cronJob. | |||||
| func (c *FakeCronJobs) Apply(ctx context.Context, cronJob *batchv1beta1.CronJobApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CronJob, err error) { | |||||
| if cronJob == nil { | |||||
| return nil, fmt.Errorf("cronJob provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(cronJob) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := cronJob.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("cronJob.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.CronJob{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.CronJob), err | |||||
| } | |||||
| // ApplyStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). | |||||
| func (c *FakeCronJobs) ApplyStatus(ctx context.Context, cronJob *batchv1beta1.CronJobApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CronJob, err error) { | |||||
| if cronJob == nil { | |||||
| return nil, fmt.Errorf("cronJob provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(cronJob) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := cronJob.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("cronJob.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.CronJob{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.CronJob), err | |||||
| } | |||||
| @@ -0,0 +1,20 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| // Package fake has the automatically generated clients. | |||||
| package fake | |||||
| @@ -0,0 +1,40 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| v1 "k8s.io/client-go/kubernetes/typed/certificates/v1" | |||||
| rest "k8s.io/client-go/rest" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| type FakeCertificatesV1 struct { | |||||
| *testing.Fake | |||||
| } | |||||
| func (c *FakeCertificatesV1) CertificateSigningRequests() v1.CertificateSigningRequestInterface { | |||||
| return &FakeCertificateSigningRequests{c} | |||||
| } | |||||
| // RESTClient returns a RESTClient that is used to communicate | |||||
| // with API server by this client implementation. | |||||
| func (c *FakeCertificatesV1) RESTClient() rest.Interface { | |||||
| var ret *rest.RESTClient | |||||
| return ret | |||||
| } | |||||
| @@ -0,0 +1,189 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| certificatesv1 "k8s.io/api/certificates/v1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| applyconfigurationscertificatesv1 "k8s.io/client-go/applyconfigurations/certificates/v1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeCertificateSigningRequests implements CertificateSigningRequestInterface | |||||
| type FakeCertificateSigningRequests struct { | |||||
| Fake *FakeCertificatesV1 | |||||
| } | |||||
| var certificatesigningrequestsResource = schema.GroupVersionResource{Group: "certificates.k8s.io", Version: "v1", Resource: "certificatesigningrequests"} | |||||
| var certificatesigningrequestsKind = schema.GroupVersionKind{Group: "certificates.k8s.io", Version: "v1", Kind: "CertificateSigningRequest"} | |||||
| // Get takes name of the certificateSigningRequest, and returns the corresponding certificateSigningRequest object, and an error if there is any. | |||||
| func (c *FakeCertificateSigningRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *certificatesv1.CertificateSigningRequest, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootGetAction(certificatesigningrequestsResource, name), &certificatesv1.CertificateSigningRequest{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*certificatesv1.CertificateSigningRequest), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors. | |||||
| func (c *FakeCertificateSigningRequests) List(ctx context.Context, opts v1.ListOptions) (result *certificatesv1.CertificateSigningRequestList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootListAction(certificatesigningrequestsResource, certificatesigningrequestsKind, opts), &certificatesv1.CertificateSigningRequestList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &certificatesv1.CertificateSigningRequestList{ListMeta: obj.(*certificatesv1.CertificateSigningRequestList).ListMeta} | |||||
| for _, item := range obj.(*certificatesv1.CertificateSigningRequestList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested certificateSigningRequests. | |||||
| func (c *FakeCertificateSigningRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewRootWatchAction(certificatesigningrequestsResource, opts)) | |||||
| } | |||||
| // Create takes the representation of a certificateSigningRequest and creates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. | |||||
| func (c *FakeCertificateSigningRequests) Create(ctx context.Context, certificateSigningRequest *certificatesv1.CertificateSigningRequest, opts v1.CreateOptions) (result *certificatesv1.CertificateSigningRequest, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootCreateAction(certificatesigningrequestsResource, certificateSigningRequest), &certificatesv1.CertificateSigningRequest{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*certificatesv1.CertificateSigningRequest), err | |||||
| } | |||||
| // Update takes the representation of a certificateSigningRequest and updates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. | |||||
| func (c *FakeCertificateSigningRequests) Update(ctx context.Context, certificateSigningRequest *certificatesv1.CertificateSigningRequest, opts v1.UpdateOptions) (result *certificatesv1.CertificateSigningRequest, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootUpdateAction(certificatesigningrequestsResource, certificateSigningRequest), &certificatesv1.CertificateSigningRequest{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*certificatesv1.CertificateSigningRequest), err | |||||
| } | |||||
| // UpdateStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). | |||||
| func (c *FakeCertificateSigningRequests) UpdateStatus(ctx context.Context, certificateSigningRequest *certificatesv1.CertificateSigningRequest, opts v1.UpdateOptions) (*certificatesv1.CertificateSigningRequest, error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootUpdateSubresourceAction(certificatesigningrequestsResource, "status", certificateSigningRequest), &certificatesv1.CertificateSigningRequest{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*certificatesv1.CertificateSigningRequest), err | |||||
| } | |||||
| // Delete takes name of the certificateSigningRequest and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeCertificateSigningRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewRootDeleteAction(certificatesigningrequestsResource, name), &certificatesv1.CertificateSigningRequest{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeCertificateSigningRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewRootDeleteCollectionAction(certificatesigningrequestsResource, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &certificatesv1.CertificateSigningRequestList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched certificateSigningRequest. | |||||
| func (c *FakeCertificateSigningRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *certificatesv1.CertificateSigningRequest, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootPatchSubresourceAction(certificatesigningrequestsResource, name, pt, data, subresources...), &certificatesv1.CertificateSigningRequest{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*certificatesv1.CertificateSigningRequest), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied certificateSigningRequest. | |||||
| func (c *FakeCertificateSigningRequests) Apply(ctx context.Context, certificateSigningRequest *applyconfigurationscertificatesv1.CertificateSigningRequestApplyConfiguration, opts v1.ApplyOptions) (result *certificatesv1.CertificateSigningRequest, err error) { | |||||
| if certificateSigningRequest == nil { | |||||
| return nil, fmt.Errorf("certificateSigningRequest provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(certificateSigningRequest) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := certificateSigningRequest.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("certificateSigningRequest.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootPatchSubresourceAction(certificatesigningrequestsResource, *name, types.ApplyPatchType, data), &certificatesv1.CertificateSigningRequest{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*certificatesv1.CertificateSigningRequest), err | |||||
| } | |||||
| // ApplyStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). | |||||
| func (c *FakeCertificateSigningRequests) ApplyStatus(ctx context.Context, certificateSigningRequest *applyconfigurationscertificatesv1.CertificateSigningRequestApplyConfiguration, opts v1.ApplyOptions) (result *certificatesv1.CertificateSigningRequest, err error) { | |||||
| if certificateSigningRequest == nil { | |||||
| return nil, fmt.Errorf("certificateSigningRequest provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(certificateSigningRequest) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := certificateSigningRequest.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("certificateSigningRequest.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootPatchSubresourceAction(certificatesigningrequestsResource, *name, types.ApplyPatchType, data, "status"), &certificatesv1.CertificateSigningRequest{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*certificatesv1.CertificateSigningRequest), err | |||||
| } | |||||
| // UpdateApproval takes the representation of a certificateSigningRequest and updates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. | |||||
| func (c *FakeCertificateSigningRequests) UpdateApproval(ctx context.Context, certificateSigningRequestName string, certificateSigningRequest *certificatesv1.CertificateSigningRequest, opts v1.UpdateOptions) (result *certificatesv1.CertificateSigningRequest, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootUpdateSubresourceAction(certificatesigningrequestsResource, "approval", certificateSigningRequest), &certificatesv1.CertificateSigningRequest{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*certificatesv1.CertificateSigningRequest), err | |||||
| } | |||||
| @@ -0,0 +1,20 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| // Package fake has the automatically generated clients. | |||||
| package fake | |||||
| @@ -0,0 +1,40 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| v1beta1 "k8s.io/client-go/kubernetes/typed/certificates/v1beta1" | |||||
| rest "k8s.io/client-go/rest" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| type FakeCertificatesV1beta1 struct { | |||||
| *testing.Fake | |||||
| } | |||||
| func (c *FakeCertificatesV1beta1) CertificateSigningRequests() v1beta1.CertificateSigningRequestInterface { | |||||
| return &FakeCertificateSigningRequests{c} | |||||
| } | |||||
| // RESTClient returns a RESTClient that is used to communicate | |||||
| // with API server by this client implementation. | |||||
| func (c *FakeCertificatesV1beta1) RESTClient() rest.Interface { | |||||
| var ret *rest.RESTClient | |||||
| return ret | |||||
| } | |||||
| @@ -0,0 +1,179 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| v1beta1 "k8s.io/api/certificates/v1beta1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| certificatesv1beta1 "k8s.io/client-go/applyconfigurations/certificates/v1beta1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeCertificateSigningRequests implements CertificateSigningRequestInterface | |||||
| type FakeCertificateSigningRequests struct { | |||||
| Fake *FakeCertificatesV1beta1 | |||||
| } | |||||
| var certificatesigningrequestsResource = schema.GroupVersionResource{Group: "certificates.k8s.io", Version: "v1beta1", Resource: "certificatesigningrequests"} | |||||
| var certificatesigningrequestsKind = schema.GroupVersionKind{Group: "certificates.k8s.io", Version: "v1beta1", Kind: "CertificateSigningRequest"} | |||||
| // Get takes name of the certificateSigningRequest, and returns the corresponding certificateSigningRequest object, and an error if there is any. | |||||
| func (c *FakeCertificateSigningRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CertificateSigningRequest, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootGetAction(certificatesigningrequestsResource, name), &v1beta1.CertificateSigningRequest{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.CertificateSigningRequest), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors. | |||||
| func (c *FakeCertificateSigningRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CertificateSigningRequestList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootListAction(certificatesigningrequestsResource, certificatesigningrequestsKind, opts), &v1beta1.CertificateSigningRequestList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &v1beta1.CertificateSigningRequestList{ListMeta: obj.(*v1beta1.CertificateSigningRequestList).ListMeta} | |||||
| for _, item := range obj.(*v1beta1.CertificateSigningRequestList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested certificateSigningRequests. | |||||
| func (c *FakeCertificateSigningRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewRootWatchAction(certificatesigningrequestsResource, opts)) | |||||
| } | |||||
| // Create takes the representation of a certificateSigningRequest and creates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. | |||||
| func (c *FakeCertificateSigningRequests) Create(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.CreateOptions) (result *v1beta1.CertificateSigningRequest, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootCreateAction(certificatesigningrequestsResource, certificateSigningRequest), &v1beta1.CertificateSigningRequest{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.CertificateSigningRequest), err | |||||
| } | |||||
| // Update takes the representation of a certificateSigningRequest and updates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. | |||||
| func (c *FakeCertificateSigningRequests) Update(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.UpdateOptions) (result *v1beta1.CertificateSigningRequest, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootUpdateAction(certificatesigningrequestsResource, certificateSigningRequest), &v1beta1.CertificateSigningRequest{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.CertificateSigningRequest), err | |||||
| } | |||||
| // UpdateStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). | |||||
| func (c *FakeCertificateSigningRequests) UpdateStatus(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.UpdateOptions) (*v1beta1.CertificateSigningRequest, error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootUpdateSubresourceAction(certificatesigningrequestsResource, "status", certificateSigningRequest), &v1beta1.CertificateSigningRequest{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.CertificateSigningRequest), err | |||||
| } | |||||
| // Delete takes name of the certificateSigningRequest and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeCertificateSigningRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewRootDeleteAction(certificatesigningrequestsResource, name), &v1beta1.CertificateSigningRequest{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeCertificateSigningRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewRootDeleteCollectionAction(certificatesigningrequestsResource, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &v1beta1.CertificateSigningRequestList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched certificateSigningRequest. | |||||
| func (c *FakeCertificateSigningRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CertificateSigningRequest, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootPatchSubresourceAction(certificatesigningrequestsResource, name, pt, data, subresources...), &v1beta1.CertificateSigningRequest{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.CertificateSigningRequest), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied certificateSigningRequest. | |||||
| func (c *FakeCertificateSigningRequests) Apply(ctx context.Context, certificateSigningRequest *certificatesv1beta1.CertificateSigningRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CertificateSigningRequest, err error) { | |||||
| if certificateSigningRequest == nil { | |||||
| return nil, fmt.Errorf("certificateSigningRequest provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(certificateSigningRequest) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := certificateSigningRequest.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("certificateSigningRequest.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootPatchSubresourceAction(certificatesigningrequestsResource, *name, types.ApplyPatchType, data), &v1beta1.CertificateSigningRequest{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.CertificateSigningRequest), err | |||||
| } | |||||
| // ApplyStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). | |||||
| func (c *FakeCertificateSigningRequests) ApplyStatus(ctx context.Context, certificateSigningRequest *certificatesv1beta1.CertificateSigningRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CertificateSigningRequest, err error) { | |||||
| if certificateSigningRequest == nil { | |||||
| return nil, fmt.Errorf("certificateSigningRequest provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(certificateSigningRequest) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := certificateSigningRequest.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("certificateSigningRequest.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootPatchSubresourceAction(certificatesigningrequestsResource, *name, types.ApplyPatchType, data, "status"), &v1beta1.CertificateSigningRequest{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.CertificateSigningRequest), err | |||||
| } | |||||
| @@ -0,0 +1,34 @@ | |||||
| /* | |||||
| Copyright 2017 The Kubernetes Authors. | |||||
| Licensed under the Apache License, Version 2.0 (the "License"); | |||||
| you may not use this file except in compliance with the License. | |||||
| You may obtain a copy of the License at | |||||
| http://www.apache.org/licenses/LICENSE-2.0 | |||||
| Unless required by applicable law or agreed to in writing, software | |||||
| distributed under the License is distributed on an "AS IS" BASIS, | |||||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
| See the License for the specific language governing permissions and | |||||
| limitations under the License. | |||||
| */ | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| certificates "k8s.io/api/certificates/v1beta1" | |||||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| core "k8s.io/client-go/testing" | |||||
| ) | |||||
| func (c *FakeCertificateSigningRequests) UpdateApproval(ctx context.Context, certificateSigningRequest *certificates.CertificateSigningRequest, opts metav1.UpdateOptions) (result *certificates.CertificateSigningRequest, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(core.NewRootUpdateSubresourceAction(certificatesigningrequestsResource, "approval", certificateSigningRequest), &certificates.CertificateSigningRequest{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*certificates.CertificateSigningRequest), err | |||||
| } | |||||
| @@ -0,0 +1,20 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| // Package fake has the automatically generated clients. | |||||
| package fake | |||||
| @@ -0,0 +1,40 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| v1 "k8s.io/client-go/kubernetes/typed/coordination/v1" | |||||
| rest "k8s.io/client-go/rest" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| type FakeCoordinationV1 struct { | |||||
| *testing.Fake | |||||
| } | |||||
| func (c *FakeCoordinationV1) Leases(namespace string) v1.LeaseInterface { | |||||
| return &FakeLeases{c, namespace} | |||||
| } | |||||
| // RESTClient returns a RESTClient that is used to communicate | |||||
| // with API server by this client implementation. | |||||
| func (c *FakeCoordinationV1) RESTClient() rest.Interface { | |||||
| var ret *rest.RESTClient | |||||
| return ret | |||||
| } | |||||
| @@ -0,0 +1,155 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| coordinationv1 "k8s.io/api/coordination/v1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| applyconfigurationscoordinationv1 "k8s.io/client-go/applyconfigurations/coordination/v1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeLeases implements LeaseInterface | |||||
| type FakeLeases struct { | |||||
| Fake *FakeCoordinationV1 | |||||
| ns string | |||||
| } | |||||
| var leasesResource = schema.GroupVersionResource{Group: "coordination.k8s.io", Version: "v1", Resource: "leases"} | |||||
| var leasesKind = schema.GroupVersionKind{Group: "coordination.k8s.io", Version: "v1", Kind: "Lease"} | |||||
| // Get takes name of the lease, and returns the corresponding lease object, and an error if there is any. | |||||
| func (c *FakeLeases) Get(ctx context.Context, name string, options v1.GetOptions) (result *coordinationv1.Lease, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetAction(leasesResource, c.ns, name), &coordinationv1.Lease{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*coordinationv1.Lease), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of Leases that match those selectors. | |||||
| func (c *FakeLeases) List(ctx context.Context, opts v1.ListOptions) (result *coordinationv1.LeaseList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewListAction(leasesResource, leasesKind, c.ns, opts), &coordinationv1.LeaseList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &coordinationv1.LeaseList{ListMeta: obj.(*coordinationv1.LeaseList).ListMeta} | |||||
| for _, item := range obj.(*coordinationv1.LeaseList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested leases. | |||||
| func (c *FakeLeases) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewWatchAction(leasesResource, c.ns, opts)) | |||||
| } | |||||
| // Create takes the representation of a lease and creates it. Returns the server's representation of the lease, and an error, if there is any. | |||||
| func (c *FakeLeases) Create(ctx context.Context, lease *coordinationv1.Lease, opts v1.CreateOptions) (result *coordinationv1.Lease, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewCreateAction(leasesResource, c.ns, lease), &coordinationv1.Lease{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*coordinationv1.Lease), err | |||||
| } | |||||
| // Update takes the representation of a lease and updates it. Returns the server's representation of the lease, and an error, if there is any. | |||||
| func (c *FakeLeases) Update(ctx context.Context, lease *coordinationv1.Lease, opts v1.UpdateOptions) (result *coordinationv1.Lease, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateAction(leasesResource, c.ns, lease), &coordinationv1.Lease{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*coordinationv1.Lease), err | |||||
| } | |||||
| // Delete takes name of the lease and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeLeases) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewDeleteAction(leasesResource, c.ns, name), &coordinationv1.Lease{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeLeases) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewDeleteCollectionAction(leasesResource, c.ns, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &coordinationv1.LeaseList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched lease. | |||||
| func (c *FakeLeases) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *coordinationv1.Lease, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(leasesResource, c.ns, name, pt, data, subresources...), &coordinationv1.Lease{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*coordinationv1.Lease), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied lease. | |||||
| func (c *FakeLeases) Apply(ctx context.Context, lease *applyconfigurationscoordinationv1.LeaseApplyConfiguration, opts v1.ApplyOptions) (result *coordinationv1.Lease, err error) { | |||||
| if lease == nil { | |||||
| return nil, fmt.Errorf("lease provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(lease) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := lease.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("lease.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(leasesResource, c.ns, *name, types.ApplyPatchType, data), &coordinationv1.Lease{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*coordinationv1.Lease), err | |||||
| } | |||||
| @@ -0,0 +1,20 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| // Package fake has the automatically generated clients. | |||||
| package fake | |||||
| @@ -0,0 +1,40 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| v1beta1 "k8s.io/client-go/kubernetes/typed/coordination/v1beta1" | |||||
| rest "k8s.io/client-go/rest" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| type FakeCoordinationV1beta1 struct { | |||||
| *testing.Fake | |||||
| } | |||||
| func (c *FakeCoordinationV1beta1) Leases(namespace string) v1beta1.LeaseInterface { | |||||
| return &FakeLeases{c, namespace} | |||||
| } | |||||
| // RESTClient returns a RESTClient that is used to communicate | |||||
| // with API server by this client implementation. | |||||
| func (c *FakeCoordinationV1beta1) RESTClient() rest.Interface { | |||||
| var ret *rest.RESTClient | |||||
| return ret | |||||
| } | |||||
| @@ -0,0 +1,155 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| v1beta1 "k8s.io/api/coordination/v1beta1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| coordinationv1beta1 "k8s.io/client-go/applyconfigurations/coordination/v1beta1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeLeases implements LeaseInterface | |||||
| type FakeLeases struct { | |||||
| Fake *FakeCoordinationV1beta1 | |||||
| ns string | |||||
| } | |||||
| var leasesResource = schema.GroupVersionResource{Group: "coordination.k8s.io", Version: "v1beta1", Resource: "leases"} | |||||
| var leasesKind = schema.GroupVersionKind{Group: "coordination.k8s.io", Version: "v1beta1", Kind: "Lease"} | |||||
| // Get takes name of the lease, and returns the corresponding lease object, and an error if there is any. | |||||
| func (c *FakeLeases) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Lease, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetAction(leasesResource, c.ns, name), &v1beta1.Lease{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.Lease), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of Leases that match those selectors. | |||||
| func (c *FakeLeases) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.LeaseList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewListAction(leasesResource, leasesKind, c.ns, opts), &v1beta1.LeaseList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &v1beta1.LeaseList{ListMeta: obj.(*v1beta1.LeaseList).ListMeta} | |||||
| for _, item := range obj.(*v1beta1.LeaseList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested leases. | |||||
| func (c *FakeLeases) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewWatchAction(leasesResource, c.ns, opts)) | |||||
| } | |||||
| // Create takes the representation of a lease and creates it. Returns the server's representation of the lease, and an error, if there is any. | |||||
| func (c *FakeLeases) Create(ctx context.Context, lease *v1beta1.Lease, opts v1.CreateOptions) (result *v1beta1.Lease, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewCreateAction(leasesResource, c.ns, lease), &v1beta1.Lease{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.Lease), err | |||||
| } | |||||
| // Update takes the representation of a lease and updates it. Returns the server's representation of the lease, and an error, if there is any. | |||||
| func (c *FakeLeases) Update(ctx context.Context, lease *v1beta1.Lease, opts v1.UpdateOptions) (result *v1beta1.Lease, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateAction(leasesResource, c.ns, lease), &v1beta1.Lease{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.Lease), err | |||||
| } | |||||
| // Delete takes name of the lease and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeLeases) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewDeleteAction(leasesResource, c.ns, name), &v1beta1.Lease{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeLeases) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewDeleteCollectionAction(leasesResource, c.ns, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &v1beta1.LeaseList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched lease. | |||||
| func (c *FakeLeases) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Lease, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(leasesResource, c.ns, name, pt, data, subresources...), &v1beta1.Lease{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.Lease), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied lease. | |||||
| func (c *FakeLeases) Apply(ctx context.Context, lease *coordinationv1beta1.LeaseApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Lease, err error) { | |||||
| if lease == nil { | |||||
| return nil, fmt.Errorf("lease provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(lease) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := lease.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("lease.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(leasesResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.Lease{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1beta1.Lease), err | |||||
| } | |||||
| @@ -0,0 +1,20 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| // Package fake has the automatically generated clients. | |||||
| package fake | |||||
| @@ -0,0 +1,146 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| corev1 "k8s.io/api/core/v1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeComponentStatuses implements ComponentStatusInterface | |||||
| type FakeComponentStatuses struct { | |||||
| Fake *FakeCoreV1 | |||||
| } | |||||
| var componentstatusesResource = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "componentstatuses"} | |||||
| var componentstatusesKind = schema.GroupVersionKind{Group: "", Version: "v1", Kind: "ComponentStatus"} | |||||
| // Get takes name of the componentStatus, and returns the corresponding componentStatus object, and an error if there is any. | |||||
| func (c *FakeComponentStatuses) Get(ctx context.Context, name string, options v1.GetOptions) (result *corev1.ComponentStatus, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootGetAction(componentstatusesResource, name), &corev1.ComponentStatus{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.ComponentStatus), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of ComponentStatuses that match those selectors. | |||||
| func (c *FakeComponentStatuses) List(ctx context.Context, opts v1.ListOptions) (result *corev1.ComponentStatusList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootListAction(componentstatusesResource, componentstatusesKind, opts), &corev1.ComponentStatusList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &corev1.ComponentStatusList{ListMeta: obj.(*corev1.ComponentStatusList).ListMeta} | |||||
| for _, item := range obj.(*corev1.ComponentStatusList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested componentStatuses. | |||||
| func (c *FakeComponentStatuses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewRootWatchAction(componentstatusesResource, opts)) | |||||
| } | |||||
| // Create takes the representation of a componentStatus and creates it. Returns the server's representation of the componentStatus, and an error, if there is any. | |||||
| func (c *FakeComponentStatuses) Create(ctx context.Context, componentStatus *corev1.ComponentStatus, opts v1.CreateOptions) (result *corev1.ComponentStatus, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootCreateAction(componentstatusesResource, componentStatus), &corev1.ComponentStatus{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.ComponentStatus), err | |||||
| } | |||||
| // Update takes the representation of a componentStatus and updates it. Returns the server's representation of the componentStatus, and an error, if there is any. | |||||
| func (c *FakeComponentStatuses) Update(ctx context.Context, componentStatus *corev1.ComponentStatus, opts v1.UpdateOptions) (result *corev1.ComponentStatus, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootUpdateAction(componentstatusesResource, componentStatus), &corev1.ComponentStatus{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.ComponentStatus), err | |||||
| } | |||||
| // Delete takes name of the componentStatus and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeComponentStatuses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewRootDeleteAction(componentstatusesResource, name), &corev1.ComponentStatus{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeComponentStatuses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewRootDeleteCollectionAction(componentstatusesResource, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &corev1.ComponentStatusList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched componentStatus. | |||||
| func (c *FakeComponentStatuses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1.ComponentStatus, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootPatchSubresourceAction(componentstatusesResource, name, pt, data, subresources...), &corev1.ComponentStatus{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.ComponentStatus), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied componentStatus. | |||||
| func (c *FakeComponentStatuses) Apply(ctx context.Context, componentStatus *applyconfigurationscorev1.ComponentStatusApplyConfiguration, opts v1.ApplyOptions) (result *corev1.ComponentStatus, err error) { | |||||
| if componentStatus == nil { | |||||
| return nil, fmt.Errorf("componentStatus provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(componentStatus) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := componentStatus.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("componentStatus.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootPatchSubresourceAction(componentstatusesResource, *name, types.ApplyPatchType, data), &corev1.ComponentStatus{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.ComponentStatus), err | |||||
| } | |||||
| @@ -0,0 +1,155 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| corev1 "k8s.io/api/core/v1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeConfigMaps implements ConfigMapInterface | |||||
| type FakeConfigMaps struct { | |||||
| Fake *FakeCoreV1 | |||||
| ns string | |||||
| } | |||||
| var configmapsResource = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "configmaps"} | |||||
| var configmapsKind = schema.GroupVersionKind{Group: "", Version: "v1", Kind: "ConfigMap"} | |||||
| // Get takes name of the configMap, and returns the corresponding configMap object, and an error if there is any. | |||||
| func (c *FakeConfigMaps) Get(ctx context.Context, name string, options v1.GetOptions) (result *corev1.ConfigMap, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetAction(configmapsResource, c.ns, name), &corev1.ConfigMap{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.ConfigMap), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of ConfigMaps that match those selectors. | |||||
| func (c *FakeConfigMaps) List(ctx context.Context, opts v1.ListOptions) (result *corev1.ConfigMapList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewListAction(configmapsResource, configmapsKind, c.ns, opts), &corev1.ConfigMapList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &corev1.ConfigMapList{ListMeta: obj.(*corev1.ConfigMapList).ListMeta} | |||||
| for _, item := range obj.(*corev1.ConfigMapList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested configMaps. | |||||
| func (c *FakeConfigMaps) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewWatchAction(configmapsResource, c.ns, opts)) | |||||
| } | |||||
| // Create takes the representation of a configMap and creates it. Returns the server's representation of the configMap, and an error, if there is any. | |||||
| func (c *FakeConfigMaps) Create(ctx context.Context, configMap *corev1.ConfigMap, opts v1.CreateOptions) (result *corev1.ConfigMap, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewCreateAction(configmapsResource, c.ns, configMap), &corev1.ConfigMap{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.ConfigMap), err | |||||
| } | |||||
| // Update takes the representation of a configMap and updates it. Returns the server's representation of the configMap, and an error, if there is any. | |||||
| func (c *FakeConfigMaps) Update(ctx context.Context, configMap *corev1.ConfigMap, opts v1.UpdateOptions) (result *corev1.ConfigMap, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateAction(configmapsResource, c.ns, configMap), &corev1.ConfigMap{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.ConfigMap), err | |||||
| } | |||||
| // Delete takes name of the configMap and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeConfigMaps) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewDeleteAction(configmapsResource, c.ns, name), &corev1.ConfigMap{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeConfigMaps) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewDeleteCollectionAction(configmapsResource, c.ns, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &corev1.ConfigMapList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched configMap. | |||||
| func (c *FakeConfigMaps) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1.ConfigMap, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(configmapsResource, c.ns, name, pt, data, subresources...), &corev1.ConfigMap{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.ConfigMap), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied configMap. | |||||
| func (c *FakeConfigMaps) Apply(ctx context.Context, configMap *applyconfigurationscorev1.ConfigMapApplyConfiguration, opts v1.ApplyOptions) (result *corev1.ConfigMap, err error) { | |||||
| if configMap == nil { | |||||
| return nil, fmt.Errorf("configMap provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(configMap) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := configMap.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("configMap.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(configmapsResource, c.ns, *name, types.ApplyPatchType, data), &corev1.ConfigMap{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.ConfigMap), err | |||||
| } | |||||
| @@ -0,0 +1,100 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| v1 "k8s.io/client-go/kubernetes/typed/core/v1" | |||||
| rest "k8s.io/client-go/rest" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| type FakeCoreV1 struct { | |||||
| *testing.Fake | |||||
| } | |||||
| func (c *FakeCoreV1) ComponentStatuses() v1.ComponentStatusInterface { | |||||
| return &FakeComponentStatuses{c} | |||||
| } | |||||
| func (c *FakeCoreV1) ConfigMaps(namespace string) v1.ConfigMapInterface { | |||||
| return &FakeConfigMaps{c, namespace} | |||||
| } | |||||
| func (c *FakeCoreV1) Endpoints(namespace string) v1.EndpointsInterface { | |||||
| return &FakeEndpoints{c, namespace} | |||||
| } | |||||
| func (c *FakeCoreV1) Events(namespace string) v1.EventInterface { | |||||
| return &FakeEvents{c, namespace} | |||||
| } | |||||
| func (c *FakeCoreV1) LimitRanges(namespace string) v1.LimitRangeInterface { | |||||
| return &FakeLimitRanges{c, namespace} | |||||
| } | |||||
| func (c *FakeCoreV1) Namespaces() v1.NamespaceInterface { | |||||
| return &FakeNamespaces{c} | |||||
| } | |||||
| func (c *FakeCoreV1) Nodes() v1.NodeInterface { | |||||
| return &FakeNodes{c} | |||||
| } | |||||
| func (c *FakeCoreV1) PersistentVolumes() v1.PersistentVolumeInterface { | |||||
| return &FakePersistentVolumes{c} | |||||
| } | |||||
| func (c *FakeCoreV1) PersistentVolumeClaims(namespace string) v1.PersistentVolumeClaimInterface { | |||||
| return &FakePersistentVolumeClaims{c, namespace} | |||||
| } | |||||
| func (c *FakeCoreV1) Pods(namespace string) v1.PodInterface { | |||||
| return &FakePods{c, namespace} | |||||
| } | |||||
| func (c *FakeCoreV1) PodTemplates(namespace string) v1.PodTemplateInterface { | |||||
| return &FakePodTemplates{c, namespace} | |||||
| } | |||||
| func (c *FakeCoreV1) ReplicationControllers(namespace string) v1.ReplicationControllerInterface { | |||||
| return &FakeReplicationControllers{c, namespace} | |||||
| } | |||||
| func (c *FakeCoreV1) ResourceQuotas(namespace string) v1.ResourceQuotaInterface { | |||||
| return &FakeResourceQuotas{c, namespace} | |||||
| } | |||||
| func (c *FakeCoreV1) Secrets(namespace string) v1.SecretInterface { | |||||
| return &FakeSecrets{c, namespace} | |||||
| } | |||||
| func (c *FakeCoreV1) Services(namespace string) v1.ServiceInterface { | |||||
| return &FakeServices{c, namespace} | |||||
| } | |||||
| func (c *FakeCoreV1) ServiceAccounts(namespace string) v1.ServiceAccountInterface { | |||||
| return &FakeServiceAccounts{c, namespace} | |||||
| } | |||||
| // RESTClient returns a RESTClient that is used to communicate | |||||
| // with API server by this client implementation. | |||||
| func (c *FakeCoreV1) RESTClient() rest.Interface { | |||||
| var ret *rest.RESTClient | |||||
| return ret | |||||
| } | |||||
| @@ -0,0 +1,155 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| corev1 "k8s.io/api/core/v1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeEndpoints implements EndpointsInterface | |||||
| type FakeEndpoints struct { | |||||
| Fake *FakeCoreV1 | |||||
| ns string | |||||
| } | |||||
| var endpointsResource = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "endpoints"} | |||||
| var endpointsKind = schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Endpoints"} | |||||
| // Get takes name of the endpoints, and returns the corresponding endpoints object, and an error if there is any. | |||||
| func (c *FakeEndpoints) Get(ctx context.Context, name string, options v1.GetOptions) (result *corev1.Endpoints, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetAction(endpointsResource, c.ns, name), &corev1.Endpoints{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Endpoints), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of Endpoints that match those selectors. | |||||
| func (c *FakeEndpoints) List(ctx context.Context, opts v1.ListOptions) (result *corev1.EndpointsList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewListAction(endpointsResource, endpointsKind, c.ns, opts), &corev1.EndpointsList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &corev1.EndpointsList{ListMeta: obj.(*corev1.EndpointsList).ListMeta} | |||||
| for _, item := range obj.(*corev1.EndpointsList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested endpoints. | |||||
| func (c *FakeEndpoints) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewWatchAction(endpointsResource, c.ns, opts)) | |||||
| } | |||||
| // Create takes the representation of a endpoints and creates it. Returns the server's representation of the endpoints, and an error, if there is any. | |||||
| func (c *FakeEndpoints) Create(ctx context.Context, endpoints *corev1.Endpoints, opts v1.CreateOptions) (result *corev1.Endpoints, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewCreateAction(endpointsResource, c.ns, endpoints), &corev1.Endpoints{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Endpoints), err | |||||
| } | |||||
| // Update takes the representation of a endpoints and updates it. Returns the server's representation of the endpoints, and an error, if there is any. | |||||
| func (c *FakeEndpoints) Update(ctx context.Context, endpoints *corev1.Endpoints, opts v1.UpdateOptions) (result *corev1.Endpoints, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateAction(endpointsResource, c.ns, endpoints), &corev1.Endpoints{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Endpoints), err | |||||
| } | |||||
| // Delete takes name of the endpoints and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeEndpoints) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewDeleteAction(endpointsResource, c.ns, name), &corev1.Endpoints{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeEndpoints) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewDeleteCollectionAction(endpointsResource, c.ns, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &corev1.EndpointsList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched endpoints. | |||||
| func (c *FakeEndpoints) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1.Endpoints, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(endpointsResource, c.ns, name, pt, data, subresources...), &corev1.Endpoints{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Endpoints), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied endpoints. | |||||
| func (c *FakeEndpoints) Apply(ctx context.Context, endpoints *applyconfigurationscorev1.EndpointsApplyConfiguration, opts v1.ApplyOptions) (result *corev1.Endpoints, err error) { | |||||
| if endpoints == nil { | |||||
| return nil, fmt.Errorf("endpoints provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(endpoints) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := endpoints.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("endpoints.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(endpointsResource, c.ns, *name, types.ApplyPatchType, data), &corev1.Endpoints{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Endpoints), err | |||||
| } | |||||
| @@ -0,0 +1,155 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| corev1 "k8s.io/api/core/v1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeEvents implements EventInterface | |||||
| type FakeEvents struct { | |||||
| Fake *FakeCoreV1 | |||||
| ns string | |||||
| } | |||||
| var eventsResource = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "events"} | |||||
| var eventsKind = schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Event"} | |||||
| // Get takes name of the event, and returns the corresponding event object, and an error if there is any. | |||||
| func (c *FakeEvents) Get(ctx context.Context, name string, options v1.GetOptions) (result *corev1.Event, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetAction(eventsResource, c.ns, name), &corev1.Event{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Event), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of Events that match those selectors. | |||||
| func (c *FakeEvents) List(ctx context.Context, opts v1.ListOptions) (result *corev1.EventList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewListAction(eventsResource, eventsKind, c.ns, opts), &corev1.EventList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &corev1.EventList{ListMeta: obj.(*corev1.EventList).ListMeta} | |||||
| for _, item := range obj.(*corev1.EventList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested events. | |||||
| func (c *FakeEvents) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewWatchAction(eventsResource, c.ns, opts)) | |||||
| } | |||||
| // Create takes the representation of a event and creates it. Returns the server's representation of the event, and an error, if there is any. | |||||
| func (c *FakeEvents) Create(ctx context.Context, event *corev1.Event, opts v1.CreateOptions) (result *corev1.Event, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewCreateAction(eventsResource, c.ns, event), &corev1.Event{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Event), err | |||||
| } | |||||
| // Update takes the representation of a event and updates it. Returns the server's representation of the event, and an error, if there is any. | |||||
| func (c *FakeEvents) Update(ctx context.Context, event *corev1.Event, opts v1.UpdateOptions) (result *corev1.Event, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateAction(eventsResource, c.ns, event), &corev1.Event{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Event), err | |||||
| } | |||||
| // Delete takes name of the event and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeEvents) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewDeleteAction(eventsResource, c.ns, name), &corev1.Event{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeEvents) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewDeleteCollectionAction(eventsResource, c.ns, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &corev1.EventList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched event. | |||||
| func (c *FakeEvents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1.Event, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(eventsResource, c.ns, name, pt, data, subresources...), &corev1.Event{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Event), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied event. | |||||
| func (c *FakeEvents) Apply(ctx context.Context, event *applyconfigurationscorev1.EventApplyConfiguration, opts v1.ApplyOptions) (result *corev1.Event, err error) { | |||||
| if event == nil { | |||||
| return nil, fmt.Errorf("event provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(event) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := event.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("event.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(eventsResource, c.ns, *name, types.ApplyPatchType, data), &corev1.Event{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Event), err | |||||
| } | |||||
| @@ -0,0 +1,93 @@ | |||||
| /* | |||||
| Copyright 2014 The Kubernetes Authors. | |||||
| Licensed under the Apache License, Version 2.0 (the "License"); | |||||
| you may not use this file except in compliance with the License. | |||||
| You may obtain a copy of the License at | |||||
| http://www.apache.org/licenses/LICENSE-2.0 | |||||
| Unless required by applicable law or agreed to in writing, software | |||||
| distributed under the License is distributed on an "AS IS" BASIS, | |||||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
| See the License for the specific language governing permissions and | |||||
| limitations under the License. | |||||
| */ | |||||
| package fake | |||||
| import ( | |||||
| "k8s.io/api/core/v1" | |||||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| "k8s.io/apimachinery/pkg/fields" | |||||
| "k8s.io/apimachinery/pkg/runtime" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| core "k8s.io/client-go/testing" | |||||
| ) | |||||
| func (c *FakeEvents) CreateWithEventNamespace(event *v1.Event) (*v1.Event, error) { | |||||
| action := core.NewRootCreateAction(eventsResource, event) | |||||
| if c.ns != "" { | |||||
| action = core.NewCreateAction(eventsResource, c.ns, event) | |||||
| } | |||||
| obj, err := c.Fake.Invokes(action, event) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1.Event), err | |||||
| } | |||||
| // Update replaces an existing event. Returns the copy of the event the server returns, or an error. | |||||
| func (c *FakeEvents) UpdateWithEventNamespace(event *v1.Event) (*v1.Event, error) { | |||||
| action := core.NewRootUpdateAction(eventsResource, event) | |||||
| if c.ns != "" { | |||||
| action = core.NewUpdateAction(eventsResource, c.ns, event) | |||||
| } | |||||
| obj, err := c.Fake.Invokes(action, event) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1.Event), err | |||||
| } | |||||
| // PatchWithEventNamespace patches an existing event. Returns the copy of the event the server returns, or an error. | |||||
| // TODO: Should take a PatchType as an argument probably. | |||||
| func (c *FakeEvents) PatchWithEventNamespace(event *v1.Event, data []byte) (*v1.Event, error) { | |||||
| // TODO: Should be configurable to support additional patch strategies. | |||||
| pt := types.StrategicMergePatchType | |||||
| action := core.NewRootPatchAction(eventsResource, event.Name, pt, data) | |||||
| if c.ns != "" { | |||||
| action = core.NewPatchAction(eventsResource, c.ns, event.Name, pt, data) | |||||
| } | |||||
| obj, err := c.Fake.Invokes(action, event) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1.Event), err | |||||
| } | |||||
| // Search returns a list of events matching the specified object. | |||||
| func (c *FakeEvents) Search(scheme *runtime.Scheme, objOrRef runtime.Object) (*v1.EventList, error) { | |||||
| action := core.NewRootListAction(eventsResource, eventsKind, metav1.ListOptions{}) | |||||
| if c.ns != "" { | |||||
| action = core.NewListAction(eventsResource, eventsKind, c.ns, metav1.ListOptions{}) | |||||
| } | |||||
| obj, err := c.Fake.Invokes(action, &v1.EventList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1.EventList), err | |||||
| } | |||||
| func (c *FakeEvents) GetFieldSelector(involvedObjectName, involvedObjectNamespace, involvedObjectKind, involvedObjectUID *string) fields.Selector { | |||||
| action := core.GenericActionImpl{} | |||||
| action.Verb = "get-field-selector" | |||||
| action.Resource = eventsResource | |||||
| c.Fake.Invokes(action, nil) | |||||
| return fields.Everything() | |||||
| } | |||||
| @@ -0,0 +1,155 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| corev1 "k8s.io/api/core/v1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeLimitRanges implements LimitRangeInterface | |||||
| type FakeLimitRanges struct { | |||||
| Fake *FakeCoreV1 | |||||
| ns string | |||||
| } | |||||
| var limitrangesResource = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "limitranges"} | |||||
| var limitrangesKind = schema.GroupVersionKind{Group: "", Version: "v1", Kind: "LimitRange"} | |||||
| // Get takes name of the limitRange, and returns the corresponding limitRange object, and an error if there is any. | |||||
| func (c *FakeLimitRanges) Get(ctx context.Context, name string, options v1.GetOptions) (result *corev1.LimitRange, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetAction(limitrangesResource, c.ns, name), &corev1.LimitRange{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.LimitRange), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of LimitRanges that match those selectors. | |||||
| func (c *FakeLimitRanges) List(ctx context.Context, opts v1.ListOptions) (result *corev1.LimitRangeList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewListAction(limitrangesResource, limitrangesKind, c.ns, opts), &corev1.LimitRangeList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &corev1.LimitRangeList{ListMeta: obj.(*corev1.LimitRangeList).ListMeta} | |||||
| for _, item := range obj.(*corev1.LimitRangeList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested limitRanges. | |||||
| func (c *FakeLimitRanges) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewWatchAction(limitrangesResource, c.ns, opts)) | |||||
| } | |||||
| // Create takes the representation of a limitRange and creates it. Returns the server's representation of the limitRange, and an error, if there is any. | |||||
| func (c *FakeLimitRanges) Create(ctx context.Context, limitRange *corev1.LimitRange, opts v1.CreateOptions) (result *corev1.LimitRange, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewCreateAction(limitrangesResource, c.ns, limitRange), &corev1.LimitRange{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.LimitRange), err | |||||
| } | |||||
| // Update takes the representation of a limitRange and updates it. Returns the server's representation of the limitRange, and an error, if there is any. | |||||
| func (c *FakeLimitRanges) Update(ctx context.Context, limitRange *corev1.LimitRange, opts v1.UpdateOptions) (result *corev1.LimitRange, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateAction(limitrangesResource, c.ns, limitRange), &corev1.LimitRange{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.LimitRange), err | |||||
| } | |||||
| // Delete takes name of the limitRange and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeLimitRanges) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewDeleteAction(limitrangesResource, c.ns, name), &corev1.LimitRange{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeLimitRanges) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewDeleteCollectionAction(limitrangesResource, c.ns, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &corev1.LimitRangeList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched limitRange. | |||||
| func (c *FakeLimitRanges) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1.LimitRange, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(limitrangesResource, c.ns, name, pt, data, subresources...), &corev1.LimitRange{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.LimitRange), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied limitRange. | |||||
| func (c *FakeLimitRanges) Apply(ctx context.Context, limitRange *applyconfigurationscorev1.LimitRangeApplyConfiguration, opts v1.ApplyOptions) (result *corev1.LimitRange, err error) { | |||||
| if limitRange == nil { | |||||
| return nil, fmt.Errorf("limitRange provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(limitRange) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := limitRange.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("limitRange.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(limitrangesResource, c.ns, *name, types.ApplyPatchType, data), &corev1.LimitRange{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.LimitRange), err | |||||
| } | |||||
| @@ -0,0 +1,171 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| corev1 "k8s.io/api/core/v1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeNamespaces implements NamespaceInterface | |||||
| type FakeNamespaces struct { | |||||
| Fake *FakeCoreV1 | |||||
| } | |||||
| var namespacesResource = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "namespaces"} | |||||
| var namespacesKind = schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Namespace"} | |||||
| // Get takes name of the namespace, and returns the corresponding namespace object, and an error if there is any. | |||||
| func (c *FakeNamespaces) Get(ctx context.Context, name string, options v1.GetOptions) (result *corev1.Namespace, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootGetAction(namespacesResource, name), &corev1.Namespace{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Namespace), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of Namespaces that match those selectors. | |||||
| func (c *FakeNamespaces) List(ctx context.Context, opts v1.ListOptions) (result *corev1.NamespaceList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootListAction(namespacesResource, namespacesKind, opts), &corev1.NamespaceList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &corev1.NamespaceList{ListMeta: obj.(*corev1.NamespaceList).ListMeta} | |||||
| for _, item := range obj.(*corev1.NamespaceList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested namespaces. | |||||
| func (c *FakeNamespaces) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewRootWatchAction(namespacesResource, opts)) | |||||
| } | |||||
| // Create takes the representation of a namespace and creates it. Returns the server's representation of the namespace, and an error, if there is any. | |||||
| func (c *FakeNamespaces) Create(ctx context.Context, namespace *corev1.Namespace, opts v1.CreateOptions) (result *corev1.Namespace, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootCreateAction(namespacesResource, namespace), &corev1.Namespace{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Namespace), err | |||||
| } | |||||
| // Update takes the representation of a namespace and updates it. Returns the server's representation of the namespace, and an error, if there is any. | |||||
| func (c *FakeNamespaces) Update(ctx context.Context, namespace *corev1.Namespace, opts v1.UpdateOptions) (result *corev1.Namespace, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootUpdateAction(namespacesResource, namespace), &corev1.Namespace{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Namespace), err | |||||
| } | |||||
| // UpdateStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). | |||||
| func (c *FakeNamespaces) UpdateStatus(ctx context.Context, namespace *corev1.Namespace, opts v1.UpdateOptions) (*corev1.Namespace, error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootUpdateSubresourceAction(namespacesResource, "status", namespace), &corev1.Namespace{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Namespace), err | |||||
| } | |||||
| // Delete takes name of the namespace and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeNamespaces) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewRootDeleteAction(namespacesResource, name), &corev1.Namespace{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched namespace. | |||||
| func (c *FakeNamespaces) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1.Namespace, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootPatchSubresourceAction(namespacesResource, name, pt, data, subresources...), &corev1.Namespace{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Namespace), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied namespace. | |||||
| func (c *FakeNamespaces) Apply(ctx context.Context, namespace *applyconfigurationscorev1.NamespaceApplyConfiguration, opts v1.ApplyOptions) (result *corev1.Namespace, err error) { | |||||
| if namespace == nil { | |||||
| return nil, fmt.Errorf("namespace provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(namespace) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := namespace.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("namespace.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootPatchSubresourceAction(namespacesResource, *name, types.ApplyPatchType, data), &corev1.Namespace{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Namespace), err | |||||
| } | |||||
| // ApplyStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). | |||||
| func (c *FakeNamespaces) ApplyStatus(ctx context.Context, namespace *applyconfigurationscorev1.NamespaceApplyConfiguration, opts v1.ApplyOptions) (result *corev1.Namespace, err error) { | |||||
| if namespace == nil { | |||||
| return nil, fmt.Errorf("namespace provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(namespace) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := namespace.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("namespace.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootPatchSubresourceAction(namespacesResource, *name, types.ApplyPatchType, data, "status"), &corev1.Namespace{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Namespace), err | |||||
| } | |||||
| @@ -0,0 +1,40 @@ | |||||
| /* | |||||
| Copyright 2014 The Kubernetes Authors. | |||||
| Licensed under the Apache License, Version 2.0 (the "License"); | |||||
| you may not use this file except in compliance with the License. | |||||
| You may obtain a copy of the License at | |||||
| http://www.apache.org/licenses/LICENSE-2.0 | |||||
| Unless required by applicable law or agreed to in writing, software | |||||
| distributed under the License is distributed on an "AS IS" BASIS, | |||||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
| See the License for the specific language governing permissions and | |||||
| limitations under the License. | |||||
| */ | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| "k8s.io/api/core/v1" | |||||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| core "k8s.io/client-go/testing" | |||||
| ) | |||||
| func (c *FakeNamespaces) Finalize(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (*v1.Namespace, error) { | |||||
| action := core.CreateActionImpl{} | |||||
| action.Verb = "create" | |||||
| action.Resource = namespacesResource | |||||
| action.Subresource = "finalize" | |||||
| action.Object = namespace | |||||
| obj, err := c.Fake.Invokes(action, namespace) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1.Namespace), err | |||||
| } | |||||
| @@ -0,0 +1,179 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| corev1 "k8s.io/api/core/v1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakeNodes implements NodeInterface | |||||
| type FakeNodes struct { | |||||
| Fake *FakeCoreV1 | |||||
| } | |||||
| var nodesResource = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "nodes"} | |||||
| var nodesKind = schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Node"} | |||||
| // Get takes name of the node, and returns the corresponding node object, and an error if there is any. | |||||
| func (c *FakeNodes) Get(ctx context.Context, name string, options v1.GetOptions) (result *corev1.Node, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootGetAction(nodesResource, name), &corev1.Node{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Node), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of Nodes that match those selectors. | |||||
| func (c *FakeNodes) List(ctx context.Context, opts v1.ListOptions) (result *corev1.NodeList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootListAction(nodesResource, nodesKind, opts), &corev1.NodeList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &corev1.NodeList{ListMeta: obj.(*corev1.NodeList).ListMeta} | |||||
| for _, item := range obj.(*corev1.NodeList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested nodes. | |||||
| func (c *FakeNodes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewRootWatchAction(nodesResource, opts)) | |||||
| } | |||||
| // Create takes the representation of a node and creates it. Returns the server's representation of the node, and an error, if there is any. | |||||
| func (c *FakeNodes) Create(ctx context.Context, node *corev1.Node, opts v1.CreateOptions) (result *corev1.Node, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootCreateAction(nodesResource, node), &corev1.Node{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Node), err | |||||
| } | |||||
| // Update takes the representation of a node and updates it. Returns the server's representation of the node, and an error, if there is any. | |||||
| func (c *FakeNodes) Update(ctx context.Context, node *corev1.Node, opts v1.UpdateOptions) (result *corev1.Node, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootUpdateAction(nodesResource, node), &corev1.Node{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Node), err | |||||
| } | |||||
| // UpdateStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). | |||||
| func (c *FakeNodes) UpdateStatus(ctx context.Context, node *corev1.Node, opts v1.UpdateOptions) (*corev1.Node, error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootUpdateSubresourceAction(nodesResource, "status", node), &corev1.Node{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Node), err | |||||
| } | |||||
| // Delete takes name of the node and deletes it. Returns an error if one occurs. | |||||
| func (c *FakeNodes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewRootDeleteAction(nodesResource, name), &corev1.Node{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakeNodes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewRootDeleteCollectionAction(nodesResource, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &corev1.NodeList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched node. | |||||
| func (c *FakeNodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1.Node, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootPatchSubresourceAction(nodesResource, name, pt, data, subresources...), &corev1.Node{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Node), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied node. | |||||
| func (c *FakeNodes) Apply(ctx context.Context, node *applyconfigurationscorev1.NodeApplyConfiguration, opts v1.ApplyOptions) (result *corev1.Node, err error) { | |||||
| if node == nil { | |||||
| return nil, fmt.Errorf("node provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(node) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := node.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("node.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootPatchSubresourceAction(nodesResource, *name, types.ApplyPatchType, data), &corev1.Node{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Node), err | |||||
| } | |||||
| // ApplyStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). | |||||
| func (c *FakeNodes) ApplyStatus(ctx context.Context, node *applyconfigurationscorev1.NodeApplyConfiguration, opts v1.ApplyOptions) (result *corev1.Node, err error) { | |||||
| if node == nil { | |||||
| return nil, fmt.Errorf("node provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(node) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := node.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("node.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootPatchSubresourceAction(nodesResource, *name, types.ApplyPatchType, data, "status"), &corev1.Node{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Node), err | |||||
| } | |||||
| @@ -0,0 +1,38 @@ | |||||
| /* | |||||
| Copyright 2016 The Kubernetes Authors. | |||||
| Licensed under the Apache License, Version 2.0 (the "License"); | |||||
| you may not use this file except in compliance with the License. | |||||
| You may obtain a copy of the License at | |||||
| http://www.apache.org/licenses/LICENSE-2.0 | |||||
| Unless required by applicable law or agreed to in writing, software | |||||
| distributed under the License is distributed on an "AS IS" BASIS, | |||||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
| See the License for the specific language governing permissions and | |||||
| limitations under the License. | |||||
| */ | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| v1 "k8s.io/api/core/v1" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| core "k8s.io/client-go/testing" | |||||
| ) | |||||
| // TODO: Should take a PatchType as an argument probably. | |||||
| func (c *FakeNodes) PatchStatus(_ context.Context, nodeName string, data []byte) (*v1.Node, error) { | |||||
| // TODO: Should be configurable to support additional patch strategies. | |||||
| pt := types.StrategicMergePatchType | |||||
| obj, err := c.Fake.Invokes( | |||||
| core.NewRootPatchSubresourceAction(nodesResource, nodeName, pt, data, "status"), &v1.Node{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*v1.Node), err | |||||
| } | |||||
| @@ -0,0 +1,179 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| corev1 "k8s.io/api/core/v1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakePersistentVolumes implements PersistentVolumeInterface | |||||
| type FakePersistentVolumes struct { | |||||
| Fake *FakeCoreV1 | |||||
| } | |||||
| var persistentvolumesResource = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "persistentvolumes"} | |||||
| var persistentvolumesKind = schema.GroupVersionKind{Group: "", Version: "v1", Kind: "PersistentVolume"} | |||||
| // Get takes name of the persistentVolume, and returns the corresponding persistentVolume object, and an error if there is any. | |||||
| func (c *FakePersistentVolumes) Get(ctx context.Context, name string, options v1.GetOptions) (result *corev1.PersistentVolume, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootGetAction(persistentvolumesResource, name), &corev1.PersistentVolume{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.PersistentVolume), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of PersistentVolumes that match those selectors. | |||||
| func (c *FakePersistentVolumes) List(ctx context.Context, opts v1.ListOptions) (result *corev1.PersistentVolumeList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootListAction(persistentvolumesResource, persistentvolumesKind, opts), &corev1.PersistentVolumeList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &corev1.PersistentVolumeList{ListMeta: obj.(*corev1.PersistentVolumeList).ListMeta} | |||||
| for _, item := range obj.(*corev1.PersistentVolumeList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested persistentVolumes. | |||||
| func (c *FakePersistentVolumes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewRootWatchAction(persistentvolumesResource, opts)) | |||||
| } | |||||
| // Create takes the representation of a persistentVolume and creates it. Returns the server's representation of the persistentVolume, and an error, if there is any. | |||||
| func (c *FakePersistentVolumes) Create(ctx context.Context, persistentVolume *corev1.PersistentVolume, opts v1.CreateOptions) (result *corev1.PersistentVolume, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootCreateAction(persistentvolumesResource, persistentVolume), &corev1.PersistentVolume{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.PersistentVolume), err | |||||
| } | |||||
| // Update takes the representation of a persistentVolume and updates it. Returns the server's representation of the persistentVolume, and an error, if there is any. | |||||
| func (c *FakePersistentVolumes) Update(ctx context.Context, persistentVolume *corev1.PersistentVolume, opts v1.UpdateOptions) (result *corev1.PersistentVolume, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootUpdateAction(persistentvolumesResource, persistentVolume), &corev1.PersistentVolume{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.PersistentVolume), err | |||||
| } | |||||
| // UpdateStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). | |||||
| func (c *FakePersistentVolumes) UpdateStatus(ctx context.Context, persistentVolume *corev1.PersistentVolume, opts v1.UpdateOptions) (*corev1.PersistentVolume, error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootUpdateSubresourceAction(persistentvolumesResource, "status", persistentVolume), &corev1.PersistentVolume{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.PersistentVolume), err | |||||
| } | |||||
| // Delete takes name of the persistentVolume and deletes it. Returns an error if one occurs. | |||||
| func (c *FakePersistentVolumes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewRootDeleteAction(persistentvolumesResource, name), &corev1.PersistentVolume{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakePersistentVolumes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewRootDeleteCollectionAction(persistentvolumesResource, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &corev1.PersistentVolumeList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched persistentVolume. | |||||
| func (c *FakePersistentVolumes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1.PersistentVolume, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootPatchSubresourceAction(persistentvolumesResource, name, pt, data, subresources...), &corev1.PersistentVolume{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.PersistentVolume), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied persistentVolume. | |||||
| func (c *FakePersistentVolumes) Apply(ctx context.Context, persistentVolume *applyconfigurationscorev1.PersistentVolumeApplyConfiguration, opts v1.ApplyOptions) (result *corev1.PersistentVolume, err error) { | |||||
| if persistentVolume == nil { | |||||
| return nil, fmt.Errorf("persistentVolume provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(persistentVolume) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := persistentVolume.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("persistentVolume.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootPatchSubresourceAction(persistentvolumesResource, *name, types.ApplyPatchType, data), &corev1.PersistentVolume{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.PersistentVolume), err | |||||
| } | |||||
| // ApplyStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). | |||||
| func (c *FakePersistentVolumes) ApplyStatus(ctx context.Context, persistentVolume *applyconfigurationscorev1.PersistentVolumeApplyConfiguration, opts v1.ApplyOptions) (result *corev1.PersistentVolume, err error) { | |||||
| if persistentVolume == nil { | |||||
| return nil, fmt.Errorf("persistentVolume provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(persistentVolume) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := persistentVolume.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("persistentVolume.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewRootPatchSubresourceAction(persistentvolumesResource, *name, types.ApplyPatchType, data, "status"), &corev1.PersistentVolume{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.PersistentVolume), err | |||||
| } | |||||
| @@ -0,0 +1,190 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| corev1 "k8s.io/api/core/v1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakePersistentVolumeClaims implements PersistentVolumeClaimInterface | |||||
| type FakePersistentVolumeClaims struct { | |||||
| Fake *FakeCoreV1 | |||||
| ns string | |||||
| } | |||||
| var persistentvolumeclaimsResource = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "persistentvolumeclaims"} | |||||
| var persistentvolumeclaimsKind = schema.GroupVersionKind{Group: "", Version: "v1", Kind: "PersistentVolumeClaim"} | |||||
| // Get takes name of the persistentVolumeClaim, and returns the corresponding persistentVolumeClaim object, and an error if there is any. | |||||
| func (c *FakePersistentVolumeClaims) Get(ctx context.Context, name string, options v1.GetOptions) (result *corev1.PersistentVolumeClaim, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetAction(persistentvolumeclaimsResource, c.ns, name), &corev1.PersistentVolumeClaim{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.PersistentVolumeClaim), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of PersistentVolumeClaims that match those selectors. | |||||
| func (c *FakePersistentVolumeClaims) List(ctx context.Context, opts v1.ListOptions) (result *corev1.PersistentVolumeClaimList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewListAction(persistentvolumeclaimsResource, persistentvolumeclaimsKind, c.ns, opts), &corev1.PersistentVolumeClaimList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &corev1.PersistentVolumeClaimList{ListMeta: obj.(*corev1.PersistentVolumeClaimList).ListMeta} | |||||
| for _, item := range obj.(*corev1.PersistentVolumeClaimList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested persistentVolumeClaims. | |||||
| func (c *FakePersistentVolumeClaims) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewWatchAction(persistentvolumeclaimsResource, c.ns, opts)) | |||||
| } | |||||
| // Create takes the representation of a persistentVolumeClaim and creates it. Returns the server's representation of the persistentVolumeClaim, and an error, if there is any. | |||||
| func (c *FakePersistentVolumeClaims) Create(ctx context.Context, persistentVolumeClaim *corev1.PersistentVolumeClaim, opts v1.CreateOptions) (result *corev1.PersistentVolumeClaim, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewCreateAction(persistentvolumeclaimsResource, c.ns, persistentVolumeClaim), &corev1.PersistentVolumeClaim{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.PersistentVolumeClaim), err | |||||
| } | |||||
| // Update takes the representation of a persistentVolumeClaim and updates it. Returns the server's representation of the persistentVolumeClaim, and an error, if there is any. | |||||
| func (c *FakePersistentVolumeClaims) Update(ctx context.Context, persistentVolumeClaim *corev1.PersistentVolumeClaim, opts v1.UpdateOptions) (result *corev1.PersistentVolumeClaim, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateAction(persistentvolumeclaimsResource, c.ns, persistentVolumeClaim), &corev1.PersistentVolumeClaim{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.PersistentVolumeClaim), err | |||||
| } | |||||
| // UpdateStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). | |||||
| func (c *FakePersistentVolumeClaims) UpdateStatus(ctx context.Context, persistentVolumeClaim *corev1.PersistentVolumeClaim, opts v1.UpdateOptions) (*corev1.PersistentVolumeClaim, error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateSubresourceAction(persistentvolumeclaimsResource, "status", c.ns, persistentVolumeClaim), &corev1.PersistentVolumeClaim{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.PersistentVolumeClaim), err | |||||
| } | |||||
| // Delete takes name of the persistentVolumeClaim and deletes it. Returns an error if one occurs. | |||||
| func (c *FakePersistentVolumeClaims) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewDeleteAction(persistentvolumeclaimsResource, c.ns, name), &corev1.PersistentVolumeClaim{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakePersistentVolumeClaims) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewDeleteCollectionAction(persistentvolumeclaimsResource, c.ns, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &corev1.PersistentVolumeClaimList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched persistentVolumeClaim. | |||||
| func (c *FakePersistentVolumeClaims) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1.PersistentVolumeClaim, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(persistentvolumeclaimsResource, c.ns, name, pt, data, subresources...), &corev1.PersistentVolumeClaim{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.PersistentVolumeClaim), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied persistentVolumeClaim. | |||||
| func (c *FakePersistentVolumeClaims) Apply(ctx context.Context, persistentVolumeClaim *applyconfigurationscorev1.PersistentVolumeClaimApplyConfiguration, opts v1.ApplyOptions) (result *corev1.PersistentVolumeClaim, err error) { | |||||
| if persistentVolumeClaim == nil { | |||||
| return nil, fmt.Errorf("persistentVolumeClaim provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(persistentVolumeClaim) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := persistentVolumeClaim.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("persistentVolumeClaim.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(persistentvolumeclaimsResource, c.ns, *name, types.ApplyPatchType, data), &corev1.PersistentVolumeClaim{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.PersistentVolumeClaim), err | |||||
| } | |||||
| // ApplyStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). | |||||
| func (c *FakePersistentVolumeClaims) ApplyStatus(ctx context.Context, persistentVolumeClaim *applyconfigurationscorev1.PersistentVolumeClaimApplyConfiguration, opts v1.ApplyOptions) (result *corev1.PersistentVolumeClaim, err error) { | |||||
| if persistentVolumeClaim == nil { | |||||
| return nil, fmt.Errorf("persistentVolumeClaim provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(persistentVolumeClaim) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := persistentVolumeClaim.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("persistentVolumeClaim.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(persistentvolumeclaimsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &corev1.PersistentVolumeClaim{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.PersistentVolumeClaim), err | |||||
| } | |||||
| @@ -0,0 +1,212 @@ | |||||
| /* | |||||
| Copyright 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 client-gen. DO NOT EDIT. | |||||
| package fake | |||||
| import ( | |||||
| "context" | |||||
| json "encoding/json" | |||||
| "fmt" | |||||
| corev1 "k8s.io/api/core/v1" | |||||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||||
| labels "k8s.io/apimachinery/pkg/labels" | |||||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||||
| types "k8s.io/apimachinery/pkg/types" | |||||
| watch "k8s.io/apimachinery/pkg/watch" | |||||
| applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" | |||||
| testing "k8s.io/client-go/testing" | |||||
| ) | |||||
| // FakePods implements PodInterface | |||||
| type FakePods struct { | |||||
| Fake *FakeCoreV1 | |||||
| ns string | |||||
| } | |||||
| var podsResource = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "pods"} | |||||
| var podsKind = schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Pod"} | |||||
| // Get takes name of the pod, and returns the corresponding pod object, and an error if there is any. | |||||
| func (c *FakePods) Get(ctx context.Context, name string, options v1.GetOptions) (result *corev1.Pod, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetAction(podsResource, c.ns, name), &corev1.Pod{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Pod), err | |||||
| } | |||||
| // List takes label and field selectors, and returns the list of Pods that match those selectors. | |||||
| func (c *FakePods) List(ctx context.Context, opts v1.ListOptions) (result *corev1.PodList, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewListAction(podsResource, podsKind, c.ns, opts), &corev1.PodList{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| label, _, _ := testing.ExtractFromListOptions(opts) | |||||
| if label == nil { | |||||
| label = labels.Everything() | |||||
| } | |||||
| list := &corev1.PodList{ListMeta: obj.(*corev1.PodList).ListMeta} | |||||
| for _, item := range obj.(*corev1.PodList).Items { | |||||
| if label.Matches(labels.Set(item.Labels)) { | |||||
| list.Items = append(list.Items, item) | |||||
| } | |||||
| } | |||||
| return list, err | |||||
| } | |||||
| // Watch returns a watch.Interface that watches the requested pods. | |||||
| func (c *FakePods) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { | |||||
| return c.Fake. | |||||
| InvokesWatch(testing.NewWatchAction(podsResource, c.ns, opts)) | |||||
| } | |||||
| // Create takes the representation of a pod and creates it. Returns the server's representation of the pod, and an error, if there is any. | |||||
| func (c *FakePods) Create(ctx context.Context, pod *corev1.Pod, opts v1.CreateOptions) (result *corev1.Pod, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewCreateAction(podsResource, c.ns, pod), &corev1.Pod{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Pod), err | |||||
| } | |||||
| // Update takes the representation of a pod and updates it. Returns the server's representation of the pod, and an error, if there is any. | |||||
| func (c *FakePods) Update(ctx context.Context, pod *corev1.Pod, opts v1.UpdateOptions) (result *corev1.Pod, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateAction(podsResource, c.ns, pod), &corev1.Pod{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Pod), err | |||||
| } | |||||
| // UpdateStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). | |||||
| func (c *FakePods) UpdateStatus(ctx context.Context, pod *corev1.Pod, opts v1.UpdateOptions) (*corev1.Pod, error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateSubresourceAction(podsResource, "status", c.ns, pod), &corev1.Pod{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Pod), err | |||||
| } | |||||
| // Delete takes name of the pod and deletes it. Returns an error if one occurs. | |||||
| func (c *FakePods) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||||
| _, err := c.Fake. | |||||
| Invokes(testing.NewDeleteAction(podsResource, c.ns, name), &corev1.Pod{}) | |||||
| return err | |||||
| } | |||||
| // DeleteCollection deletes a collection of objects. | |||||
| func (c *FakePods) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { | |||||
| action := testing.NewDeleteCollectionAction(podsResource, c.ns, listOpts) | |||||
| _, err := c.Fake.Invokes(action, &corev1.PodList{}) | |||||
| return err | |||||
| } | |||||
| // Patch applies the patch and returns the patched pod. | |||||
| func (c *FakePods) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1.Pod, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(podsResource, c.ns, name, pt, data, subresources...), &corev1.Pod{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Pod), err | |||||
| } | |||||
| // Apply takes the given apply declarative configuration, applies it and returns the applied pod. | |||||
| func (c *FakePods) Apply(ctx context.Context, pod *applyconfigurationscorev1.PodApplyConfiguration, opts v1.ApplyOptions) (result *corev1.Pod, err error) { | |||||
| if pod == nil { | |||||
| return nil, fmt.Errorf("pod provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(pod) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := pod.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("pod.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(podsResource, c.ns, *name, types.ApplyPatchType, data), &corev1.Pod{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Pod), err | |||||
| } | |||||
| // ApplyStatus was generated because the type contains a Status member. | |||||
| // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). | |||||
| func (c *FakePods) ApplyStatus(ctx context.Context, pod *applyconfigurationscorev1.PodApplyConfiguration, opts v1.ApplyOptions) (result *corev1.Pod, err error) { | |||||
| if pod == nil { | |||||
| return nil, fmt.Errorf("pod provided to Apply must not be nil") | |||||
| } | |||||
| data, err := json.Marshal(pod) | |||||
| if err != nil { | |||||
| return nil, err | |||||
| } | |||||
| name := pod.Name | |||||
| if name == nil { | |||||
| return nil, fmt.Errorf("pod.Name must be provided to Apply") | |||||
| } | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewPatchSubresourceAction(podsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &corev1.Pod{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.Pod), err | |||||
| } | |||||
| // GetEphemeralContainers takes name of the pod, and returns the corresponding ephemeralContainers object, and an error if there is any. | |||||
| func (c *FakePods) GetEphemeralContainers(ctx context.Context, podName string, options v1.GetOptions) (result *corev1.EphemeralContainers, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewGetSubresourceAction(podsResource, c.ns, "ephemeralcontainers", podName), &corev1.EphemeralContainers{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.EphemeralContainers), err | |||||
| } | |||||
| // UpdateEphemeralContainers takes the representation of a ephemeralContainers and updates it. Returns the server's representation of the ephemeralContainers, and an error, if there is any. | |||||
| func (c *FakePods) UpdateEphemeralContainers(ctx context.Context, podName string, ephemeralContainers *corev1.EphemeralContainers, opts v1.UpdateOptions) (result *corev1.EphemeralContainers, err error) { | |||||
| obj, err := c.Fake. | |||||
| Invokes(testing.NewUpdateSubresourceAction(podsResource, "ephemeralcontainers", c.ns, ephemeralContainers), &corev1.EphemeralContainers{}) | |||||
| if obj == nil { | |||||
| return nil, err | |||||
| } | |||||
| return obj.(*corev1.EphemeralContainers), err | |||||
| } | |||||