diff --git a/cmd/kubeadm/app/cmd/token.go b/cmd/kubeadm/app/cmd/token.go index 265fe7e453d..a0b244d3efb 100644 --- a/cmd/kubeadm/app/cmd/token.go +++ b/cmd/kubeadm/app/cmd/token.go @@ -431,7 +431,7 @@ func RunDeleteTokens(out io.Writer, client clientset.Interface, tokenIDsOrTokens tokenSecretName := bootstraputil.BootstrapTokenSecretName(tokenID) klog.V(1).Infof("[token] deleting token %q", tokenID) - if err := client.CoreV1().Secrets(metav1.NamespaceSystem).Delete(context.TODO(), tokenSecretName, nil); err != nil { + if err := client.CoreV1().Secrets(metav1.NamespaceSystem).Delete(context.TODO(), tokenSecretName, metav1.DeleteOptions{}); err != nil { return errors.Wrapf(err, "failed to delete bootstrap token %q", tokenID) } fmt.Fprintf(out, "bootstrap token %q deleted\n", tokenID) diff --git a/cmd/kubeadm/app/phases/upgrade/health.go b/cmd/kubeadm/app/phases/upgrade/health.go index 64e57045409..a0cb49350a4 100644 --- a/cmd/kubeadm/app/phases/upgrade/health.go +++ b/cmd/kubeadm/app/phases/upgrade/health.go @@ -200,10 +200,7 @@ func createJob(client clientset.Interface, cfg *kubeadmapi.ClusterConfiguration) func deleteHealthCheckJob(client clientset.Interface, ns, jobName string) error { klog.V(2).Infof("Deleting Job %q in the namespace %q", jobName, ns) propagation := metav1.DeletePropagationForeground - deleteOptions := &metav1.DeleteOptions{ - PropagationPolicy: &propagation, - } - if err := client.BatchV1().Jobs(ns).Delete(context.TODO(), jobName, deleteOptions); err != nil { + if err := client.BatchV1().Jobs(ns).Delete(context.TODO(), jobName, metav1.DeleteOptions{PropagationPolicy: &propagation}); err != nil { return errors.Wrapf(err, "could not delete Job %q in the namespace %q", jobName, ns) } return nil diff --git a/cmd/kubeadm/app/util/apiclient/idempotency.go b/cmd/kubeadm/app/util/apiclient/idempotency.go index fa15260e69a..e8ffee8c06c 100644 --- a/cmd/kubeadm/app/util/apiclient/idempotency.go +++ b/cmd/kubeadm/app/util/apiclient/idempotency.go @@ -194,19 +194,13 @@ func CreateOrUpdateDaemonSet(client clientset.Interface, ds *apps.DaemonSet) err // DeleteDaemonSetForeground deletes the specified DaemonSet in foreground mode; i.e. it blocks until/makes sure all the managed Pods are deleted func DeleteDaemonSetForeground(client clientset.Interface, namespace, name string) error { foregroundDelete := metav1.DeletePropagationForeground - deleteOptions := &metav1.DeleteOptions{ - PropagationPolicy: &foregroundDelete, - } - return client.AppsV1().DaemonSets(namespace).Delete(context.TODO(), name, deleteOptions) + return client.AppsV1().DaemonSets(namespace).Delete(context.TODO(), name, metav1.DeleteOptions{PropagationPolicy: &foregroundDelete}) } // DeleteDeploymentForeground deletes the specified Deployment in foreground mode; i.e. it blocks until/makes sure all the managed Pods are deleted func DeleteDeploymentForeground(client clientset.Interface, namespace, name string) error { foregroundDelete := metav1.DeletePropagationForeground - deleteOptions := &metav1.DeleteOptions{ - PropagationPolicy: &foregroundDelete, - } - return client.AppsV1().Deployments(namespace).Delete(context.TODO(), name, deleteOptions) + return client.AppsV1().Deployments(namespace).Delete(context.TODO(), name, metav1.DeleteOptions{PropagationPolicy: &foregroundDelete}) } // CreateOrUpdateRole creates a Role if the target resource doesn't exist. If the resource exists already, this function will update the resource instead. diff --git a/pkg/controller/bootstrap/tokencleaner.go b/pkg/controller/bootstrap/tokencleaner.go index 659a4e243ee..35a06a33868 100644 --- a/pkg/controller/bootstrap/tokencleaner.go +++ b/pkg/controller/bootstrap/tokencleaner.go @@ -192,9 +192,9 @@ func (tc *TokenCleaner) evalSecret(o interface{}) { ttl, alreadyExpired := bootstrapsecretutil.GetExpiration(secret, time.Now()) if alreadyExpired { klog.V(3).Infof("Deleting expired secret %s/%s", secret.Namespace, secret.Name) - var options *metav1.DeleteOptions + var options metav1.DeleteOptions if len(secret.UID) > 0 { - options = &metav1.DeleteOptions{Preconditions: &metav1.Preconditions{UID: &secret.UID}} + options.Preconditions = &metav1.Preconditions{UID: &secret.UID} } err := tc.client.CoreV1().Secrets(secret.Namespace).Delete(context.TODO(), secret.Name, options) // NotFound isn't a real error (it's already been deleted) diff --git a/pkg/controller/certificates/cleaner/cleaner.go b/pkg/controller/certificates/cleaner/cleaner.go index fd4d19e6a55..b4cd971e19d 100644 --- a/pkg/controller/certificates/cleaner/cleaner.go +++ b/pkg/controller/certificates/cleaner/cleaner.go @@ -109,7 +109,7 @@ func (ccc *CSRCleanerController) handle(csr *capi.CertificateSigningRequest) err return err } if isIssuedPastDeadline(csr) || isDeniedPastDeadline(csr) || isPendingPastDeadline(csr) || isIssuedExpired { - if err := ccc.csrClient.Delete(context.TODO(), csr.Name, nil); err != nil { + if err := ccc.csrClient.Delete(context.TODO(), csr.Name, metav1.DeleteOptions{}); err != nil { return fmt.Errorf("unable to delete CSR %q: %v", csr.Name, err) } } diff --git a/pkg/controller/client_builder.go b/pkg/controller/client_builder.go index b9d8421c5e0..9c592f941a7 100644 --- a/pkg/controller/client_builder.go +++ b/pkg/controller/client_builder.go @@ -157,7 +157,7 @@ func (b SAControllerClientBuilder) Config(name string) (*restclient.Config, erro if !valid { klog.Warningf("secret %s contained an invalid API token for %s/%s", secret.Name, sa.Namespace, sa.Name) // try to delete the secret containing the invalid token - if err := b.CoreClient.Secrets(secret.Namespace).Delete(context.TODO(), secret.Name, &metav1.DeleteOptions{}); err != nil && !apierrors.IsNotFound(err) { + if err := b.CoreClient.Secrets(secret.Namespace).Delete(context.TODO(), secret.Name, metav1.DeleteOptions{}); err != nil && !apierrors.IsNotFound(err) { klog.Warningf("error deleting secret %s containing invalid API token for %s/%s: %v", secret.Name, sa.Namespace, sa.Name, err) } // continue watching for good tokens diff --git a/pkg/controller/cloud/node_lifecycle_controller.go b/pkg/controller/cloud/node_lifecycle_controller.go index 8faea71617c..078b2bf17c2 100644 --- a/pkg/controller/cloud/node_lifecycle_controller.go +++ b/pkg/controller/cloud/node_lifecycle_controller.go @@ -23,6 +23,7 @@ import ( "time" "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/types" utilruntime "k8s.io/apimachinery/pkg/util/runtime" @@ -190,7 +191,7 @@ func (c *CloudNodeLifecycleController) MonitorNodes() { fmt.Sprintf("Deleting node %v because it does not exist in the cloud provider", node.Name), "Node %s event: %s", node.Name, deleteNodeEvent) - if err := c.kubeClient.CoreV1().Nodes().Delete(context.TODO(), node.Name, nil); err != nil { + if err := c.kubeClient.CoreV1().Nodes().Delete(context.TODO(), node.Name, metav1.DeleteOptions{}); err != nil { klog.Errorf("unable to delete node %q: %v", node.Name, err) } } diff --git a/pkg/controller/controller_utils.go b/pkg/controller/controller_utils.go index 772c2a218f7..3b9c583465f 100644 --- a/pkg/controller/controller_utils.go +++ b/pkg/controller/controller_utils.go @@ -602,7 +602,7 @@ func (r RealPodControl) DeletePod(namespace string, podID string, object runtime return fmt.Errorf("object does not have ObjectMeta, %v", err) } klog.V(2).Infof("Controller %v deleting pod %v/%v", accessor.GetName(), namespace, podID) - if err := r.KubeClient.CoreV1().Pods(namespace).Delete(context.TODO(), podID, nil); err != nil && !apierrors.IsNotFound(err) { + if err := r.KubeClient.CoreV1().Pods(namespace).Delete(context.TODO(), podID, metav1.DeleteOptions{}); err != nil && !apierrors.IsNotFound(err) { r.Recorder.Eventf(object, v1.EventTypeWarning, FailedDeletePodReason, "Error deleting: %v", err) return fmt.Errorf("unable to delete pods: %v", err) } diff --git a/pkg/controller/cronjob/injection.go b/pkg/controller/cronjob/injection.go index eea61f94a62..5f9504bdd52 100644 --- a/pkg/controller/cronjob/injection.go +++ b/pkg/controller/cronjob/injection.go @@ -120,7 +120,7 @@ func (r realJobControl) CreateJob(namespace string, job *batchv1.Job) (*batchv1. func (r realJobControl) DeleteJob(namespace string, name string) error { background := metav1.DeletePropagationBackground - return r.KubeClient.BatchV1().Jobs(namespace).Delete(context.TODO(), name, &metav1.DeleteOptions{PropagationPolicy: &background}) + return r.KubeClient.BatchV1().Jobs(namespace).Delete(context.TODO(), name, metav1.DeleteOptions{PropagationPolicy: &background}) } type fakeJobControl struct { @@ -222,7 +222,7 @@ func (r realPodControl) ListPods(namespace string, opts metav1.ListOptions) (*v1 } func (r realPodControl) DeletePod(namespace string, name string) error { - return r.KubeClient.CoreV1().Pods(namespace).Delete(context.TODO(), name, nil) + return r.KubeClient.CoreV1().Pods(namespace).Delete(context.TODO(), name, metav1.DeleteOptions{}) } type fakePodControl struct { diff --git a/pkg/controller/daemon/update.go b/pkg/controller/daemon/update.go index 7abe32b744f..c3e31ffee35 100644 --- a/pkg/controller/daemon/update.go +++ b/pkg/controller/daemon/update.go @@ -171,7 +171,7 @@ func (dsc *DaemonSetsController) cleanupHistory(ds *apps.DaemonSet, old []*apps. continue } // Clean up - err := dsc.kubeClient.AppsV1().ControllerRevisions(ds.Namespace).Delete(context.TODO(), history.Name, nil) + err := dsc.kubeClient.AppsV1().ControllerRevisions(ds.Namespace).Delete(context.TODO(), history.Name, metav1.DeleteOptions{}) if err != nil { return err } @@ -227,7 +227,7 @@ func (dsc *DaemonSetsController) dedupCurHistories(ds *apps.DaemonSet, curHistor } } // Remove duplicates - err = dsc.kubeClient.AppsV1().ControllerRevisions(ds.Namespace).Delete(context.TODO(), cur.Name, nil) + err = dsc.kubeClient.AppsV1().ControllerRevisions(ds.Namespace).Delete(context.TODO(), cur.Name, metav1.DeleteOptions{}) if err != nil { return nil, err } diff --git a/pkg/controller/deployment/sync.go b/pkg/controller/deployment/sync.go index 89889e41a63..8e50f10fe26 100644 --- a/pkg/controller/deployment/sync.go +++ b/pkg/controller/deployment/sync.go @@ -458,7 +458,7 @@ func (dc *DeploymentController) cleanupDeployment(oldRSs []*apps.ReplicaSet, dep continue } klog.V(4).Infof("Trying to cleanup replica set %q for deployment %q", rs.Name, deployment.Name) - if err := dc.client.AppsV1().ReplicaSets(rs.Namespace).Delete(context.TODO(), rs.Name, nil); err != nil && !errors.IsNotFound(err) { + if err := dc.client.AppsV1().ReplicaSets(rs.Namespace).Delete(context.TODO(), rs.Name, metav1.DeleteOptions{}); err != nil && !errors.IsNotFound(err) { // Return error instead of aggregating and continuing DELETEs on the theory // that we may be overloading the api server. return err diff --git a/pkg/controller/disruption/disruption_test.go b/pkg/controller/disruption/disruption_test.go index 8458dcaeb1a..f8d50477394 100644 --- a/pkg/controller/disruption/disruption_test.go +++ b/pkg/controller/disruption/disruption_test.go @@ -1133,7 +1133,7 @@ func TestUpdatePDBStatusRetries(t *testing.T) { }) // (A) Delete one pod - if err := dc.coreClient.CoreV1().Pods("default").Delete(context.TODO(), podNames[0], &metav1.DeleteOptions{}); err != nil { + if err := dc.coreClient.CoreV1().Pods("default").Delete(context.TODO(), podNames[0], metav1.DeleteOptions{}); err != nil { t.Fatal(err) } if err := waitForCacheCount(dc.podStore, len(podNames)-1); err != nil { diff --git a/pkg/controller/endpoint/endpoints_controller.go b/pkg/controller/endpoint/endpoints_controller.go index 5fdabd1238b..bc77b3751fc 100644 --- a/pkg/controller/endpoint/endpoints_controller.go +++ b/pkg/controller/endpoint/endpoints_controller.go @@ -369,7 +369,7 @@ func (e *EndpointController) syncService(key string) error { // service is deleted. However, if we're down at the time when // the service is deleted, we will miss that deletion, so this // doesn't completely solve the problem. See #6877. - err = e.client.CoreV1().Endpoints(namespace).Delete(context.TODO(), name, nil) + err = e.client.CoreV1().Endpoints(namespace).Delete(context.TODO(), name, metav1.DeleteOptions{}) if err != nil && !errors.IsNotFound(err) { return err } diff --git a/pkg/controller/endpointslice/reconciler.go b/pkg/controller/endpointslice/reconciler.go index 4adc7073a3f..9055b52c14a 100644 --- a/pkg/controller/endpointslice/reconciler.go +++ b/pkg/controller/endpointslice/reconciler.go @@ -231,7 +231,7 @@ func (r *reconciler) finalize( } for _, endpointSlice := range slicesToDelete { - err := r.client.DiscoveryV1beta1().EndpointSlices(service.Namespace).Delete(context.TODO(), endpointSlice.Name, &metav1.DeleteOptions{}) + err := r.client.DiscoveryV1beta1().EndpointSlices(service.Namespace).Delete(context.TODO(), endpointSlice.Name, metav1.DeleteOptions{}) if err != nil { errs = append(errs, fmt.Errorf("Error deleting %s EndpointSlice for Service %s/%s: %v", endpointSlice.Name, service.Namespace, service.Name, err)) } else { diff --git a/pkg/controller/history/controller_history.go b/pkg/controller/history/controller_history.go index 6bac086c2f7..dabcd399d4d 100644 --- a/pkg/controller/history/controller_history.go +++ b/pkg/controller/history/controller_history.go @@ -289,7 +289,7 @@ func (rh *realHistory) UpdateControllerRevision(revision *apps.ControllerRevisio } func (rh *realHistory) DeleteControllerRevision(revision *apps.ControllerRevision) error { - return rh.client.AppsV1().ControllerRevisions(revision.Namespace).Delete(context.TODO(), revision.Name, nil) + return rh.client.AppsV1().ControllerRevisions(revision.Namespace).Delete(context.TODO(), revision.Name, metav1.DeleteOptions{}) } type objectForPatch struct { diff --git a/pkg/controller/nodelifecycle/scheduler/taint_manager.go b/pkg/controller/nodelifecycle/scheduler/taint_manager.go index 108d48931b0..873258bd48b 100644 --- a/pkg/controller/nodelifecycle/scheduler/taint_manager.go +++ b/pkg/controller/nodelifecycle/scheduler/taint_manager.go @@ -109,7 +109,7 @@ func deletePodHandler(c clientset.Interface, emitEventFunc func(types.Namespaced } var err error for i := 0; i < retries; i++ { - err = c.CoreV1().Pods(ns).Delete(context.TODO(), name, &metav1.DeleteOptions{}) + err = c.CoreV1().Pods(ns).Delete(context.TODO(), name, metav1.DeleteOptions{}) if err == nil { break } diff --git a/pkg/controller/podgc/gc_controller.go b/pkg/controller/podgc/gc_controller.go index 996ea88fab2..e7a6150eebc 100644 --- a/pkg/controller/podgc/gc_controller.go +++ b/pkg/controller/podgc/gc_controller.go @@ -76,7 +76,7 @@ func NewPodGC(kubeClient clientset.Interface, podInformer coreinformers.PodInfor nodeQueue: workqueue.NewNamedDelayingQueue("orphaned_pods_nodes"), deletePod: func(namespace, name string) error { klog.Infof("PodGC is force deleting Pod: %v/%v", namespace, name) - return kubeClient.CoreV1().Pods(namespace).Delete(context.TODO(), name, metav1.NewDeleteOptions(0)) + return kubeClient.CoreV1().Pods(namespace).Delete(context.TODO(), name, *metav1.NewDeleteOptions(0)) }, } diff --git a/pkg/controller/podgc/gc_controller_test.go b/pkg/controller/podgc/gc_controller_test.go index b3ddd33b73c..0036e220f79 100644 --- a/pkg/controller/podgc/gc_controller_test.go +++ b/pkg/controller/podgc/gc_controller_test.go @@ -349,7 +349,7 @@ func TestGCOrphaned(t *testing.T) { client.CoreV1().Nodes().Create(context.TODO(), node, metav1.CreateOptions{}) } for _, node := range test.deletedClientNodes { - client.CoreV1().Nodes().Delete(context.TODO(), node.Name, &metav1.DeleteOptions{}) + client.CoreV1().Nodes().Delete(context.TODO(), node.Name, metav1.DeleteOptions{}) } for _, node := range test.addedInformerNodes { nodeInformer.Informer().GetStore().Add(node) diff --git a/pkg/controller/replicaset/replica_set_test.go b/pkg/controller/replicaset/replica_set_test.go index ceded6f7710..7e90cd2ca57 100644 --- a/pkg/controller/replicaset/replica_set_test.go +++ b/pkg/controller/replicaset/replica_set_test.go @@ -1203,7 +1203,7 @@ func TestExpectationsOnRecreate(t *testing.T) { t.Fatal("Unexpected item in the queue") } - err = client.AppsV1().ReplicaSets(oldRS.Namespace).Delete(context.TODO(), oldRS.Name, &metav1.DeleteOptions{}) + err = client.AppsV1().ReplicaSets(oldRS.Namespace).Delete(context.TODO(), oldRS.Name, metav1.DeleteOptions{}) if err != nil { t.Fatal(err) } diff --git a/pkg/controller/serviceaccount/tokens_controller.go b/pkg/controller/serviceaccount/tokens_controller.go index 896ab4b1660..77559c5cae3 100644 --- a/pkg/controller/serviceaccount/tokens_controller.go +++ b/pkg/controller/serviceaccount/tokens_controller.go @@ -342,9 +342,9 @@ func (e *TokensController) deleteTokens(serviceAccount *v1.ServiceAccount) ( /*r } func (e *TokensController) deleteToken(ns, name string, uid types.UID) ( /*retry*/ bool, error) { - var opts *metav1.DeleteOptions + var opts metav1.DeleteOptions if len(uid) > 0 { - opts = &metav1.DeleteOptions{Preconditions: &metav1.Preconditions{UID: &uid}} + opts.Preconditions = &metav1.Preconditions{UID: &uid} } err := e.client.CoreV1().Secrets(ns).Delete(context.TODO(), name, opts) // NotFound doesn't need a retry (it's already been deleted) @@ -460,9 +460,9 @@ func (e *TokensController) ensureReferencedToken(serviceAccount *v1.ServiceAccou if !addedReference { // we weren't able to use the token, try to clean it up. klog.V(2).Infof("deleting secret %s/%s because reference couldn't be added (%v)", secret.Namespace, secret.Name, err) - deleteOpts := &metav1.DeleteOptions{Preconditions: &metav1.Preconditions{UID: &createdToken.UID}} - if deleteErr := e.client.CoreV1().Secrets(createdToken.Namespace).Delete(context.TODO(), createdToken.Name, deleteOpts); deleteErr != nil { - klog.Error(deleteErr) // if we fail, just log it + deleteOpts := metav1.DeleteOptions{Preconditions: &metav1.Preconditions{UID: &createdToken.UID}} + if err := e.client.CoreV1().Secrets(createdToken.Namespace).Delete(context.TODO(), createdToken.Name, deleteOpts); err != nil { + klog.Error(err) // if we fail, just log it } } diff --git a/pkg/controller/statefulset/stateful_pod_control.go b/pkg/controller/statefulset/stateful_pod_control.go index 824671ee6a8..eff625d7068 100644 --- a/pkg/controller/statefulset/stateful_pod_control.go +++ b/pkg/controller/statefulset/stateful_pod_control.go @@ -136,7 +136,7 @@ func (spc *realStatefulPodControl) UpdateStatefulPod(set *apps.StatefulSet, pod } func (spc *realStatefulPodControl) DeleteStatefulPod(set *apps.StatefulSet, pod *v1.Pod) error { - err := spc.client.CoreV1().Pods(set.Namespace).Delete(context.TODO(), pod.Name, nil) + err := spc.client.CoreV1().Pods(set.Namespace).Delete(context.TODO(), pod.Name, metav1.DeleteOptions{}) spc.recordPodEvent("delete", set, pod, err) return err } diff --git a/pkg/controller/testutil/test_utils.go b/pkg/controller/testutil/test_utils.go index 3f7b8ab0ea8..4e1361b477a 100644 --- a/pkg/controller/testutil/test_utils.go +++ b/pkg/controller/testutil/test_utils.go @@ -26,28 +26,26 @@ import ( "testing" "time" + v1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/clock" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/strategicpatch" "k8s.io/apimachinery/pkg/watch" - - "k8s.io/apimachinery/pkg/util/clock" - ref "k8s.io/client-go/tools/reference" - - v1 "k8s.io/api/core/v1" "k8s.io/client-go/kubernetes/fake" v1core "k8s.io/client-go/kubernetes/typed/core/v1" "k8s.io/client-go/tools/cache" + ref "k8s.io/client-go/tools/reference" + "k8s.io/klog" "k8s.io/kubernetes/pkg/api/legacyscheme" api "k8s.io/kubernetes/pkg/apis/core" utilnode "k8s.io/kubernetes/pkg/util/node" jsonpatch "github.com/evanphx/json-patch" - "k8s.io/klog" ) var ( @@ -183,7 +181,7 @@ func (m *FakeNodeHandler) List(_ context.Context, opts metav1.ListOptions) (*v1. } // Delete deletes a Node from the fake store. -func (m *FakeNodeHandler) Delete(_ context.Context, id string, opt *metav1.DeleteOptions) error { +func (m *FakeNodeHandler) Delete(_ context.Context, id string, opt metav1.DeleteOptions) error { m.lock.Lock() defer func() { m.RequestCount++ @@ -197,7 +195,7 @@ func (m *FakeNodeHandler) Delete(_ context.Context, id string, opt *metav1.Delet } // DeleteCollection deletes a collection of Nodes from the fake store. -func (m *FakeNodeHandler) DeleteCollection(_ context.Context, opt *metav1.DeleteOptions, listOpts metav1.ListOptions) error { +func (m *FakeNodeHandler) DeleteCollection(_ context.Context, opt metav1.DeleteOptions, listOpts metav1.ListOptions) error { return nil } diff --git a/pkg/controller/ttlafterfinished/ttlafterfinished_controller.go b/pkg/controller/ttlafterfinished/ttlafterfinished_controller.go index c9370a43cdb..be2866192b7 100644 --- a/pkg/controller/ttlafterfinished/ttlafterfinished_controller.go +++ b/pkg/controller/ttlafterfinished/ttlafterfinished_controller.go @@ -230,7 +230,7 @@ func (tc *Controller) processJob(key string) error { } // Cascade deletes the Jobs if TTL truly expires. policy := metav1.DeletePropagationForeground - options := &metav1.DeleteOptions{ + options := metav1.DeleteOptions{ PropagationPolicy: &policy, Preconditions: &metav1.Preconditions{UID: &fresh.UID}, } diff --git a/pkg/controller/util/node/controller_utils.go b/pkg/controller/util/node/controller_utils.go index 13007a47114..89560eaa1e1 100644 --- a/pkg/controller/util/node/controller_utils.go +++ b/pkg/controller/util/node/controller_utils.go @@ -80,7 +80,7 @@ func DeletePods(kubeClient clientset.Interface, pods []*v1.Pod, recorder record. klog.V(2).Infof("Starting deletion of pod %v/%v", pod.Namespace, pod.Name) recorder.Eventf(pod, v1.EventTypeNormal, "NodeControllerEviction", "Marking for deletion Pod %s from Node %s", pod.Name, nodeName) - if err := kubeClient.CoreV1().Pods(pod.Namespace).Delete(context.TODO(), pod.Name, nil); err != nil { + if err := kubeClient.CoreV1().Pods(pod.Namespace).Delete(context.TODO(), pod.Name, metav1.DeleteOptions{}); err != nil { if apierrors.IsNotFound(err) { // NotFound error means that pod was already deleted. // There is nothing left to do with this pod. diff --git a/pkg/controller/volume/persistentvolume/pv_controller.go b/pkg/controller/volume/persistentvolume/pv_controller.go index de40a033d53..c67276d5442 100644 --- a/pkg/controller/volume/persistentvolume/pv_controller.go +++ b/pkg/controller/volume/persistentvolume/pv_controller.go @@ -1227,7 +1227,7 @@ func (ctrl *PersistentVolumeController) deleteVolumeOperation(volume *v1.Persist klog.V(4).Infof("deleteVolumeOperation [%s]: success", volume.Name) // Delete the volume - if err = ctrl.kubeClient.CoreV1().PersistentVolumes().Delete(context.TODO(), volume.Name, nil); err != nil { + if err = ctrl.kubeClient.CoreV1().PersistentVolumes().Delete(context.TODO(), volume.Name, metav1.DeleteOptions{}); err != nil { // Oops, could not delete the volume and therefore the controller will // try to delete the volume again on next update. We _could_ maintain a // cache of "recently deleted volumes" and avoid unnecessary deletion, diff --git a/pkg/controller/volume/scheduling/scheduler_binder_test.go b/pkg/controller/volume/scheduling/scheduler_binder_test.go index bbf6f033a72..9c4dda0c73f 100644 --- a/pkg/controller/volume/scheduling/scheduler_binder_test.go +++ b/pkg/controller/volume/scheduling/scheduler_binder_test.go @@ -1813,7 +1813,7 @@ func TestBindPodVolumes(t *testing.T) { delayFunc: func(t *testing.T, testEnv *testEnv, pod *v1.Pod, pvs []*v1.PersistentVolume, pvcs []*v1.PersistentVolumeClaim) { pvc := pvcs[0] // Delete PVC will fail check - if err := testEnv.client.CoreV1().PersistentVolumeClaims(pvc.Namespace).Delete(context.TODO(), pvc.Name, &metav1.DeleteOptions{}); err != nil { + if err := testEnv.client.CoreV1().PersistentVolumeClaims(pvc.Namespace).Delete(context.TODO(), pvc.Name, metav1.DeleteOptions{}); err != nil { t.Errorf("failed to delete PVC %q: %v", pvc.Name, err) } }, diff --git a/pkg/kubelet/pod/mirror_client.go b/pkg/kubelet/pod/mirror_client.go index 551d27df444..3ead280e658 100644 --- a/pkg/kubelet/pod/mirror_client.go +++ b/pkg/kubelet/pod/mirror_client.go @@ -124,7 +124,7 @@ func (mc *basicMirrorClient) DeleteMirrorPod(podFullName string, uid *types.UID) } klog.V(2).Infof("Deleting a mirror pod %q (uid %#v)", podFullName, uid) var GracePeriodSeconds int64 - if err := mc.apiserverClient.CoreV1().Pods(namespace).Delete(context.TODO(), name, &metav1.DeleteOptions{GracePeriodSeconds: &GracePeriodSeconds, Preconditions: &metav1.Preconditions{UID: uid}}); err != nil { + if err := mc.apiserverClient.CoreV1().Pods(namespace).Delete(context.TODO(), name, metav1.DeleteOptions{GracePeriodSeconds: &GracePeriodSeconds, Preconditions: &metav1.Preconditions{UID: uid}}); err != nil { // Unfortunately, there's no generic error for failing a precondition if !(apierrors.IsNotFound(err) || apierrors.IsConflict(err)) { // We should return the error here, but historically this routine does diff --git a/pkg/kubelet/status/status_manager.go b/pkg/kubelet/status/status_manager.go index 92d00d495df..9ca4a49ebcf 100644 --- a/pkg/kubelet/status/status_manager.go +++ b/pkg/kubelet/status/status_manager.go @@ -583,9 +583,12 @@ func (m *manager) syncPod(uid types.UID, status versionedPodStatus) { // We don't handle graceful deletion of mirror pods. if m.canBeDeleted(pod, status.status) { - deleteOptions := metav1.NewDeleteOptions(0) - // Use the pod UID as the precondition for deletion to prevent deleting a newly created pod with the same name and namespace. - deleteOptions.Preconditions = metav1.NewUIDPreconditions(string(pod.UID)) + deleteOptions := metav1.DeleteOptions{ + GracePeriodSeconds: new(int64), + // Use the pod UID as the precondition for deletion to prevent deleting a + // newly created pod with the same name and namespace. + Preconditions: metav1.NewUIDPreconditions(string(pod.UID)), + } err = m.kubeClient.CoreV1().Pods(pod.Namespace).Delete(context.TODO(), pod.Name, deleteOptions) if err != nil { klog.Warningf("Failed to delete status for pod %q: %v", format.Pod(pod), err) diff --git a/pkg/kubemark/controller.go b/pkg/kubemark/controller.go index b8f11643664..d9c95962add 100644 --- a/pkg/kubemark/controller.go +++ b/pkg/kubemark/controller.go @@ -249,7 +249,7 @@ func (kubemarkController *KubemarkController) RemoveNodeFromNodeGroup(nodeGroup var err error for i := 0; i < numRetries; i++ { err = kubemarkController.externalCluster.client.CoreV1().ReplicationControllers(namespaceKubemark).Delete(context.TODO(), pod.ObjectMeta.Labels["name"], - &metav1.DeleteOptions{PropagationPolicy: &policy}) + metav1.DeleteOptions{PropagationPolicy: &policy}) if err == nil { klog.Infof("marking node %s for deletion", node) // Mark node for deletion from kubemark cluster. @@ -374,7 +374,7 @@ func (kubemarkCluster *kubemarkCluster) removeUnneededNodes(oldObj interface{}, defer kubemarkCluster.nodesToDeleteLock.Unlock() if kubemarkCluster.nodesToDelete[node.Name] { kubemarkCluster.nodesToDelete[node.Name] = false - if err := kubemarkCluster.client.CoreV1().Nodes().Delete(context.TODO(), node.Name, &metav1.DeleteOptions{}); err != nil { + if err := kubemarkCluster.client.CoreV1().Nodes().Delete(context.TODO(), node.Name, metav1.DeleteOptions{}); err != nil { klog.Errorf("failed to delete node %s from kubemark cluster, err: %v", node.Name, err) } } diff --git a/pkg/master/controller/clusterauthenticationtrust/cluster_authentication_trust_controller.go b/pkg/master/controller/clusterauthenticationtrust/cluster_authentication_trust_controller.go index c017f6b2f19..e7322fc5f6c 100644 --- a/pkg/master/controller/clusterauthenticationtrust/cluster_authentication_trust_controller.go +++ b/pkg/master/controller/clusterauthenticationtrust/cluster_authentication_trust_controller.go @@ -205,7 +205,7 @@ func writeConfigMap(configMapClient corev1client.ConfigMapsGetter, required *cor // 1. request is so big the generic request catcher finds it // 2. the content is so large that that the server sends a validation error "Too long: must have at most 1048576 characters" if apierrors.IsRequestEntityTooLargeError(err) || (apierrors.IsInvalid(err) && strings.Contains(err.Error(), "Too long")) { - if deleteErr := configMapClient.ConfigMaps(required.Namespace).Delete(context.TODO(), required.Name, nil); deleteErr != nil { + if deleteErr := configMapClient.ConfigMaps(required.Namespace).Delete(context.TODO(), required.Name, metav1.DeleteOptions{}); deleteErr != nil { return deleteErr } return err diff --git a/pkg/master/reconcilers/endpointsadapter.go b/pkg/master/reconcilers/endpointsadapter.go index eb7b8358d77..b3d456059b8 100644 --- a/pkg/master/reconcilers/endpointsadapter.go +++ b/pkg/master/reconcilers/endpointsadapter.go @@ -99,7 +99,7 @@ func (adapter *EndpointsAdapter) EnsureEndpointSliceFromEndpoints(namespace stri // required for transition from IP to IPv4 address type. if currentEndpointSlice.AddressType != endpointSlice.AddressType { - err = adapter.endpointSliceClient.EndpointSlices(namespace).Delete(context.TODO(), endpointSlice.Name, &metav1.DeleteOptions{}) + err = adapter.endpointSliceClient.EndpointSlices(namespace).Delete(context.TODO(), endpointSlice.Name, metav1.DeleteOptions{}) if err != nil { return err } diff --git a/pkg/registry/rbac/reconciliation/clusterrolebinding_interfaces.go b/pkg/registry/rbac/reconciliation/clusterrolebinding_interfaces.go index 6b136bba4f7..737dab62c8b 100644 --- a/pkg/registry/rbac/reconciliation/clusterrolebinding_interfaces.go +++ b/pkg/registry/rbac/reconciliation/clusterrolebinding_interfaces.go @@ -106,5 +106,5 @@ func (c ClusterRoleBindingClientAdapter) Update(in RoleBinding) (RoleBinding, er } func (c ClusterRoleBindingClientAdapter) Delete(namespace, name string, uid types.UID) error { - return c.Client.Delete(context.TODO(), name, &metav1.DeleteOptions{Preconditions: &metav1.Preconditions{UID: &uid}}) + return c.Client.Delete(context.TODO(), name, metav1.DeleteOptions{Preconditions: &metav1.Preconditions{UID: &uid}}) } diff --git a/pkg/registry/rbac/reconciliation/rolebinding_interfaces.go b/pkg/registry/rbac/reconciliation/rolebinding_interfaces.go index 70d47921caf..8cf2052c294 100644 --- a/pkg/registry/rbac/reconciliation/rolebinding_interfaces.go +++ b/pkg/registry/rbac/reconciliation/rolebinding_interfaces.go @@ -112,5 +112,5 @@ func (c RoleBindingClientAdapter) Update(in RoleBinding) (RoleBinding, error) { } func (c RoleBindingClientAdapter) Delete(namespace, name string, uid types.UID) error { - return c.Client.RoleBindings(namespace).Delete(context.TODO(), name, &metav1.DeleteOptions{Preconditions: &metav1.Preconditions{UID: &uid}}) + return c.Client.RoleBindings(namespace).Delete(context.TODO(), name, metav1.DeleteOptions{Preconditions: &metav1.Preconditions{UID: &uid}}) } diff --git a/pkg/scheduler/scheduler.go b/pkg/scheduler/scheduler.go index 9a35a05b8fc..c7a31f949ad 100644 --- a/pkg/scheduler/scheduler.go +++ b/pkg/scheduler/scheduler.go @@ -787,7 +787,7 @@ func (p *podPreemptorImpl) getUpdatedPod(pod *v1.Pod) (*v1.Pod, error) { } func (p *podPreemptorImpl) deletePod(pod *v1.Pod) error { - return p.Client.CoreV1().Pods(pod.Namespace).Delete(context.TODO(), pod.Name, &metav1.DeleteOptions{}) + return p.Client.CoreV1().Pods(pod.Namespace).Delete(context.TODO(), pod.Name, metav1.DeleteOptions{}) } func (p *podPreemptorImpl) setNominatedNodeName(pod *v1.Pod, nominatedNodeName string) error { diff --git a/pkg/volume/csi/csi_attacher.go b/pkg/volume/csi/csi_attacher.go index fc5c3a28bb8..ef06ac8fccd 100644 --- a/pkg/volume/csi/csi_attacher.go +++ b/pkg/volume/csi/csi_attacher.go @@ -394,7 +394,7 @@ func (c *csiAttacher) Detach(volumeName string, nodeName types.NodeName) error { attachID = getAttachmentName(volID, driverName, string(nodeName)) } - if err := c.k8s.StorageV1().VolumeAttachments().Delete(context.TODO(), attachID, nil); err != nil { + if err := c.k8s.StorageV1().VolumeAttachments().Delete(context.TODO(), attachID, metav1.DeleteOptions{}); err != nil { if apierrors.IsNotFound(err) { // object deleted or never existed, done klog.V(4).Info(log("VolumeAttachment object [%v] for volume [%v] not found, object deleted", attachID, volID)) diff --git a/pkg/volume/glusterfs/glusterfs.go b/pkg/volume/glusterfs/glusterfs.go index 6a5bb15465e..8419039d265 100644 --- a/pkg/volume/glusterfs/glusterfs.go +++ b/pkg/volume/glusterfs/glusterfs.go @@ -840,7 +840,7 @@ func (p *glusterfsVolumeProvisioner) CreateVolume(gid int) (r *v1.GlusterfsPersi klog.Errorf("failed to delete volume: %v, manual deletion of the volume required", deleteErr) } klog.V(3).Infof("failed to update endpoint, deleting %s", endpoint) - err = kubeClient.CoreV1().Services(epNamespace).Delete(context.TODO(), epServiceName, nil) + err = kubeClient.CoreV1().Services(epNamespace).Delete(context.TODO(), epServiceName, metav1.DeleteOptions{}) if err != nil && errors.IsNotFound(err) { klog.V(1).Infof("service %s does not exist in namespace %s", epServiceName, epNamespace) err = nil @@ -921,7 +921,7 @@ func (d *glusterfsVolumeDeleter) deleteEndpointService(namespace string, epServi if kubeClient == nil { return fmt.Errorf("failed to get kube client when deleting endpoint service") } - err = kubeClient.CoreV1().Services(namespace).Delete(context.TODO(), epServiceName, nil) + err = kubeClient.CoreV1().Services(namespace).Delete(context.TODO(), epServiceName, metav1.DeleteOptions{}) if err != nil { return fmt.Errorf("failed to delete service %s/%s: %v", namespace, epServiceName, err) } diff --git a/pkg/volume/util/recyclerclient/recycler_client.go b/pkg/volume/util/recyclerclient/recycler_client.go index 0558c1dced4..b1ca71f9035 100644 --- a/pkg/volume/util/recyclerclient/recycler_client.go +++ b/pkg/volume/util/recyclerclient/recycler_client.go @@ -186,7 +186,7 @@ func (c *realRecyclerClient) GetPod(name, namespace string) (*v1.Pod, error) { } func (c *realRecyclerClient) DeletePod(name, namespace string) error { - return c.client.CoreV1().Pods(namespace).Delete(context.TODO(), name, nil) + return c.client.CoreV1().Pods(namespace).Delete(context.TODO(), name, metav1.DeleteOptions{}) } func (c *realRecyclerClient) Event(eventtype, message string) { diff --git a/staging/src/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/example.go b/staging/src/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/example.go index e1d26401af0..dfb8a54df70 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/example.go +++ b/staging/src/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/example.go @@ -40,8 +40,8 @@ type ExamplesGetter interface { type ExampleInterface interface { Create(ctx context.Context, example *v1.Example, opts metav1.CreateOptions) (*v1.Example, error) Update(ctx context.Context, example *v1.Example, opts metav1.UpdateOptions) (*v1.Example, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Example, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ExampleList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -136,28 +136,28 @@ func (c *examples) Update(ctx context.Context, example *v1.Example, opts metav1. } // Delete takes name of the example and deletes it. Returns an error if one occurs. -func (c *examples) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *examples) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("examples"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *examples) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *examples) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("examples"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/fake/fake_example.go b/staging/src/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/fake/fake_example.go index ef48d9b1835..1a9bedfdcb4 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/fake/fake_example.go +++ b/staging/src/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/fake/fake_example.go @@ -103,7 +103,7 @@ func (c *FakeExamples) Update(ctx context.Context, example *crv1.Example, opts v } // Delete takes name of the example and deletes it. Returns an error if one occurs. -func (c *FakeExamples) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeExamples) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(examplesResource, c.ns, name), &crv1.Example{}) @@ -111,8 +111,8 @@ func (c *FakeExamples) Delete(ctx context.Context, name string, options *v1.Dele } // DeleteCollection deletes a collection of objects. -func (c *FakeExamples) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(examplesResource, c.ns, listOptions) +func (c *FakeExamples) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(examplesResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &crv1.ExampleList{}) return err diff --git a/staging/src/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1/customresourcedefinition.go b/staging/src/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1/customresourcedefinition.go index e74d657e4fc..5569b12d9c7 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1/customresourcedefinition.go +++ b/staging/src/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1/customresourcedefinition.go @@ -41,8 +41,8 @@ type CustomResourceDefinitionInterface interface { Create(ctx context.Context, customResourceDefinition *v1.CustomResourceDefinition, opts metav1.CreateOptions) (*v1.CustomResourceDefinition, error) Update(ctx context.Context, customResourceDefinition *v1.CustomResourceDefinition, opts metav1.UpdateOptions) (*v1.CustomResourceDefinition, error) UpdateStatus(ctx context.Context, customResourceDefinition *v1.CustomResourceDefinition, opts metav1.UpdateOptions) (*v1.CustomResourceDefinition, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.CustomResourceDefinition, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.CustomResourceDefinitionList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -145,26 +145,26 @@ func (c *customResourceDefinitions) UpdateStatus(ctx context.Context, customReso } // Delete takes name of the customResourceDefinition and deletes it. Returns an error if one occurs. -func (c *customResourceDefinitions) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *customResourceDefinitions) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Resource("customresourcedefinitions"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *customResourceDefinitions) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *customResourceDefinitions) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("customresourcedefinitions"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1/fake/fake_customresourcedefinition.go b/staging/src/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1/fake/fake_customresourcedefinition.go index 4b03e2fa3cb..b3edf006602 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1/fake/fake_customresourcedefinition.go +++ b/staging/src/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1/fake/fake_customresourcedefinition.go @@ -108,15 +108,15 @@ func (c *FakeCustomResourceDefinitions) UpdateStatus(ctx context.Context, custom } // Delete takes name of the customResourceDefinition and deletes it. Returns an error if one occurs. -func (c *FakeCustomResourceDefinitions) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeCustomResourceDefinitions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(customresourcedefinitionsResource, name), &apiextensionsv1.CustomResourceDefinition{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeCustomResourceDefinitions) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(customresourcedefinitionsResource, listOptions) +func (c *FakeCustomResourceDefinitions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(customresourcedefinitionsResource, listOpts) _, err := c.Fake.Invokes(action, &apiextensionsv1.CustomResourceDefinitionList{}) return err diff --git a/staging/src/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/customresourcedefinition.go b/staging/src/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/customresourcedefinition.go index 4bf50bcfb47..2d16ca7097a 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/customresourcedefinition.go +++ b/staging/src/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/customresourcedefinition.go @@ -41,8 +41,8 @@ type CustomResourceDefinitionInterface interface { Create(ctx context.Context, customResourceDefinition *v1beta1.CustomResourceDefinition, opts v1.CreateOptions) (*v1beta1.CustomResourceDefinition, error) Update(ctx context.Context, customResourceDefinition *v1beta1.CustomResourceDefinition, opts v1.UpdateOptions) (*v1beta1.CustomResourceDefinition, error) UpdateStatus(ctx context.Context, customResourceDefinition *v1beta1.CustomResourceDefinition, opts v1.UpdateOptions) (*v1beta1.CustomResourceDefinition, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.CustomResourceDefinition, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CustomResourceDefinitionList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -145,26 +145,26 @@ func (c *customResourceDefinitions) UpdateStatus(ctx context.Context, customReso } // Delete takes name of the customResourceDefinition and deletes it. Returns an error if one occurs. -func (c *customResourceDefinitions) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *customResourceDefinitions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("customresourcedefinitions"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *customResourceDefinitions) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *customResourceDefinitions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("customresourcedefinitions"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/fake/fake_customresourcedefinition.go b/staging/src/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/fake/fake_customresourcedefinition.go index a6b5e7f60a2..4fb18938443 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/fake/fake_customresourcedefinition.go +++ b/staging/src/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/fake/fake_customresourcedefinition.go @@ -108,15 +108,15 @@ func (c *FakeCustomResourceDefinitions) UpdateStatus(ctx context.Context, custom } // Delete takes name of the customResourceDefinition and deletes it. Returns an error if one occurs. -func (c *FakeCustomResourceDefinitions) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeCustomResourceDefinitions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(customresourcedefinitionsResource, name), &v1beta1.CustomResourceDefinition{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeCustomResourceDefinitions) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(customresourcedefinitionsResource, listOptions) +func (c *FakeCustomResourceDefinitions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(customresourcedefinitionsResource, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.CustomResourceDefinitionList{}) return err diff --git a/staging/src/k8s.io/apiextensions-apiserver/test/integration/fixtures/resources.go b/staging/src/k8s.io/apiextensions-apiserver/test/integration/fixtures/resources.go index 4bfe23f9854..7b6203597f5 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/test/integration/fixtures/resources.go +++ b/staging/src/k8s.io/apiextensions-apiserver/test/integration/fixtures/resources.go @@ -504,7 +504,7 @@ func isWatchCachePrimed(crd *apiextensionsv1.CustomResourceDefinition, dynamicCl // DeleteCustomResourceDefinition deletes a CRD and waits until it disappears from discovery. func DeleteCustomResourceDefinition(crd *apiextensionsv1beta1.CustomResourceDefinition, apiExtensionsClient clientset.Interface) error { - if err := apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Delete(context.TODO(), crd.Name, nil); err != nil { + if err := apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Delete(context.TODO(), crd.Name, metav1.DeleteOptions{}); err != nil { return err } for _, version := range servedVersions(crd) { @@ -521,7 +521,7 @@ func DeleteCustomResourceDefinition(crd *apiextensionsv1beta1.CustomResourceDefi // DeleteV1CustomResourceDefinition deletes a CRD and waits until it disappears from discovery. func DeleteV1CustomResourceDefinition(crd *apiextensionsv1.CustomResourceDefinition, apiExtensionsClient clientset.Interface) error { - if err := apiExtensionsClient.ApiextensionsV1().CustomResourceDefinitions().Delete(context.TODO(), crd.Name, nil); err != nil { + if err := apiExtensionsClient.ApiextensionsV1().CustomResourceDefinitions().Delete(context.TODO(), crd.Name, metav1.DeleteOptions{}); err != nil { return err } for _, version := range servedV1Versions(crd) { @@ -542,7 +542,7 @@ func DeleteV1CustomResourceDefinitions(deleteListOpts metav1.ListOptions, apiExt if err != nil { return err } - if err = apiExtensionsClient.ApiextensionsV1().CustomResourceDefinitions().DeleteCollection(context.TODO(), nil, deleteListOpts); err != nil { + if err = apiExtensionsClient.ApiextensionsV1().CustomResourceDefinitions().DeleteCollection(context.TODO(), metav1.DeleteOptions{}, deleteListOpts); err != nil { return err } for _, crd := range list.Items { diff --git a/staging/src/k8s.io/client-go/examples/create-update-delete-deployment/main.go b/staging/src/k8s.io/client-go/examples/create-update-delete-deployment/main.go index eff29931d4b..224dbc12519 100644 --- a/staging/src/k8s.io/client-go/examples/create-update-delete-deployment/main.go +++ b/staging/src/k8s.io/client-go/examples/create-update-delete-deployment/main.go @@ -156,7 +156,7 @@ func main() { prompt() fmt.Println("Deleting deployment...") deletePolicy := metav1.DeletePropagationForeground - if err := deploymentsClient.Delete(context.TODO(), "demo-deployment", &metav1.DeleteOptions{ + if err := deploymentsClient.Delete(context.TODO(), "demo-deployment", metav1.DeleteOptions{ PropagationPolicy: &deletePolicy, }); err != nil { panic(err) diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_mutatingwebhookconfiguration.go b/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_mutatingwebhookconfiguration.go index 3ddf59ee8b0..11738461278 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_mutatingwebhookconfiguration.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_mutatingwebhookconfiguration.go @@ -97,15 +97,15 @@ func (c *FakeMutatingWebhookConfigurations) Update(ctx context.Context, mutating } // Delete takes name of the mutatingWebhookConfiguration and deletes it. Returns an error if one occurs. -func (c *FakeMutatingWebhookConfigurations) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(mutatingwebhookconfigurationsResource, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_validatingwebhookconfiguration.go b/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_validatingwebhookconfiguration.go index 88fddd04b4b..78b059372ca 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_validatingwebhookconfiguration.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_validatingwebhookconfiguration.go @@ -97,15 +97,15 @@ func (c *FakeValidatingWebhookConfigurations) Update(ctx context.Context, valida } // Delete takes name of the validatingWebhookConfiguration and deletes it. Returns an error if one occurs. -func (c *FakeValidatingWebhookConfigurations) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(validatingwebhookconfigurationsResource, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/mutatingwebhookconfiguration.go b/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/mutatingwebhookconfiguration.go index e9787bf408f..cf458f48200 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/mutatingwebhookconfiguration.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/mutatingwebhookconfiguration.go @@ -40,8 +40,8 @@ type MutatingWebhookConfigurationsGetter interface { type MutatingWebhookConfigurationInterface interface { Create(ctx context.Context, mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration, opts metav1.CreateOptions) (*v1.MutatingWebhookConfiguration, error) Update(ctx context.Context, mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration, opts metav1.UpdateOptions) (*v1.MutatingWebhookConfiguration, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.MutatingWebhookConfiguration, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.MutatingWebhookConfigurationList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -129,26 +129,26 @@ func (c *mutatingWebhookConfigurations) Update(ctx context.Context, mutatingWebh } // Delete takes name of the mutatingWebhookConfiguration and deletes it. Returns an error if one occurs. -func (c *mutatingWebhookConfigurations) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *mutatingWebhookConfigurations) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Resource("mutatingwebhookconfigurations"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *mutatingWebhookConfigurations) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *mutatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("mutatingwebhookconfigurations"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/validatingwebhookconfiguration.go b/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/validatingwebhookconfiguration.go index 1a9c1b4ac60..c7191c0fe9c 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/validatingwebhookconfiguration.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/validatingwebhookconfiguration.go @@ -40,8 +40,8 @@ type ValidatingWebhookConfigurationsGetter interface { type ValidatingWebhookConfigurationInterface interface { Create(ctx context.Context, validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration, opts metav1.CreateOptions) (*v1.ValidatingWebhookConfiguration, error) Update(ctx context.Context, validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration, opts metav1.UpdateOptions) (*v1.ValidatingWebhookConfiguration, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ValidatingWebhookConfiguration, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ValidatingWebhookConfigurationList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -129,26 +129,26 @@ func (c *validatingWebhookConfigurations) Update(ctx context.Context, validating } // Delete takes name of the validatingWebhookConfiguration and deletes it. Returns an error if one occurs. -func (c *validatingWebhookConfigurations) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *validatingWebhookConfigurations) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Resource("validatingwebhookconfigurations"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *validatingWebhookConfigurations) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *validatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("validatingwebhookconfigurations"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_mutatingwebhookconfiguration.go b/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_mutatingwebhookconfiguration.go index 451de685ac6..f303f9fdf0c 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_mutatingwebhookconfiguration.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_mutatingwebhookconfiguration.go @@ -97,15 +97,15 @@ func (c *FakeMutatingWebhookConfigurations) Update(ctx context.Context, mutating } // Delete takes name of the mutatingWebhookConfiguration and deletes it. Returns an error if one occurs. -func (c *FakeMutatingWebhookConfigurations) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(mutatingwebhookconfigurationsResource, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingwebhookconfiguration.go b/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingwebhookconfiguration.go index 4bddb9ad2f1..7227fe08820 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingwebhookconfiguration.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingwebhookconfiguration.go @@ -97,15 +97,15 @@ func (c *FakeValidatingWebhookConfigurations) Update(ctx context.Context, valida } // Delete takes name of the validatingWebhookConfiguration and deletes it. Returns an error if one occurs. -func (c *FakeValidatingWebhookConfigurations) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(validatingwebhookconfigurationsResource, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go b/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go index 4643325a393..73ab9ecdee4 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go @@ -40,8 +40,8 @@ type MutatingWebhookConfigurationsGetter interface { type MutatingWebhookConfigurationInterface interface { Create(ctx context.Context, mutatingWebhookConfiguration *v1beta1.MutatingWebhookConfiguration, opts v1.CreateOptions) (*v1beta1.MutatingWebhookConfiguration, error) Update(ctx context.Context, mutatingWebhookConfiguration *v1beta1.MutatingWebhookConfiguration, opts v1.UpdateOptions) (*v1beta1.MutatingWebhookConfiguration, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.MutatingWebhookConfiguration, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.MutatingWebhookConfigurationList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -129,26 +129,26 @@ func (c *mutatingWebhookConfigurations) Update(ctx context.Context, mutatingWebh } // Delete takes name of the mutatingWebhookConfiguration and deletes it. Returns an error if one occurs. -func (c *mutatingWebhookConfigurations) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *mutatingWebhookConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("mutatingwebhookconfigurations"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *mutatingWebhookConfigurations) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *mutatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("mutatingwebhookconfigurations"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go b/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go index 26af233d00f..5ab0b9e3772 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go @@ -40,8 +40,8 @@ type ValidatingWebhookConfigurationsGetter interface { type ValidatingWebhookConfigurationInterface interface { Create(ctx context.Context, validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration, opts v1.CreateOptions) (*v1beta1.ValidatingWebhookConfiguration, error) Update(ctx context.Context, validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration, opts v1.UpdateOptions) (*v1beta1.ValidatingWebhookConfiguration, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ValidatingWebhookConfiguration, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ValidatingWebhookConfigurationList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -129,26 +129,26 @@ func (c *validatingWebhookConfigurations) Update(ctx context.Context, validating } // Delete takes name of the validatingWebhookConfiguration and deletes it. Returns an error if one occurs. -func (c *validatingWebhookConfigurations) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *validatingWebhookConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("validatingwebhookconfigurations"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *validatingWebhookConfigurations) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *validatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("validatingwebhookconfigurations"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/controllerrevision.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/controllerrevision.go index d3321e33aaf..dba06207a04 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/controllerrevision.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/controllerrevision.go @@ -40,8 +40,8 @@ type ControllerRevisionsGetter interface { type ControllerRevisionInterface interface { Create(ctx context.Context, controllerRevision *v1.ControllerRevision, opts metav1.CreateOptions) (*v1.ControllerRevision, error) Update(ctx context.Context, controllerRevision *v1.ControllerRevision, opts metav1.UpdateOptions) (*v1.ControllerRevision, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ControllerRevision, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ControllerRevisionList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -136,28 +136,28 @@ func (c *controllerRevisions) Update(ctx context.Context, controllerRevision *v1 } // Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs. -func (c *controllerRevisions) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *controllerRevisions) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("controllerrevisions"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *controllerRevisions) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *controllerRevisions) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("controllerrevisions"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/daemonset.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/daemonset.go index 4c78281ece0..0bb397af72d 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/daemonset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/daemonset.go @@ -41,8 +41,8 @@ type DaemonSetInterface interface { Create(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.CreateOptions) (*v1.DaemonSet, error) Update(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.UpdateOptions) (*v1.DaemonSet, error) UpdateStatus(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.UpdateOptions) (*v1.DaemonSet, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.DaemonSet, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.DaemonSetList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *daemonSets) UpdateStatus(ctx context.Context, daemonSet *v1.DaemonSet, } // Delete takes name of the daemonSet and deletes it. Returns an error if one occurs. -func (c *daemonSets) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *daemonSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("daemonsets"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *daemonSets) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *daemonSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("daemonsets"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/deployment.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/deployment.go index c7c32a035b8..69d1b86dc06 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/deployment.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/deployment.go @@ -42,8 +42,8 @@ type DeploymentInterface interface { Create(ctx context.Context, deployment *v1.Deployment, opts metav1.CreateOptions) (*v1.Deployment, error) Update(ctx context.Context, deployment *v1.Deployment, opts metav1.UpdateOptions) (*v1.Deployment, error) UpdateStatus(ctx context.Context, deployment *v1.Deployment, opts metav1.UpdateOptions) (*v1.Deployment, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Deployment, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.DeploymentList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -157,28 +157,28 @@ func (c *deployments) UpdateStatus(ctx context.Context, deployment *v1.Deploymen } // Delete takes name of the deployment and deletes it. Returns an error if one occurs. -func (c *deployments) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *deployments) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("deployments"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *deployments) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *deployments) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("deployments"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_controllerrevision.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_controllerrevision.go index b1ccd180903..959fc758da6 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_controllerrevision.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_controllerrevision.go @@ -103,7 +103,7 @@ func (c *FakeControllerRevisions) Update(ctx context.Context, controllerRevision } // Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs. -func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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{}) @@ -111,8 +111,8 @@ func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, optio } // DeleteCollection deletes a collection of objects. -func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(controllerrevisionsResource, c.ns, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_daemonset.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_daemonset.go index fc424954590..3a799f6de20 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_daemonset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_daemonset.go @@ -115,7 +115,7 @@ func (c *FakeDaemonSets) UpdateStatus(ctx context.Context, daemonSet *appsv1.Dae } // Delete takes name of the daemonSet and deletes it. Returns an error if one occurs. -func (c *FakeDaemonSets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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{}) @@ -123,8 +123,8 @@ func (c *FakeDaemonSets) Delete(ctx context.Context, name string, options *v1.De } // DeleteCollection deletes a collection of objects. -func (c *FakeDaemonSets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(daemonsetsResource, c.ns, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_deployment.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_deployment.go index 6b243acfe52..868742ac6c1 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_deployment.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_deployment.go @@ -116,7 +116,7 @@ func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *appsv1.D } // Delete takes name of the deployment and deletes it. Returns an error if one occurs. -func (c *FakeDeployments) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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{}) @@ -124,8 +124,8 @@ func (c *FakeDeployments) Delete(ctx context.Context, name string, options *v1.D } // DeleteCollection deletes a collection of objects. -func (c *FakeDeployments) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(deploymentsResource, c.ns, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_replicaset.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_replicaset.go index 38c7400bad6..9e6912b7ee8 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_replicaset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_replicaset.go @@ -116,7 +116,7 @@ func (c *FakeReplicaSets) UpdateStatus(ctx context.Context, replicaSet *appsv1.R } // Delete takes name of the replicaSet and deletes it. Returns an error if one occurs. -func (c *FakeReplicaSets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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{}) @@ -124,8 +124,8 @@ func (c *FakeReplicaSets) Delete(ctx context.Context, name string, options *v1.D } // DeleteCollection deletes a collection of objects. -func (c *FakeReplicaSets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(replicasetsResource, c.ns, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_statefulset.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_statefulset.go index 2accba210d0..65eea8dc3d8 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_statefulset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_statefulset.go @@ -116,7 +116,7 @@ func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *appsv1 } // Delete takes name of the statefulSet and deletes it. Returns an error if one occurs. -func (c *FakeStatefulSets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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{}) @@ -124,8 +124,8 @@ func (c *FakeStatefulSets) Delete(ctx context.Context, name string, options *v1. } // DeleteCollection deletes a collection of objects. -func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(statefulsetsResource, c.ns, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/replicaset.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/replicaset.go index 2b94003fb05..377b9ca37af 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/replicaset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/replicaset.go @@ -42,8 +42,8 @@ type ReplicaSetInterface interface { Create(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.CreateOptions) (*v1.ReplicaSet, error) Update(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.UpdateOptions) (*v1.ReplicaSet, error) UpdateStatus(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.UpdateOptions) (*v1.ReplicaSet, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ReplicaSet, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ReplicaSetList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -157,28 +157,28 @@ func (c *replicaSets) UpdateStatus(ctx context.Context, replicaSet *v1.ReplicaSe } // Delete takes name of the replicaSet and deletes it. Returns an error if one occurs. -func (c *replicaSets) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *replicaSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("replicasets"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *replicaSets) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *replicaSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("replicasets"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/statefulset.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/statefulset.go index 7fd748cfe9f..33a9f535c18 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/statefulset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1/statefulset.go @@ -42,8 +42,8 @@ type StatefulSetInterface interface { Create(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.CreateOptions) (*v1.StatefulSet, error) Update(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.UpdateOptions) (*v1.StatefulSet, error) UpdateStatus(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.UpdateOptions) (*v1.StatefulSet, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.StatefulSet, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.StatefulSetList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -157,28 +157,28 @@ func (c *statefulSets) UpdateStatus(ctx context.Context, statefulSet *v1.Statefu } // Delete takes name of the statefulSet and deletes it. Returns an error if one occurs. -func (c *statefulSets) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *statefulSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("statefulsets"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *statefulSets) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *statefulSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("statefulsets"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/controllerrevision.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/controllerrevision.go index d1833d03000..e247e07d036 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/controllerrevision.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/controllerrevision.go @@ -40,8 +40,8 @@ type ControllerRevisionsGetter interface { type ControllerRevisionInterface interface { Create(ctx context.Context, controllerRevision *v1beta1.ControllerRevision, opts v1.CreateOptions) (*v1beta1.ControllerRevision, error) Update(ctx context.Context, controllerRevision *v1beta1.ControllerRevision, opts v1.UpdateOptions) (*v1beta1.ControllerRevision, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ControllerRevision, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ControllerRevisionList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -136,28 +136,28 @@ func (c *controllerRevisions) Update(ctx context.Context, controllerRevision *v1 } // Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs. -func (c *controllerRevisions) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *controllerRevisions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("controllerrevisions"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *controllerRevisions) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *controllerRevisions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("controllerrevisions"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/deployment.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/deployment.go index 64480f32e1f..dc0dad044dc 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/deployment.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/deployment.go @@ -41,8 +41,8 @@ type DeploymentInterface interface { Create(ctx context.Context, deployment *v1beta1.Deployment, opts v1.CreateOptions) (*v1beta1.Deployment, error) Update(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (*v1beta1.Deployment, error) UpdateStatus(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (*v1beta1.Deployment, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Deployment, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.DeploymentList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *deployments) UpdateStatus(ctx context.Context, deployment *v1beta1.Depl } // Delete takes name of the deployment and deletes it. Returns an error if one occurs. -func (c *deployments) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *deployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("deployments"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *deployments) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *deployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("deployments"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_controllerrevision.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_controllerrevision.go index f005c6a7560..3215eca7d12 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_controllerrevision.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_controllerrevision.go @@ -103,7 +103,7 @@ func (c *FakeControllerRevisions) Update(ctx context.Context, controllerRevision } // Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs. -func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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{}) @@ -111,8 +111,8 @@ func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, optio } // DeleteCollection deletes a collection of objects. -func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(controllerrevisionsResource, c.ns, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_deployment.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_deployment.go index 1e76cde0780..d9a9bbd1678 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_deployment.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_deployment.go @@ -115,7 +115,7 @@ func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1beta1. } // Delete takes name of the deployment and deletes it. Returns an error if one occurs. -func (c *FakeDeployments) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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{}) @@ -123,8 +123,8 @@ func (c *FakeDeployments) Delete(ctx context.Context, name string, options *v1.D } // DeleteCollection deletes a collection of objects. -func (c *FakeDeployments) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(deploymentsResource, c.ns, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go index 6c443aedf35..ef77142ff10 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go @@ -115,7 +115,7 @@ func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta } // Delete takes name of the statefulSet and deletes it. Returns an error if one occurs. -func (c *FakeStatefulSets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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{}) @@ -123,8 +123,8 @@ func (c *FakeStatefulSets) Delete(ctx context.Context, name string, options *v1. } // DeleteCollection deletes a collection of objects. -func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(statefulsetsResource, c.ns, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go index 2b941a5feec..32ec548ab42 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go @@ -41,8 +41,8 @@ type StatefulSetInterface interface { Create(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.CreateOptions) (*v1beta1.StatefulSet, error) Update(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (*v1beta1.StatefulSet, error) UpdateStatus(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (*v1beta1.StatefulSet, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.StatefulSet, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.StatefulSetList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *statefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta1.St } // Delete takes name of the statefulSet and deletes it. Returns an error if one occurs. -func (c *statefulSets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *statefulSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("statefulsets"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *statefulSets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *statefulSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("statefulsets"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/controllerrevision.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/controllerrevision.go index f16e9883823..e8de2d0fd0a 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/controllerrevision.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/controllerrevision.go @@ -40,8 +40,8 @@ type ControllerRevisionsGetter interface { type ControllerRevisionInterface interface { Create(ctx context.Context, controllerRevision *v1beta2.ControllerRevision, opts v1.CreateOptions) (*v1beta2.ControllerRevision, error) Update(ctx context.Context, controllerRevision *v1beta2.ControllerRevision, opts v1.UpdateOptions) (*v1beta2.ControllerRevision, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.ControllerRevision, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.ControllerRevisionList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -136,28 +136,28 @@ func (c *controllerRevisions) Update(ctx context.Context, controllerRevision *v1 } // Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs. -func (c *controllerRevisions) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *controllerRevisions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("controllerrevisions"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *controllerRevisions) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *controllerRevisions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("controllerrevisions"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/daemonset.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/daemonset.go index 6cfedf19fb0..6d3a26d337c 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/daemonset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/daemonset.go @@ -41,8 +41,8 @@ type DaemonSetInterface interface { Create(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.CreateOptions) (*v1beta2.DaemonSet, error) Update(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.UpdateOptions) (*v1beta2.DaemonSet, error) UpdateStatus(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.UpdateOptions) (*v1beta2.DaemonSet, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.DaemonSet, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.DaemonSetList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *daemonSets) UpdateStatus(ctx context.Context, daemonSet *v1beta2.Daemon } // Delete takes name of the daemonSet and deletes it. Returns an error if one occurs. -func (c *daemonSets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *daemonSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("daemonsets"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *daemonSets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *daemonSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("daemonsets"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/deployment.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/deployment.go index abb09d2ab2e..2cdb539ef9f 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/deployment.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/deployment.go @@ -41,8 +41,8 @@ type DeploymentInterface interface { Create(ctx context.Context, deployment *v1beta2.Deployment, opts v1.CreateOptions) (*v1beta2.Deployment, error) Update(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (*v1beta2.Deployment, error) UpdateStatus(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (*v1beta2.Deployment, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.Deployment, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.DeploymentList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *deployments) UpdateStatus(ctx context.Context, deployment *v1beta2.Depl } // Delete takes name of the deployment and deletes it. Returns an error if one occurs. -func (c *deployments) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *deployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("deployments"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *deployments) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *deployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("deployments"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_controllerrevision.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_controllerrevision.go index a6d041f0f96..a29d7eb5846 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_controllerrevision.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_controllerrevision.go @@ -103,7 +103,7 @@ func (c *FakeControllerRevisions) Update(ctx context.Context, controllerRevision } // Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs. -func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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{}) @@ -111,8 +111,8 @@ func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, optio } // DeleteCollection deletes a collection of objects. -func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(controllerrevisionsResource, c.ns, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_daemonset.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_daemonset.go index 80b09794f9b..3e355e582ff 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_daemonset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_daemonset.go @@ -115,7 +115,7 @@ func (c *FakeDaemonSets) UpdateStatus(ctx context.Context, daemonSet *v1beta2.Da } // Delete takes name of the daemonSet and deletes it. Returns an error if one occurs. -func (c *FakeDaemonSets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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{}) @@ -123,8 +123,8 @@ func (c *FakeDaemonSets) Delete(ctx context.Context, name string, options *v1.De } // DeleteCollection deletes a collection of objects. -func (c *FakeDaemonSets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(daemonsetsResource, c.ns, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_deployment.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_deployment.go index 26cc4a4b6ac..c01fddb3334 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_deployment.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_deployment.go @@ -115,7 +115,7 @@ func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1beta2. } // Delete takes name of the deployment and deletes it. Returns an error if one occurs. -func (c *FakeDeployments) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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{}) @@ -123,8 +123,8 @@ func (c *FakeDeployments) Delete(ctx context.Context, name string, options *v1.D } // DeleteCollection deletes a collection of objects. -func (c *FakeDeployments) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(deploymentsResource, c.ns, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_replicaset.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_replicaset.go index 618c4ef74c8..1f623d29767 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_replicaset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_replicaset.go @@ -115,7 +115,7 @@ func (c *FakeReplicaSets) UpdateStatus(ctx context.Context, replicaSet *v1beta2. } // Delete takes name of the replicaSet and deletes it. Returns an error if one occurs. -func (c *FakeReplicaSets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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{}) @@ -123,8 +123,8 @@ func (c *FakeReplicaSets) Delete(ctx context.Context, name string, options *v1.D } // DeleteCollection deletes a collection of objects. -func (c *FakeReplicaSets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(replicasetsResource, c.ns, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go index ad6b736d687..035086e229d 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go @@ -115,7 +115,7 @@ func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta } // Delete takes name of the statefulSet and deletes it. Returns an error if one occurs. -func (c *FakeStatefulSets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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{}) @@ -123,8 +123,8 @@ func (c *FakeStatefulSets) Delete(ctx context.Context, name string, options *v1. } // DeleteCollection deletes a collection of objects. -func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(statefulsetsResource, c.ns, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/replicaset.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/replicaset.go index 84b7d16ae00..d7365bebb5d 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/replicaset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/replicaset.go @@ -41,8 +41,8 @@ type ReplicaSetInterface interface { Create(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.CreateOptions) (*v1beta2.ReplicaSet, error) Update(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (*v1beta2.ReplicaSet, error) UpdateStatus(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (*v1beta2.ReplicaSet, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.ReplicaSet, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.ReplicaSetList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *replicaSets) UpdateStatus(ctx context.Context, replicaSet *v1beta2.Repl } // Delete takes name of the replicaSet and deletes it. Returns an error if one occurs. -func (c *replicaSets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *replicaSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("replicasets"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *replicaSets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *replicaSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("replicasets"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/statefulset.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/statefulset.go index ed6393043f7..7458316990b 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/statefulset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/statefulset.go @@ -41,8 +41,8 @@ type StatefulSetInterface interface { Create(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.CreateOptions) (*v1beta2.StatefulSet, error) Update(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (*v1beta2.StatefulSet, error) UpdateStatus(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (*v1beta2.StatefulSet, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.StatefulSet, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.StatefulSetList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -156,28 +156,28 @@ func (c *statefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta2.St } // Delete takes name of the statefulSet and deletes it. Returns an error if one occurs. -func (c *statefulSets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *statefulSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("statefulsets"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *statefulSets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *statefulSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("statefulsets"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/auditsink.go b/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/auditsink.go index 68446e2176d..ea748c66225 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/auditsink.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/auditsink.go @@ -40,8 +40,8 @@ type AuditSinksGetter interface { type AuditSinkInterface interface { Create(ctx context.Context, auditSink *v1alpha1.AuditSink, opts v1.CreateOptions) (*v1alpha1.AuditSink, error) Update(ctx context.Context, auditSink *v1alpha1.AuditSink, opts v1.UpdateOptions) (*v1alpha1.AuditSink, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.AuditSink, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.AuditSinkList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -129,26 +129,26 @@ func (c *auditSinks) Update(ctx context.Context, auditSink *v1alpha1.AuditSink, } // Delete takes name of the auditSink and deletes it. Returns an error if one occurs. -func (c *auditSinks) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *auditSinks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("auditsinks"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *auditSinks) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *auditSinks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("auditsinks"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/fake/fake_auditsink.go b/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/fake/fake_auditsink.go index bd0c95be21f..f97c6747143 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/fake/fake_auditsink.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/fake/fake_auditsink.go @@ -97,15 +97,15 @@ func (c *FakeAuditSinks) Update(ctx context.Context, auditSink *v1alpha1.AuditSi } // Delete takes name of the auditSink and deletes it. Returns an error if one occurs. -func (c *FakeAuditSinks) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeAuditSinks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(auditsinksResource, name), &v1alpha1.AuditSink{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeAuditSinks) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(auditsinksResource, listOptions) +func (c *FakeAuditSinks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(auditsinksResource, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.AuditSinkList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go index 22fe6d45739..82b8709a949 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go @@ -115,7 +115,7 @@ func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizon } // Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs. -func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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{}) @@ -123,8 +123,8 @@ func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string, } // DeleteCollection deletes a collection of objects. -func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(horizontalpodautoscalersResource, c.ns, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go index 1228ce73135..ca8e0da8ba0 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go @@ -41,8 +41,8 @@ type HorizontalPodAutoscalerInterface interface { Create(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.CreateOptions) (*v1.HorizontalPodAutoscaler, error) Update(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (*v1.HorizontalPodAutoscaler, error) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (*v1.HorizontalPodAutoscaler, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.HorizontalPodAutoscaler, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.HorizontalPodAutoscalerList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *horizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalP } // Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs. -func (c *horizontalPodAutoscalers) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *horizontalPodAutoscalers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("horizontalpodautoscalers"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *horizontalPodAutoscalers) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *horizontalPodAutoscalers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("horizontalpodautoscalers"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_horizontalpodautoscaler.go b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_horizontalpodautoscaler.go index de28395fa67..292d01814b0 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_horizontalpodautoscaler.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_horizontalpodautoscaler.go @@ -115,7 +115,7 @@ func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizon } // Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs. -func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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{}) @@ -123,8 +123,8 @@ func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string, } // DeleteCollection deletes a collection of objects. -func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(horizontalpodautoscalersResource, c.ns, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go index a5b564d042a..f1637c1b85b 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go @@ -41,8 +41,8 @@ type HorizontalPodAutoscalerInterface interface { Create(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.CreateOptions) (*v2beta1.HorizontalPodAutoscaler, error) Update(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2beta1.HorizontalPodAutoscaler, error) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2beta1.HorizontalPodAutoscaler, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v2beta1.HorizontalPodAutoscaler, error) List(ctx context.Context, opts v1.ListOptions) (*v2beta1.HorizontalPodAutoscalerList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *horizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalP } // Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs. -func (c *horizontalPodAutoscalers) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *horizontalPodAutoscalers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("horizontalpodautoscalers"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *horizontalPodAutoscalers) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *horizontalPodAutoscalers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("horizontalpodautoscalers"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/fake_horizontalpodautoscaler.go b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/fake_horizontalpodautoscaler.go index 18ea026c164..845568b3311 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/fake_horizontalpodautoscaler.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/fake_horizontalpodautoscaler.go @@ -115,7 +115,7 @@ func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizon } // Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs. -func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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{}) @@ -123,8 +123,8 @@ func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string, } // DeleteCollection deletes a collection of objects. -func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(horizontalpodautoscalersResource, c.ns, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go index 168137d72bb..c7fad108087 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go @@ -41,8 +41,8 @@ type HorizontalPodAutoscalerInterface interface { Create(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.CreateOptions) (*v2beta2.HorizontalPodAutoscaler, error) Update(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2beta2.HorizontalPodAutoscaler, error) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2beta2.HorizontalPodAutoscaler, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v2beta2.HorizontalPodAutoscaler, error) List(ctx context.Context, opts v1.ListOptions) (*v2beta2.HorizontalPodAutoscalerList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *horizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalP } // Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs. -func (c *horizontalPodAutoscalers) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *horizontalPodAutoscalers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("horizontalpodautoscalers"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *horizontalPodAutoscalers) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *horizontalPodAutoscalers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("horizontalpodautoscalers"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_job.go b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_job.go index b09872952c8..45c0ad1ee78 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_job.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_job.go @@ -115,7 +115,7 @@ func (c *FakeJobs) UpdateStatus(ctx context.Context, job *batchv1.Job, opts v1.U } // Delete takes name of the job and deletes it. Returns an error if one occurs. -func (c *FakeJobs) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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{}) @@ -123,8 +123,8 @@ func (c *FakeJobs) Delete(ctx context.Context, name string, options *v1.DeleteOp } // DeleteCollection deletes a collection of objects. -func (c *FakeJobs) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(jobsResource, c.ns, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/job.go b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/job.go index 1ad12320cbd..a20c8e0e4e4 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/job.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/job.go @@ -41,8 +41,8 @@ type JobInterface interface { Create(ctx context.Context, job *v1.Job, opts metav1.CreateOptions) (*v1.Job, error) Update(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (*v1.Job, error) UpdateStatus(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (*v1.Job, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Job, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.JobList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *jobs) UpdateStatus(ctx context.Context, job *v1.Job, opts metav1.Update } // Delete takes name of the job and deletes it. Returns an error if one occurs. -func (c *jobs) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *jobs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("jobs"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *jobs) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *jobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("jobs"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1beta1/cronjob.go b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1beta1/cronjob.go index 743360e9934..076520296b5 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1beta1/cronjob.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1beta1/cronjob.go @@ -41,8 +41,8 @@ type CronJobInterface interface { Create(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.CreateOptions) (*v1beta1.CronJob, error) Update(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.UpdateOptions) (*v1beta1.CronJob, error) UpdateStatus(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.UpdateOptions) (*v1beta1.CronJob, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.CronJob, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CronJobList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *cronJobs) UpdateStatus(ctx context.Context, cronJob *v1beta1.CronJob, o } // Delete takes name of the cronJob and deletes it. Returns an error if one occurs. -func (c *cronJobs) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *cronJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("cronjobs"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *cronJobs) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *cronJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("cronjobs"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_cronjob.go b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_cronjob.go index 3cc605dff5b..303b7506a1f 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_cronjob.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_cronjob.go @@ -115,7 +115,7 @@ func (c *FakeCronJobs) UpdateStatus(ctx context.Context, cronJob *v1beta1.CronJo } // Delete takes name of the cronJob and deletes it. Returns an error if one occurs. -func (c *FakeCronJobs) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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{}) @@ -123,8 +123,8 @@ func (c *FakeCronJobs) Delete(ctx context.Context, name string, options *v1.Dele } // DeleteCollection deletes a collection of objects. -func (c *FakeCronJobs) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(cronjobsResource, c.ns, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go index ea3cfefc93b..a25054f2443 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go @@ -41,8 +41,8 @@ type CronJobInterface interface { Create(ctx context.Context, cronJob *v2alpha1.CronJob, opts v1.CreateOptions) (*v2alpha1.CronJob, error) Update(ctx context.Context, cronJob *v2alpha1.CronJob, opts v1.UpdateOptions) (*v2alpha1.CronJob, error) UpdateStatus(ctx context.Context, cronJob *v2alpha1.CronJob, opts v1.UpdateOptions) (*v2alpha1.CronJob, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v2alpha1.CronJob, error) List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.CronJobList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *cronJobs) UpdateStatus(ctx context.Context, cronJob *v2alpha1.CronJob, } // Delete takes name of the cronJob and deletes it. Returns an error if one occurs. -func (c *cronJobs) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *cronJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("cronjobs"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *cronJobs) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *cronJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("cronjobs"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_cronjob.go b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_cronjob.go index f004d6793aa..3cd1bc159fb 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_cronjob.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_cronjob.go @@ -115,7 +115,7 @@ func (c *FakeCronJobs) UpdateStatus(ctx context.Context, cronJob *v2alpha1.CronJ } // Delete takes name of the cronJob and deletes it. Returns an error if one occurs. -func (c *FakeCronJobs) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeCronJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(cronjobsResource, c.ns, name), &v2alpha1.CronJob{}) @@ -123,8 +123,8 @@ func (c *FakeCronJobs) Delete(ctx context.Context, name string, options *v1.Dele } // DeleteCollection deletes a collection of objects. -func (c *FakeCronJobs) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(cronjobsResource, c.ns, listOptions) +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, &v2alpha1.CronJobList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go b/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go index a53b7e7477e..6b2623b8aeb 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go @@ -41,8 +41,8 @@ type CertificateSigningRequestInterface interface { Create(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.CreateOptions) (*v1beta1.CertificateSigningRequest, error) Update(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.UpdateOptions) (*v1beta1.CertificateSigningRequest, error) UpdateStatus(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.UpdateOptions) (*v1beta1.CertificateSigningRequest, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.CertificateSigningRequest, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CertificateSigningRequestList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -145,26 +145,26 @@ func (c *certificateSigningRequests) UpdateStatus(ctx context.Context, certifica } // Delete takes name of the certificateSigningRequest and deletes it. Returns an error if one occurs. -func (c *certificateSigningRequests) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *certificateSigningRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("certificatesigningrequests"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *certificateSigningRequests) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *certificateSigningRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("certificatesigningrequests"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest.go b/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest.go index 53b73318096..9c1bd38473b 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest.go @@ -108,15 +108,15 @@ func (c *FakeCertificateSigningRequests) UpdateStatus(ctx context.Context, certi } // Delete takes name of the certificateSigningRequest and deletes it. Returns an error if one occurs. -func (c *FakeCertificateSigningRequests) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(certificatesigningrequestsResource, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/coordination/v1/fake/fake_lease.go b/staging/src/k8s.io/client-go/kubernetes/typed/coordination/v1/fake/fake_lease.go index ba65f6205e3..1c979de00fc 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/coordination/v1/fake/fake_lease.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/coordination/v1/fake/fake_lease.go @@ -103,7 +103,7 @@ func (c *FakeLeases) Update(ctx context.Context, lease *coordinationv1.Lease, op } // Delete takes name of the lease and deletes it. Returns an error if one occurs. -func (c *FakeLeases) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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{}) @@ -111,8 +111,8 @@ func (c *FakeLeases) Delete(ctx context.Context, name string, options *v1.Delete } // DeleteCollection deletes a collection of objects. -func (c *FakeLeases) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(leasesResource, c.ns, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/coordination/v1/lease.go b/staging/src/k8s.io/client-go/kubernetes/typed/coordination/v1/lease.go index 5077779b0be..4e8cbf9d614 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/coordination/v1/lease.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/coordination/v1/lease.go @@ -40,8 +40,8 @@ type LeasesGetter interface { type LeaseInterface interface { Create(ctx context.Context, lease *v1.Lease, opts metav1.CreateOptions) (*v1.Lease, error) Update(ctx context.Context, lease *v1.Lease, opts metav1.UpdateOptions) (*v1.Lease, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Lease, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.LeaseList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -136,28 +136,28 @@ func (c *leases) Update(ctx context.Context, lease *v1.Lease, opts metav1.Update } // Delete takes name of the lease and deletes it. Returns an error if one occurs. -func (c *leases) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *leases) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("leases"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *leases) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *leases) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("leases"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake/fake_lease.go b/staging/src/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake/fake_lease.go index 53fc60bafff..4ab5b2ebd42 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake/fake_lease.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake/fake_lease.go @@ -103,7 +103,7 @@ func (c *FakeLeases) Update(ctx context.Context, lease *v1beta1.Lease, opts v1.U } // Delete takes name of the lease and deletes it. Returns an error if one occurs. -func (c *FakeLeases) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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{}) @@ -111,8 +111,8 @@ func (c *FakeLeases) Delete(ctx context.Context, name string, options *v1.Delete } // DeleteCollection deletes a collection of objects. -func (c *FakeLeases) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(leasesResource, c.ns, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/lease.go b/staging/src/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/lease.go index ca65b57fa73..c73cb0a97db 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/lease.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/lease.go @@ -40,8 +40,8 @@ type LeasesGetter interface { type LeaseInterface interface { Create(ctx context.Context, lease *v1beta1.Lease, opts v1.CreateOptions) (*v1beta1.Lease, error) Update(ctx context.Context, lease *v1beta1.Lease, opts v1.UpdateOptions) (*v1beta1.Lease, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Lease, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.LeaseList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -136,28 +136,28 @@ func (c *leases) Update(ctx context.Context, lease *v1beta1.Lease, opts v1.Updat } // Delete takes name of the lease and deletes it. Returns an error if one occurs. -func (c *leases) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *leases) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("leases"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *leases) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *leases) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("leases"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go index 230ea29c5f5..faf5d19cc1e 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go @@ -40,8 +40,8 @@ type ComponentStatusesGetter interface { type ComponentStatusInterface interface { Create(ctx context.Context, componentStatus *v1.ComponentStatus, opts metav1.CreateOptions) (*v1.ComponentStatus, error) Update(ctx context.Context, componentStatus *v1.ComponentStatus, opts metav1.UpdateOptions) (*v1.ComponentStatus, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ComponentStatus, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ComponentStatusList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -129,26 +129,26 @@ func (c *componentStatuses) Update(ctx context.Context, componentStatus *v1.Comp } // Delete takes name of the componentStatus and deletes it. Returns an error if one occurs. -func (c *componentStatuses) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *componentStatuses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Resource("componentstatuses"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *componentStatuses) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *componentStatuses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("componentstatuses"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go index c4f70908135..407d25a462b 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go @@ -40,8 +40,8 @@ type ConfigMapsGetter interface { type ConfigMapInterface interface { Create(ctx context.Context, configMap *v1.ConfigMap, opts metav1.CreateOptions) (*v1.ConfigMap, error) Update(ctx context.Context, configMap *v1.ConfigMap, opts metav1.UpdateOptions) (*v1.ConfigMap, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ConfigMap, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ConfigMapList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -136,28 +136,28 @@ func (c *configMaps) Update(ctx context.Context, configMap *v1.ConfigMap, opts m } // Delete takes name of the configMap and deletes it. Returns an error if one occurs. -func (c *configMaps) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *configMaps) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("configmaps"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *configMaps) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *configMaps) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("configmaps"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go index 925b9e94cb6..c36eaaa4ab6 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go @@ -40,8 +40,8 @@ type EndpointsGetter interface { type EndpointsInterface interface { Create(ctx context.Context, endpoints *v1.Endpoints, opts metav1.CreateOptions) (*v1.Endpoints, error) Update(ctx context.Context, endpoints *v1.Endpoints, opts metav1.UpdateOptions) (*v1.Endpoints, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Endpoints, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.EndpointsList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -136,28 +136,28 @@ func (c *endpoints) Update(ctx context.Context, endpoints *v1.Endpoints, opts me } // Delete takes name of the endpoints and deletes it. Returns an error if one occurs. -func (c *endpoints) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *endpoints) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("endpoints"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *endpoints) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *endpoints) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("endpoints"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/event.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/event.go index 1073effcc6d..9b669920f19 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/event.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/event.go @@ -40,8 +40,8 @@ type EventsGetter interface { type EventInterface interface { Create(ctx context.Context, event *v1.Event, opts metav1.CreateOptions) (*v1.Event, error) Update(ctx context.Context, event *v1.Event, opts metav1.UpdateOptions) (*v1.Event, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Event, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.EventList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -136,28 +136,28 @@ func (c *events) Update(ctx context.Context, event *v1.Event, opts metav1.Update } // Delete takes name of the event and deletes it. Returns an error if one occurs. -func (c *events) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *events) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("events"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *events) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *events) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("events"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_componentstatus.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_componentstatus.go index 967b9f7c6a2..08ff515df1f 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_componentstatus.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_componentstatus.go @@ -97,15 +97,15 @@ func (c *FakeComponentStatuses) Update(ctx context.Context, componentStatus *cor } // Delete takes name of the componentStatus and deletes it. Returns an error if one occurs. -func (c *FakeComponentStatuses) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(componentstatusesResource, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_configmap.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_configmap.go index 299306064d8..6c541ec7d36 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_configmap.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_configmap.go @@ -103,7 +103,7 @@ func (c *FakeConfigMaps) Update(ctx context.Context, configMap *corev1.ConfigMap } // Delete takes name of the configMap and deletes it. Returns an error if one occurs. -func (c *FakeConfigMaps) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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{}) @@ -111,8 +111,8 @@ func (c *FakeConfigMaps) Delete(ctx context.Context, name string, options *v1.De } // DeleteCollection deletes a collection of objects. -func (c *FakeConfigMaps) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(configmapsResource, c.ns, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_endpoints.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_endpoints.go index 4c898728b86..02c03223aae 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_endpoints.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_endpoints.go @@ -103,7 +103,7 @@ func (c *FakeEndpoints) Update(ctx context.Context, endpoints *corev1.Endpoints, } // Delete takes name of the endpoints and deletes it. Returns an error if one occurs. -func (c *FakeEndpoints) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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{}) @@ -111,8 +111,8 @@ func (c *FakeEndpoints) Delete(ctx context.Context, name string, options *v1.Del } // DeleteCollection deletes a collection of objects. -func (c *FakeEndpoints) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(endpointsResource, c.ns, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event.go index ca531f5c889..2e4787dc7f9 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event.go @@ -103,7 +103,7 @@ func (c *FakeEvents) Update(ctx context.Context, event *corev1.Event, opts v1.Up } // Delete takes name of the event and deletes it. Returns an error if one occurs. -func (c *FakeEvents) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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{}) @@ -111,8 +111,8 @@ func (c *FakeEvents) Delete(ctx context.Context, name string, options *v1.Delete } // DeleteCollection deletes a collection of objects. -func (c *FakeEvents) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(eventsResource, c.ns, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_limitrange.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_limitrange.go index 52e473b1eb7..eb0bde8e598 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_limitrange.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_limitrange.go @@ -103,7 +103,7 @@ func (c *FakeLimitRanges) Update(ctx context.Context, limitRange *corev1.LimitRa } // Delete takes name of the limitRange and deletes it. Returns an error if one occurs. -func (c *FakeLimitRanges) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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{}) @@ -111,8 +111,8 @@ func (c *FakeLimitRanges) Delete(ctx context.Context, name string, options *v1.D } // DeleteCollection deletes a collection of objects. -func (c *FakeLimitRanges) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(limitrangesResource, c.ns, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace.go index 12b68516870..efb93758038 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace.go @@ -108,7 +108,7 @@ func (c *FakeNamespaces) UpdateStatus(ctx context.Context, namespace *corev1.Nam } // Delete takes name of the namespace and deletes it. Returns an error if one occurs. -func (c *FakeNamespaces) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node.go index 0d9f566b12a..47c3a216866 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node.go @@ -108,15 +108,15 @@ func (c *FakeNodes) UpdateStatus(ctx context.Context, node *corev1.Node, opts v1 } // Delete takes name of the node and deletes it. Returns an error if one occurs. -func (c *FakeNodes) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(nodesResource, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolume.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolume.go index f5c9f158345..94e093073da 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolume.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolume.go @@ -108,15 +108,15 @@ func (c *FakePersistentVolumes) UpdateStatus(ctx context.Context, persistentVolu } // Delete takes name of the persistentVolume and deletes it. Returns an error if one occurs. -func (c *FakePersistentVolumes) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(persistentvolumesResource, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go index de0dd1c1a5d..7b9a38da0eb 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go @@ -115,7 +115,7 @@ func (c *FakePersistentVolumeClaims) UpdateStatus(ctx context.Context, persisten } // Delete takes name of the persistentVolumeClaim and deletes it. Returns an error if one occurs. -func (c *FakePersistentVolumeClaims) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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{}) @@ -123,8 +123,8 @@ func (c *FakePersistentVolumeClaims) Delete(ctx context.Context, name string, op } // DeleteCollection deletes a collection of objects. -func (c *FakePersistentVolumeClaims) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(persistentvolumeclaimsResource, c.ns, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go index e408fd0af5c..b2f1b153151 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go @@ -115,7 +115,7 @@ func (c *FakePods) UpdateStatus(ctx context.Context, pod *corev1.Pod, opts v1.Up } // Delete takes name of the pod and deletes it. Returns an error if one occurs. -func (c *FakePods) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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{}) @@ -123,8 +123,8 @@ func (c *FakePods) Delete(ctx context.Context, name string, options *v1.DeleteOp } // DeleteCollection deletes a collection of objects. -func (c *FakePods) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(podsResource, c.ns, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_podtemplate.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_podtemplate.go index 905cafeae4b..579fe1c7a72 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_podtemplate.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_podtemplate.go @@ -103,7 +103,7 @@ func (c *FakePodTemplates) Update(ctx context.Context, podTemplate *corev1.PodTe } // Delete takes name of the podTemplate and deletes it. Returns an error if one occurs. -func (c *FakePodTemplates) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakePodTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(podtemplatesResource, c.ns, name), &corev1.PodTemplate{}) @@ -111,8 +111,8 @@ func (c *FakePodTemplates) Delete(ctx context.Context, name string, options *v1. } // DeleteCollection deletes a collection of objects. -func (c *FakePodTemplates) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(podtemplatesResource, c.ns, listOptions) +func (c *FakePodTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(podtemplatesResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &corev1.PodTemplateList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go index 12d5d9423a8..3fa03a07631 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go @@ -116,7 +116,7 @@ func (c *FakeReplicationControllers) UpdateStatus(ctx context.Context, replicati } // Delete takes name of the replicationController and deletes it. Returns an error if one occurs. -func (c *FakeReplicationControllers) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeReplicationControllers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(replicationcontrollersResource, c.ns, name), &corev1.ReplicationController{}) @@ -124,8 +124,8 @@ func (c *FakeReplicationControllers) Delete(ctx context.Context, name string, op } // DeleteCollection deletes a collection of objects. -func (c *FakeReplicationControllers) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(replicationcontrollersResource, c.ns, listOptions) +func (c *FakeReplicationControllers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(replicationcontrollersResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &corev1.ReplicationControllerList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_resourcequota.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_resourcequota.go index c867270c0b5..f70de308494 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_resourcequota.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_resourcequota.go @@ -115,7 +115,7 @@ func (c *FakeResourceQuotas) UpdateStatus(ctx context.Context, resourceQuota *co } // Delete takes name of the resourceQuota and deletes it. Returns an error if one occurs. -func (c *FakeResourceQuotas) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeResourceQuotas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(resourcequotasResource, c.ns, name), &corev1.ResourceQuota{}) @@ -123,8 +123,8 @@ func (c *FakeResourceQuotas) Delete(ctx context.Context, name string, options *v } // DeleteCollection deletes a collection of objects. -func (c *FakeResourceQuotas) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(resourcequotasResource, c.ns, listOptions) +func (c *FakeResourceQuotas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(resourcequotasResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &corev1.ResourceQuotaList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_secret.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_secret.go index 38703f14682..a92329cfaae 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_secret.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_secret.go @@ -103,7 +103,7 @@ func (c *FakeSecrets) Update(ctx context.Context, secret *corev1.Secret, opts v1 } // Delete takes name of the secret and deletes it. Returns an error if one occurs. -func (c *FakeSecrets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeSecrets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(secretsResource, c.ns, name), &corev1.Secret{}) @@ -111,8 +111,8 @@ func (c *FakeSecrets) Delete(ctx context.Context, name string, options *v1.Delet } // DeleteCollection deletes a collection of objects. -func (c *FakeSecrets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(secretsResource, c.ns, listOptions) +func (c *FakeSecrets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(secretsResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &corev1.SecretList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_service.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_service.go index dd47bee64e0..e5391ffb383 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_service.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_service.go @@ -115,7 +115,7 @@ func (c *FakeServices) UpdateStatus(ctx context.Context, service *corev1.Service } // Delete takes name of the service and deletes it. Returns an error if one occurs. -func (c *FakeServices) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(servicesResource, c.ns, name), &corev1.Service{}) diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_serviceaccount.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_serviceaccount.go index 78556d147d0..df344b5893b 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_serviceaccount.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_serviceaccount.go @@ -104,7 +104,7 @@ func (c *FakeServiceAccounts) Update(ctx context.Context, serviceAccount *corev1 } // Delete takes name of the serviceAccount and deletes it. Returns an error if one occurs. -func (c *FakeServiceAccounts) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeServiceAccounts) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(serviceaccountsResource, c.ns, name), &corev1.ServiceAccount{}) @@ -112,8 +112,8 @@ func (c *FakeServiceAccounts) Delete(ctx context.Context, name string, options * } // DeleteCollection deletes a collection of objects. -func (c *FakeServiceAccounts) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(serviceaccountsResource, c.ns, listOptions) +func (c *FakeServiceAccounts) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(serviceaccountsResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &corev1.ServiceAccountList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go index c6ecda1f0d3..7031cd77ed9 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go @@ -40,8 +40,8 @@ type LimitRangesGetter interface { type LimitRangeInterface interface { Create(ctx context.Context, limitRange *v1.LimitRange, opts metav1.CreateOptions) (*v1.LimitRange, error) Update(ctx context.Context, limitRange *v1.LimitRange, opts metav1.UpdateOptions) (*v1.LimitRange, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.LimitRange, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.LimitRangeList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -136,28 +136,28 @@ func (c *limitRanges) Update(ctx context.Context, limitRange *v1.LimitRange, opt } // Delete takes name of the limitRange and deletes it. Returns an error if one occurs. -func (c *limitRanges) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *limitRanges) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("limitranges"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *limitRanges) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *limitRanges) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("limitranges"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go index afd4237bfc8..55b03d65b2b 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go @@ -41,7 +41,7 @@ type NamespaceInterface interface { Create(ctx context.Context, namespace *v1.Namespace, opts metav1.CreateOptions) (*v1.Namespace, error) Update(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (*v1.Namespace, error) UpdateStatus(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (*v1.Namespace, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Namespace, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.NamespaceList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -144,11 +144,11 @@ func (c *namespaces) UpdateStatus(ctx context.Context, namespace *v1.Namespace, } // Delete takes name of the namespace and deletes it. Returns an error if one occurs. -func (c *namespaces) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *namespaces) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Resource("namespaces"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/node.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/node.go index f90657fd180..6176808f426 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/node.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/node.go @@ -41,8 +41,8 @@ type NodeInterface interface { Create(ctx context.Context, node *v1.Node, opts metav1.CreateOptions) (*v1.Node, error) Update(ctx context.Context, node *v1.Node, opts metav1.UpdateOptions) (*v1.Node, error) UpdateStatus(ctx context.Context, node *v1.Node, opts metav1.UpdateOptions) (*v1.Node, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Node, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.NodeList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -145,26 +145,26 @@ func (c *nodes) UpdateStatus(ctx context.Context, node *v1.Node, opts metav1.Upd } // Delete takes name of the node and deletes it. Returns an error if one occurs. -func (c *nodes) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *nodes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Resource("nodes"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *nodes) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *nodes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("nodes"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go index 9392aa0e744..1eb9db635a6 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go @@ -41,8 +41,8 @@ type PersistentVolumeInterface interface { Create(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.CreateOptions) (*v1.PersistentVolume, error) Update(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.UpdateOptions) (*v1.PersistentVolume, error) UpdateStatus(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.UpdateOptions) (*v1.PersistentVolume, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PersistentVolume, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.PersistentVolumeList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -145,26 +145,26 @@ func (c *persistentVolumes) UpdateStatus(ctx context.Context, persistentVolume * } // Delete takes name of the persistentVolume and deletes it. Returns an error if one occurs. -func (c *persistentVolumes) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *persistentVolumes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Resource("persistentvolumes"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *persistentVolumes) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *persistentVolumes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("persistentvolumes"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go index f91db21e823..f4e205f4e88 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go @@ -41,8 +41,8 @@ type PersistentVolumeClaimInterface interface { Create(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.CreateOptions) (*v1.PersistentVolumeClaim, error) Update(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.UpdateOptions) (*v1.PersistentVolumeClaim, error) UpdateStatus(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.UpdateOptions) (*v1.PersistentVolumeClaim, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PersistentVolumeClaim, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.PersistentVolumeClaimList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *persistentVolumeClaims) UpdateStatus(ctx context.Context, persistentVol } // Delete takes name of the persistentVolumeClaim and deletes it. Returns an error if one occurs. -func (c *persistentVolumeClaims) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *persistentVolumeClaims) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("persistentvolumeclaims"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *persistentVolumeClaims) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *persistentVolumeClaims) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("persistentvolumeclaims"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/pod.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/pod.go index cc143a38a30..36092ab640f 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/pod.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/pod.go @@ -41,8 +41,8 @@ type PodInterface interface { Create(ctx context.Context, pod *v1.Pod, opts metav1.CreateOptions) (*v1.Pod, error) Update(ctx context.Context, pod *v1.Pod, opts metav1.UpdateOptions) (*v1.Pod, error) UpdateStatus(ctx context.Context, pod *v1.Pod, opts metav1.UpdateOptions) (*v1.Pod, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Pod, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.PodList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -156,28 +156,28 @@ func (c *pods) UpdateStatus(ctx context.Context, pod *v1.Pod, opts metav1.Update } // Delete takes name of the pod and deletes it. Returns an error if one occurs. -func (c *pods) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *pods) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("pods"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *pods) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *pods) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("pods"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go index 22b427232e4..012d3b52c42 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go @@ -40,8 +40,8 @@ type PodTemplatesGetter interface { type PodTemplateInterface interface { Create(ctx context.Context, podTemplate *v1.PodTemplate, opts metav1.CreateOptions) (*v1.PodTemplate, error) Update(ctx context.Context, podTemplate *v1.PodTemplate, opts metav1.UpdateOptions) (*v1.PodTemplate, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PodTemplate, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.PodTemplateList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -136,28 +136,28 @@ func (c *podTemplates) Update(ctx context.Context, podTemplate *v1.PodTemplate, } // Delete takes name of the podTemplate and deletes it. Returns an error if one occurs. -func (c *podTemplates) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *podTemplates) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("podtemplates"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *podTemplates) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *podTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("podtemplates"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go index 1ecbdaf775a..8e9ccd59de6 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go @@ -42,8 +42,8 @@ type ReplicationControllerInterface interface { Create(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.CreateOptions) (*v1.ReplicationController, error) Update(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.UpdateOptions) (*v1.ReplicationController, error) UpdateStatus(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.UpdateOptions) (*v1.ReplicationController, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ReplicationController, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ReplicationControllerList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -157,28 +157,28 @@ func (c *replicationControllers) UpdateStatus(ctx context.Context, replicationCo } // Delete takes name of the replicationController and deletes it. Returns an error if one occurs. -func (c *replicationControllers) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *replicationControllers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("replicationcontrollers"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *replicationControllers) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *replicationControllers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("replicationcontrollers"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go index 12dc525eeb3..6a41e35fdb2 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go @@ -41,8 +41,8 @@ type ResourceQuotaInterface interface { Create(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.CreateOptions) (*v1.ResourceQuota, error) Update(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.UpdateOptions) (*v1.ResourceQuota, error) UpdateStatus(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.UpdateOptions) (*v1.ResourceQuota, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ResourceQuota, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ResourceQuotaList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *resourceQuotas) UpdateStatus(ctx context.Context, resourceQuota *v1.Res } // Delete takes name of the resourceQuota and deletes it. Returns an error if one occurs. -func (c *resourceQuotas) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *resourceQuotas) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("resourcequotas"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *resourceQuotas) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *resourceQuotas) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("resourcequotas"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/secret.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/secret.go index fb9ff7fb328..b2bd80baa52 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/secret.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/secret.go @@ -40,8 +40,8 @@ type SecretsGetter interface { type SecretInterface interface { Create(ctx context.Context, secret *v1.Secret, opts metav1.CreateOptions) (*v1.Secret, error) Update(ctx context.Context, secret *v1.Secret, opts metav1.UpdateOptions) (*v1.Secret, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Secret, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.SecretList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -136,28 +136,28 @@ func (c *secrets) Update(ctx context.Context, secret *v1.Secret, opts metav1.Upd } // Delete takes name of the secret and deletes it. Returns an error if one occurs. -func (c *secrets) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *secrets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("secrets"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *secrets) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *secrets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("secrets"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/service.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/service.go index 56630c7cdf3..ddde2ec6c7b 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/service.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/service.go @@ -41,7 +41,7 @@ type ServiceInterface interface { Create(ctx context.Context, service *v1.Service, opts metav1.CreateOptions) (*v1.Service, error) Update(ctx context.Context, service *v1.Service, opts metav1.UpdateOptions) (*v1.Service, error) UpdateStatus(ctx context.Context, service *v1.Service, opts metav1.UpdateOptions) (*v1.Service, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Service, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -152,12 +152,12 @@ func (c *services) UpdateStatus(ctx context.Context, service *v1.Service, opts m } // Delete takes name of the service and deletes it. Returns an error if one occurs. -func (c *services) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *services) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("services"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go index 671c3726f49..c2ddfbfdb74 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go @@ -41,8 +41,8 @@ type ServiceAccountsGetter interface { type ServiceAccountInterface interface { Create(ctx context.Context, serviceAccount *v1.ServiceAccount, opts metav1.CreateOptions) (*v1.ServiceAccount, error) Update(ctx context.Context, serviceAccount *v1.ServiceAccount, opts metav1.UpdateOptions) (*v1.ServiceAccount, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceAccount, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceAccountList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -139,28 +139,28 @@ func (c *serviceAccounts) Update(ctx context.Context, serviceAccount *v1.Service } // Delete takes name of the serviceAccount and deletes it. Returns an error if one occurs. -func (c *serviceAccounts) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *serviceAccounts) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("serviceaccounts"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *serviceAccounts) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *serviceAccounts) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("serviceaccounts"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/endpointslice.go b/staging/src/k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/endpointslice.go index 6f39aa71413..63b4627d337 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/endpointslice.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/endpointslice.go @@ -40,8 +40,8 @@ type EndpointSlicesGetter interface { type EndpointSliceInterface interface { Create(ctx context.Context, endpointSlice *v1alpha1.EndpointSlice, opts v1.CreateOptions) (*v1alpha1.EndpointSlice, error) Update(ctx context.Context, endpointSlice *v1alpha1.EndpointSlice, opts v1.UpdateOptions) (*v1alpha1.EndpointSlice, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.EndpointSlice, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.EndpointSliceList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -136,28 +136,28 @@ func (c *endpointSlices) Update(ctx context.Context, endpointSlice *v1alpha1.End } // Delete takes name of the endpointSlice and deletes it. Returns an error if one occurs. -func (c *endpointSlices) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *endpointSlices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("endpointslices"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *endpointSlices) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *endpointSlices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("endpointslices"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/fake/fake_endpointslice.go b/staging/src/k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/fake/fake_endpointslice.go index 61d6a5873fc..f180340ab67 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/fake/fake_endpointslice.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/fake/fake_endpointslice.go @@ -103,7 +103,7 @@ func (c *FakeEndpointSlices) Update(ctx context.Context, endpointSlice *v1alpha1 } // Delete takes name of the endpointSlice and deletes it. Returns an error if one occurs. -func (c *FakeEndpointSlices) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeEndpointSlices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(endpointslicesResource, c.ns, name), &v1alpha1.EndpointSlice{}) @@ -111,8 +111,8 @@ func (c *FakeEndpointSlices) Delete(ctx context.Context, name string, options *v } // DeleteCollection deletes a collection of objects. -func (c *FakeEndpointSlices) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(endpointslicesResource, c.ns, listOptions) +func (c *FakeEndpointSlices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(endpointslicesResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.EndpointSliceList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/endpointslice.go b/staging/src/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/endpointslice.go index 2989fc953bf..a016663e73e 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/endpointslice.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/endpointslice.go @@ -40,8 +40,8 @@ type EndpointSlicesGetter interface { type EndpointSliceInterface interface { Create(ctx context.Context, endpointSlice *v1beta1.EndpointSlice, opts v1.CreateOptions) (*v1beta1.EndpointSlice, error) Update(ctx context.Context, endpointSlice *v1beta1.EndpointSlice, opts v1.UpdateOptions) (*v1beta1.EndpointSlice, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.EndpointSlice, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.EndpointSliceList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -136,28 +136,28 @@ func (c *endpointSlices) Update(ctx context.Context, endpointSlice *v1beta1.Endp } // Delete takes name of the endpointSlice and deletes it. Returns an error if one occurs. -func (c *endpointSlices) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *endpointSlices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("endpointslices"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *endpointSlices) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *endpointSlices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("endpointslices"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/fake/fake_endpointslice.go b/staging/src/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/fake/fake_endpointslice.go index c67678331e6..f338d1bd64b 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/fake/fake_endpointslice.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/fake/fake_endpointslice.go @@ -103,7 +103,7 @@ func (c *FakeEndpointSlices) Update(ctx context.Context, endpointSlice *v1beta1. } // Delete takes name of the endpointSlice and deletes it. Returns an error if one occurs. -func (c *FakeEndpointSlices) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeEndpointSlices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(endpointslicesResource, c.ns, name), &v1beta1.EndpointSlice{}) @@ -111,8 +111,8 @@ func (c *FakeEndpointSlices) Delete(ctx context.Context, name string, options *v } // DeleteCollection deletes a collection of objects. -func (c *FakeEndpointSlices) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(endpointslicesResource, c.ns, listOptions) +func (c *FakeEndpointSlices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(endpointslicesResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.EndpointSliceList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/events/v1beta1/event.go b/staging/src/k8s.io/client-go/kubernetes/typed/events/v1beta1/event.go index 22eed88007f..4cdc471fb01 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/events/v1beta1/event.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/events/v1beta1/event.go @@ -40,8 +40,8 @@ type EventsGetter interface { type EventInterface interface { Create(ctx context.Context, event *v1beta1.Event, opts v1.CreateOptions) (*v1beta1.Event, error) Update(ctx context.Context, event *v1beta1.Event, opts v1.UpdateOptions) (*v1beta1.Event, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Event, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.EventList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -136,28 +136,28 @@ func (c *events) Update(ctx context.Context, event *v1beta1.Event, opts v1.Updat } // Delete takes name of the event and deletes it. Returns an error if one occurs. -func (c *events) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *events) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("events"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *events) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *events) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("events"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_event.go b/staging/src/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_event.go index 41c6865abeb..dcf488f7c16 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_event.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_event.go @@ -103,7 +103,7 @@ func (c *FakeEvents) Update(ctx context.Context, event *v1beta1.Event, opts v1.U } // Delete takes name of the event and deletes it. Returns an error if one occurs. -func (c *FakeEvents) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeEvents) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(eventsResource, c.ns, name), &v1beta1.Event{}) @@ -111,8 +111,8 @@ func (c *FakeEvents) Delete(ctx context.Context, name string, options *v1.Delete } // DeleteCollection deletes a collection of objects. -func (c *FakeEvents) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(eventsResource, c.ns, listOptions) +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, &v1beta1.EventList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/daemonset.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/daemonset.go index d1aa54c989e..0ba8bfc949f 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/daemonset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/daemonset.go @@ -41,8 +41,8 @@ type DaemonSetInterface interface { Create(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.CreateOptions) (*v1beta1.DaemonSet, error) Update(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.UpdateOptions) (*v1beta1.DaemonSet, error) UpdateStatus(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.UpdateOptions) (*v1beta1.DaemonSet, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.DaemonSet, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.DaemonSetList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *daemonSets) UpdateStatus(ctx context.Context, daemonSet *v1beta1.Daemon } // Delete takes name of the daemonSet and deletes it. Returns an error if one occurs. -func (c *daemonSets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *daemonSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("daemonsets"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *daemonSets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *daemonSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("daemonsets"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go index 70c07fa9649..4265f6decb3 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go @@ -41,8 +41,8 @@ type DeploymentInterface interface { Create(ctx context.Context, deployment *v1beta1.Deployment, opts v1.CreateOptions) (*v1beta1.Deployment, error) Update(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (*v1beta1.Deployment, error) UpdateStatus(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (*v1beta1.Deployment, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Deployment, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.DeploymentList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -156,28 +156,28 @@ func (c *deployments) UpdateStatus(ctx context.Context, deployment *v1beta1.Depl } // Delete takes name of the deployment and deletes it. Returns an error if one occurs. -func (c *deployments) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *deployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("deployments"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *deployments) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *deployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("deployments"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go index dfce4a041da..75e9132e6ed 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go @@ -115,7 +115,7 @@ func (c *FakeDaemonSets) UpdateStatus(ctx context.Context, daemonSet *v1beta1.Da } // Delete takes name of the daemonSet and deletes it. Returns an error if one occurs. -func (c *FakeDaemonSets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeDaemonSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(daemonsetsResource, c.ns, name), &v1beta1.DaemonSet{}) @@ -123,8 +123,8 @@ func (c *FakeDaemonSets) Delete(ctx context.Context, name string, options *v1.De } // DeleteCollection deletes a collection of objects. -func (c *FakeDaemonSets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(daemonsetsResource, c.ns, listOptions) +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, &v1beta1.DaemonSetList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go index 737f690e7d0..2841b7b8770 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go @@ -115,7 +115,7 @@ func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1beta1. } // Delete takes name of the deployment and deletes it. Returns an error if one occurs. -func (c *FakeDeployments) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +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{}) @@ -123,8 +123,8 @@ func (c *FakeDeployments) Delete(ctx context.Context, name string, options *v1.D } // DeleteCollection deletes a collection of objects. -func (c *FakeDeployments) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(deploymentsResource, c.ns, listOptions) +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 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go index 4dc0f1694e1..01a3cf1adb0 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go @@ -115,7 +115,7 @@ func (c *FakeIngresses) UpdateStatus(ctx context.Context, ingress *v1beta1.Ingre } // Delete takes name of the ingress and deletes it. Returns an error if one occurs. -func (c *FakeIngresses) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeIngresses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(ingressesResource, c.ns, name), &v1beta1.Ingress{}) @@ -123,8 +123,8 @@ func (c *FakeIngresses) Delete(ctx context.Context, name string, options *v1.Del } // DeleteCollection deletes a collection of objects. -func (c *FakeIngresses) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(ingressesResource, c.ns, listOptions) +func (c *FakeIngresses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(ingressesResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.IngressList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_networkpolicy.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_networkpolicy.go index 5997132d620..e97a54eaaf2 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_networkpolicy.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_networkpolicy.go @@ -103,7 +103,7 @@ func (c *FakeNetworkPolicies) Update(ctx context.Context, networkPolicy *v1beta1 } // Delete takes name of the networkPolicy and deletes it. Returns an error if one occurs. -func (c *FakeNetworkPolicies) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeNetworkPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(networkpoliciesResource, c.ns, name), &v1beta1.NetworkPolicy{}) @@ -111,8 +111,8 @@ func (c *FakeNetworkPolicies) Delete(ctx context.Context, name string, options * } // DeleteCollection deletes a collection of objects. -func (c *FakeNetworkPolicies) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(networkpoliciesResource, c.ns, listOptions) +func (c *FakeNetworkPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(networkpoliciesResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.NetworkPolicyList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_podsecuritypolicy.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_podsecuritypolicy.go index 5ade0028ab6..adb7d30fbdd 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_podsecuritypolicy.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_podsecuritypolicy.go @@ -97,15 +97,15 @@ func (c *FakePodSecurityPolicies) Update(ctx context.Context, podSecurityPolicy } // Delete takes name of the podSecurityPolicy and deletes it. Returns an error if one occurs. -func (c *FakePodSecurityPolicies) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakePodSecurityPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(podsecuritypoliciesResource, name), &v1beta1.PodSecurityPolicy{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakePodSecurityPolicies) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(podsecuritypoliciesResource, listOptions) +func (c *FakePodSecurityPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(podsecuritypoliciesResource, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.PodSecurityPolicyList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go index 48e1f629074..5b824acbbf6 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go @@ -115,7 +115,7 @@ func (c *FakeReplicaSets) UpdateStatus(ctx context.Context, replicaSet *v1beta1. } // Delete takes name of the replicaSet and deletes it. Returns an error if one occurs. -func (c *FakeReplicaSets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeReplicaSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(replicasetsResource, c.ns, name), &v1beta1.ReplicaSet{}) @@ -123,8 +123,8 @@ func (c *FakeReplicaSets) Delete(ctx context.Context, name string, options *v1.D } // DeleteCollection deletes a collection of objects. -func (c *FakeReplicaSets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(replicasetsResource, c.ns, listOptions) +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, &v1beta1.ReplicaSetList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/ingress.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/ingress.go index 7c162c67c0e..b19e2455adb 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/ingress.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/ingress.go @@ -41,8 +41,8 @@ type IngressInterface interface { Create(ctx context.Context, ingress *v1beta1.Ingress, opts v1.CreateOptions) (*v1beta1.Ingress, error) Update(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (*v1beta1.Ingress, error) UpdateStatus(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (*v1beta1.Ingress, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Ingress, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.IngressList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *ingresses) UpdateStatus(ctx context.Context, ingress *v1beta1.Ingress, } // Delete takes name of the ingress and deletes it. Returns an error if one occurs. -func (c *ingresses) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *ingresses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("ingresses"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *ingresses) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *ingresses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("ingresses"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/networkpolicy.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/networkpolicy.go index 92ff833105e..ed9ae30dedc 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/networkpolicy.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/networkpolicy.go @@ -40,8 +40,8 @@ type NetworkPoliciesGetter interface { type NetworkPolicyInterface interface { Create(ctx context.Context, networkPolicy *v1beta1.NetworkPolicy, opts v1.CreateOptions) (*v1beta1.NetworkPolicy, error) Update(ctx context.Context, networkPolicy *v1beta1.NetworkPolicy, opts v1.UpdateOptions) (*v1beta1.NetworkPolicy, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.NetworkPolicy, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.NetworkPolicyList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -136,28 +136,28 @@ func (c *networkPolicies) Update(ctx context.Context, networkPolicy *v1beta1.Net } // Delete takes name of the networkPolicy and deletes it. Returns an error if one occurs. -func (c *networkPolicies) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *networkPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("networkpolicies"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *networkPolicies) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *networkPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("networkpolicies"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go index e57b8de71a6..76e67dedb85 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go @@ -40,8 +40,8 @@ type PodSecurityPoliciesGetter interface { type PodSecurityPolicyInterface interface { Create(ctx context.Context, podSecurityPolicy *v1beta1.PodSecurityPolicy, opts v1.CreateOptions) (*v1beta1.PodSecurityPolicy, error) Update(ctx context.Context, podSecurityPolicy *v1beta1.PodSecurityPolicy, opts v1.UpdateOptions) (*v1beta1.PodSecurityPolicy, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.PodSecurityPolicy, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PodSecurityPolicyList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -129,26 +129,26 @@ func (c *podSecurityPolicies) Update(ctx context.Context, podSecurityPolicy *v1b } // Delete takes name of the podSecurityPolicy and deletes it. Returns an error if one occurs. -func (c *podSecurityPolicies) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *podSecurityPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("podsecuritypolicies"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *podSecurityPolicies) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *podSecurityPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("podsecuritypolicies"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go index 9db0cbfdba7..64e3c186174 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go @@ -41,8 +41,8 @@ type ReplicaSetInterface interface { Create(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.CreateOptions) (*v1beta1.ReplicaSet, error) Update(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.UpdateOptions) (*v1beta1.ReplicaSet, error) UpdateStatus(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.UpdateOptions) (*v1beta1.ReplicaSet, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ReplicaSet, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ReplicaSetList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -156,28 +156,28 @@ func (c *replicaSets) UpdateStatus(ctx context.Context, replicaSet *v1beta1.Repl } // Delete takes name of the replicaSet and deletes it. Returns an error if one occurs. -func (c *replicaSets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *replicaSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("replicasets"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *replicaSets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *replicaSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("replicasets"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/fake/fake_flowschema.go b/staging/src/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/fake/fake_flowschema.go index f3dd97f195c..e4692874e8e 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/fake/fake_flowschema.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/fake/fake_flowschema.go @@ -108,15 +108,15 @@ func (c *FakeFlowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1alpha1 } // Delete takes name of the flowSchema and deletes it. Returns an error if one occurs. -func (c *FakeFlowSchemas) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeFlowSchemas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(flowschemasResource, name), &v1alpha1.FlowSchema{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeFlowSchemas) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(flowschemasResource, listOptions) +func (c *FakeFlowSchemas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(flowschemasResource, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.FlowSchemaList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/fake/fake_prioritylevelconfiguration.go b/staging/src/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/fake/fake_prioritylevelconfiguration.go index d5b4e7998bd..133ab793ce0 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/fake/fake_prioritylevelconfiguration.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/fake/fake_prioritylevelconfiguration.go @@ -108,15 +108,15 @@ func (c *FakePriorityLevelConfigurations) UpdateStatus(ctx context.Context, prio } // Delete takes name of the priorityLevelConfiguration and deletes it. Returns an error if one occurs. -func (c *FakePriorityLevelConfigurations) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakePriorityLevelConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(prioritylevelconfigurationsResource, name), &v1alpha1.PriorityLevelConfiguration{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakePriorityLevelConfigurations) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(prioritylevelconfigurationsResource, listOptions) +func (c *FakePriorityLevelConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(prioritylevelconfigurationsResource, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.PriorityLevelConfigurationList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/flowschema.go b/staging/src/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/flowschema.go index ca209f0979e..319636f771b 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/flowschema.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/flowschema.go @@ -41,8 +41,8 @@ type FlowSchemaInterface interface { Create(ctx context.Context, flowSchema *v1alpha1.FlowSchema, opts v1.CreateOptions) (*v1alpha1.FlowSchema, error) Update(ctx context.Context, flowSchema *v1alpha1.FlowSchema, opts v1.UpdateOptions) (*v1alpha1.FlowSchema, error) UpdateStatus(ctx context.Context, flowSchema *v1alpha1.FlowSchema, opts v1.UpdateOptions) (*v1alpha1.FlowSchema, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.FlowSchema, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.FlowSchemaList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -145,26 +145,26 @@ func (c *flowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1alpha1.Flo } // Delete takes name of the flowSchema and deletes it. Returns an error if one occurs. -func (c *flowSchemas) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *flowSchemas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("flowschemas"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *flowSchemas) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *flowSchemas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("flowschemas"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/prioritylevelconfiguration.go b/staging/src/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/prioritylevelconfiguration.go index 413fea4bc0e..1290e7936b1 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/prioritylevelconfiguration.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/prioritylevelconfiguration.go @@ -41,8 +41,8 @@ type PriorityLevelConfigurationInterface interface { Create(ctx context.Context, priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration, opts v1.CreateOptions) (*v1alpha1.PriorityLevelConfiguration, error) Update(ctx context.Context, priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration, opts v1.UpdateOptions) (*v1alpha1.PriorityLevelConfiguration, error) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration, opts v1.UpdateOptions) (*v1alpha1.PriorityLevelConfiguration, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.PriorityLevelConfiguration, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.PriorityLevelConfigurationList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -145,26 +145,26 @@ func (c *priorityLevelConfigurations) UpdateStatus(ctx context.Context, priority } // Delete takes name of the priorityLevelConfiguration and deletes it. Returns an error if one occurs. -func (c *priorityLevelConfigurations) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *priorityLevelConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("prioritylevelconfigurations"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *priorityLevelConfigurations) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *priorityLevelConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("prioritylevelconfigurations"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networkpolicy.go b/staging/src/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networkpolicy.go index c251b667516..e8d6e28e44f 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networkpolicy.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networkpolicy.go @@ -103,7 +103,7 @@ func (c *FakeNetworkPolicies) Update(ctx context.Context, networkPolicy *network } // Delete takes name of the networkPolicy and deletes it. Returns an error if one occurs. -func (c *FakeNetworkPolicies) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeNetworkPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(networkpoliciesResource, c.ns, name), &networkingv1.NetworkPolicy{}) @@ -111,8 +111,8 @@ func (c *FakeNetworkPolicies) Delete(ctx context.Context, name string, options * } // DeleteCollection deletes a collection of objects. -func (c *FakeNetworkPolicies) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(networkpoliciesResource, c.ns, listOptions) +func (c *FakeNetworkPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(networkpoliciesResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &networkingv1.NetworkPolicyList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/networking/v1/networkpolicy.go b/staging/src/k8s.io/client-go/kubernetes/typed/networking/v1/networkpolicy.go index 4fa19860387..19c0c880f39 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/networking/v1/networkpolicy.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/networking/v1/networkpolicy.go @@ -40,8 +40,8 @@ type NetworkPoliciesGetter interface { type NetworkPolicyInterface interface { Create(ctx context.Context, networkPolicy *v1.NetworkPolicy, opts metav1.CreateOptions) (*v1.NetworkPolicy, error) Update(ctx context.Context, networkPolicy *v1.NetworkPolicy, opts metav1.UpdateOptions) (*v1.NetworkPolicy, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.NetworkPolicy, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.NetworkPolicyList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -136,28 +136,28 @@ func (c *networkPolicies) Update(ctx context.Context, networkPolicy *v1.NetworkP } // Delete takes name of the networkPolicy and deletes it. Returns an error if one occurs. -func (c *networkPolicies) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *networkPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("networkpolicies"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *networkPolicies) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *networkPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("networkpolicies"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_ingress.go b/staging/src/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_ingress.go index 130d037d569..083229e290f 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_ingress.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_ingress.go @@ -115,7 +115,7 @@ func (c *FakeIngresses) UpdateStatus(ctx context.Context, ingress *v1beta1.Ingre } // Delete takes name of the ingress and deletes it. Returns an error if one occurs. -func (c *FakeIngresses) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeIngresses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(ingressesResource, c.ns, name), &v1beta1.Ingress{}) @@ -123,8 +123,8 @@ func (c *FakeIngresses) Delete(ctx context.Context, name string, options *v1.Del } // DeleteCollection deletes a collection of objects. -func (c *FakeIngresses) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(ingressesResource, c.ns, listOptions) +func (c *FakeIngresses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(ingressesResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.IngressList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_ingressclass.go b/staging/src/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_ingressclass.go index 7747700332f..9329d0b3973 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_ingressclass.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_ingressclass.go @@ -97,15 +97,15 @@ func (c *FakeIngressClasses) Update(ctx context.Context, ingressClass *v1beta1.I } // Delete takes name of the ingressClass and deletes it. Returns an error if one occurs. -func (c *FakeIngressClasses) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeIngressClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(ingressclassesResource, name), &v1beta1.IngressClass{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeIngressClasses) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(ingressclassesResource, listOptions) +func (c *FakeIngressClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(ingressclassesResource, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.IngressClassList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/networking/v1beta1/ingress.go b/staging/src/k8s.io/client-go/kubernetes/typed/networking/v1beta1/ingress.go index b8420c0dc77..0857c05d69d 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/networking/v1beta1/ingress.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/networking/v1beta1/ingress.go @@ -41,8 +41,8 @@ type IngressInterface interface { Create(ctx context.Context, ingress *v1beta1.Ingress, opts v1.CreateOptions) (*v1beta1.Ingress, error) Update(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (*v1beta1.Ingress, error) UpdateStatus(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (*v1beta1.Ingress, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Ingress, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.IngressList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *ingresses) UpdateStatus(ctx context.Context, ingress *v1beta1.Ingress, } // Delete takes name of the ingress and deletes it. Returns an error if one occurs. -func (c *ingresses) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *ingresses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("ingresses"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *ingresses) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *ingresses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("ingresses"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/networking/v1beta1/ingressclass.go b/staging/src/k8s.io/client-go/kubernetes/typed/networking/v1beta1/ingressclass.go index 069a23dae52..2a4237425b4 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/networking/v1beta1/ingressclass.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/networking/v1beta1/ingressclass.go @@ -40,8 +40,8 @@ type IngressClassesGetter interface { type IngressClassInterface interface { Create(ctx context.Context, ingressClass *v1beta1.IngressClass, opts v1.CreateOptions) (*v1beta1.IngressClass, error) Update(ctx context.Context, ingressClass *v1beta1.IngressClass, opts v1.UpdateOptions) (*v1beta1.IngressClass, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.IngressClass, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.IngressClassList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -129,26 +129,26 @@ func (c *ingressClasses) Update(ctx context.Context, ingressClass *v1beta1.Ingre } // Delete takes name of the ingressClass and deletes it. Returns an error if one occurs. -func (c *ingressClasses) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *ingressClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("ingressclasses"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *ingressClasses) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *ingressClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("ingressclasses"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake/fake_runtimeclass.go b/staging/src/k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake/fake_runtimeclass.go index 1495ba72a9d..b49d787ded7 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake/fake_runtimeclass.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake/fake_runtimeclass.go @@ -97,15 +97,15 @@ func (c *FakeRuntimeClasses) Update(ctx context.Context, runtimeClass *v1alpha1. } // Delete takes name of the runtimeClass and deletes it. Returns an error if one occurs. -func (c *FakeRuntimeClasses) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeRuntimeClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(runtimeclassesResource, name), &v1alpha1.RuntimeClass{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeRuntimeClasses) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(runtimeclassesResource, listOptions) +func (c *FakeRuntimeClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(runtimeclassesResource, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.RuntimeClassList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/node/v1alpha1/runtimeclass.go b/staging/src/k8s.io/client-go/kubernetes/typed/node/v1alpha1/runtimeclass.go index c60f24211a8..402c23e8af1 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/node/v1alpha1/runtimeclass.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/node/v1alpha1/runtimeclass.go @@ -40,8 +40,8 @@ type RuntimeClassesGetter interface { type RuntimeClassInterface interface { Create(ctx context.Context, runtimeClass *v1alpha1.RuntimeClass, opts v1.CreateOptions) (*v1alpha1.RuntimeClass, error) Update(ctx context.Context, runtimeClass *v1alpha1.RuntimeClass, opts v1.UpdateOptions) (*v1alpha1.RuntimeClass, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.RuntimeClass, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.RuntimeClassList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -129,26 +129,26 @@ func (c *runtimeClasses) Update(ctx context.Context, runtimeClass *v1alpha1.Runt } // Delete takes name of the runtimeClass and deletes it. Returns an error if one occurs. -func (c *runtimeClasses) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *runtimeClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("runtimeclasses"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *runtimeClasses) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *runtimeClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("runtimeclasses"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/node/v1beta1/fake/fake_runtimeclass.go b/staging/src/k8s.io/client-go/kubernetes/typed/node/v1beta1/fake/fake_runtimeclass.go index 1eef57f96eb..d7987d9812f 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/node/v1beta1/fake/fake_runtimeclass.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/node/v1beta1/fake/fake_runtimeclass.go @@ -97,15 +97,15 @@ func (c *FakeRuntimeClasses) Update(ctx context.Context, runtimeClass *v1beta1.R } // Delete takes name of the runtimeClass and deletes it. Returns an error if one occurs. -func (c *FakeRuntimeClasses) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeRuntimeClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(runtimeclassesResource, name), &v1beta1.RuntimeClass{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeRuntimeClasses) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(runtimeclassesResource, listOptions) +func (c *FakeRuntimeClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(runtimeclassesResource, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.RuntimeClassList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/node/v1beta1/runtimeclass.go b/staging/src/k8s.io/client-go/kubernetes/typed/node/v1beta1/runtimeclass.go index 7cdd58f2927..b0d1886ecce 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/node/v1beta1/runtimeclass.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/node/v1beta1/runtimeclass.go @@ -40,8 +40,8 @@ type RuntimeClassesGetter interface { type RuntimeClassInterface interface { Create(ctx context.Context, runtimeClass *v1beta1.RuntimeClass, opts v1.CreateOptions) (*v1beta1.RuntimeClass, error) Update(ctx context.Context, runtimeClass *v1beta1.RuntimeClass, opts v1.UpdateOptions) (*v1beta1.RuntimeClass, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.RuntimeClass, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.RuntimeClassList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -129,26 +129,26 @@ func (c *runtimeClasses) Update(ctx context.Context, runtimeClass *v1beta1.Runti } // Delete takes name of the runtimeClass and deletes it. Returns an error if one occurs. -func (c *runtimeClasses) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *runtimeClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("runtimeclasses"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *runtimeClasses) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *runtimeClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("runtimeclasses"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go index bd7a82819c9..78ea7815ac2 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go @@ -115,7 +115,7 @@ func (c *FakePodDisruptionBudgets) UpdateStatus(ctx context.Context, podDisrupti } // Delete takes name of the podDisruptionBudget and deletes it. Returns an error if one occurs. -func (c *FakePodDisruptionBudgets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakePodDisruptionBudgets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(poddisruptionbudgetsResource, c.ns, name), &v1beta1.PodDisruptionBudget{}) @@ -123,8 +123,8 @@ func (c *FakePodDisruptionBudgets) Delete(ctx context.Context, name string, opti } // DeleteCollection deletes a collection of objects. -func (c *FakePodDisruptionBudgets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(poddisruptionbudgetsResource, c.ns, listOptions) +func (c *FakePodDisruptionBudgets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(poddisruptionbudgetsResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.PodDisruptionBudgetList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_podsecuritypolicy.go b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_podsecuritypolicy.go index a1f850d2be6..667f86b792c 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_podsecuritypolicy.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_podsecuritypolicy.go @@ -97,15 +97,15 @@ func (c *FakePodSecurityPolicies) Update(ctx context.Context, podSecurityPolicy } // Delete takes name of the podSecurityPolicy and deletes it. Returns an error if one occurs. -func (c *FakePodSecurityPolicies) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakePodSecurityPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(podsecuritypoliciesResource, name), &v1beta1.PodSecurityPolicy{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakePodSecurityPolicies) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(podsecuritypoliciesResource, listOptions) +func (c *FakePodSecurityPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(podsecuritypoliciesResource, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.PodSecurityPolicyList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go index e82a6d20e58..95b7ff1b827 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go @@ -41,8 +41,8 @@ type PodDisruptionBudgetInterface interface { Create(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.CreateOptions) (*v1beta1.PodDisruptionBudget, error) Update(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.UpdateOptions) (*v1beta1.PodDisruptionBudget, error) UpdateStatus(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.UpdateOptions) (*v1beta1.PodDisruptionBudget, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.PodDisruptionBudget, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PodDisruptionBudgetList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *podDisruptionBudgets) UpdateStatus(ctx context.Context, podDisruptionBu } // Delete takes name of the podDisruptionBudget and deletes it. Returns an error if one occurs. -func (c *podDisruptionBudgets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *podDisruptionBudgets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("poddisruptionbudgets"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *podDisruptionBudgets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *podDisruptionBudgets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("poddisruptionbudgets"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/podsecuritypolicy.go b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/podsecuritypolicy.go index 7cadf263517..15d7bb9e464 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/podsecuritypolicy.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/podsecuritypolicy.go @@ -40,8 +40,8 @@ type PodSecurityPoliciesGetter interface { type PodSecurityPolicyInterface interface { Create(ctx context.Context, podSecurityPolicy *v1beta1.PodSecurityPolicy, opts v1.CreateOptions) (*v1beta1.PodSecurityPolicy, error) Update(ctx context.Context, podSecurityPolicy *v1beta1.PodSecurityPolicy, opts v1.UpdateOptions) (*v1beta1.PodSecurityPolicy, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.PodSecurityPolicy, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PodSecurityPolicyList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -129,26 +129,26 @@ func (c *podSecurityPolicies) Update(ctx context.Context, podSecurityPolicy *v1b } // Delete takes name of the podSecurityPolicy and deletes it. Returns an error if one occurs. -func (c *podSecurityPolicies) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *podSecurityPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("podsecuritypolicies"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *podSecurityPolicies) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *podSecurityPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("podsecuritypolicies"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrole.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrole.go index 467c6ddb029..787324d6548 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrole.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrole.go @@ -40,8 +40,8 @@ type ClusterRolesGetter interface { type ClusterRoleInterface interface { Create(ctx context.Context, clusterRole *v1.ClusterRole, opts metav1.CreateOptions) (*v1.ClusterRole, error) Update(ctx context.Context, clusterRole *v1.ClusterRole, opts metav1.UpdateOptions) (*v1.ClusterRole, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ClusterRole, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterRoleList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -129,26 +129,26 @@ func (c *clusterRoles) Update(ctx context.Context, clusterRole *v1.ClusterRole, } // Delete takes name of the clusterRole and deletes it. Returns an error if one occurs. -func (c *clusterRoles) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *clusterRoles) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Resource("clusterroles"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *clusterRoles) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *clusterRoles) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("clusterroles"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrolebinding.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrolebinding.go index 19ace55f513..83e8c81bb24 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrolebinding.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrolebinding.go @@ -40,8 +40,8 @@ type ClusterRoleBindingsGetter interface { type ClusterRoleBindingInterface interface { Create(ctx context.Context, clusterRoleBinding *v1.ClusterRoleBinding, opts metav1.CreateOptions) (*v1.ClusterRoleBinding, error) Update(ctx context.Context, clusterRoleBinding *v1.ClusterRoleBinding, opts metav1.UpdateOptions) (*v1.ClusterRoleBinding, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ClusterRoleBinding, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterRoleBindingList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -129,26 +129,26 @@ func (c *clusterRoleBindings) Update(ctx context.Context, clusterRoleBinding *v1 } // Delete takes name of the clusterRoleBinding and deletes it. Returns an error if one occurs. -func (c *clusterRoleBindings) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *clusterRoleBindings) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Resource("clusterrolebindings"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *clusterRoleBindings) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *clusterRoleBindings) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("clusterrolebindings"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrole.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrole.go index 2eec9defdaa..e7696ba27d2 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrole.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrole.go @@ -97,15 +97,15 @@ func (c *FakeClusterRoles) Update(ctx context.Context, clusterRole *rbacv1.Clust } // Delete takes name of the clusterRole and deletes it. Returns an error if one occurs. -func (c *FakeClusterRoles) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeClusterRoles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(clusterrolesResource, name), &rbacv1.ClusterRole{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeClusterRoles) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clusterrolesResource, listOptions) +func (c *FakeClusterRoles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(clusterrolesResource, listOpts) _, err := c.Fake.Invokes(action, &rbacv1.ClusterRoleList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrolebinding.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrolebinding.go index c7943659f66..e9d19f1e092 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrolebinding.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrolebinding.go @@ -97,15 +97,15 @@ func (c *FakeClusterRoleBindings) Update(ctx context.Context, clusterRoleBinding } // Delete takes name of the clusterRoleBinding and deletes it. Returns an error if one occurs. -func (c *FakeClusterRoleBindings) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeClusterRoleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(clusterrolebindingsResource, name), &rbacv1.ClusterRoleBinding{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeClusterRoleBindings) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clusterrolebindingsResource, listOptions) +func (c *FakeClusterRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(clusterrolebindingsResource, listOpts) _, err := c.Fake.Invokes(action, &rbacv1.ClusterRoleBindingList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_role.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_role.go index 1d3cee64ed8..1bc86d425df 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_role.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_role.go @@ -103,7 +103,7 @@ func (c *FakeRoles) Update(ctx context.Context, role *rbacv1.Role, opts v1.Updat } // Delete takes name of the role and deletes it. Returns an error if one occurs. -func (c *FakeRoles) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeRoles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(rolesResource, c.ns, name), &rbacv1.Role{}) @@ -111,8 +111,8 @@ func (c *FakeRoles) Delete(ctx context.Context, name string, options *v1.DeleteO } // DeleteCollection deletes a collection of objects. -func (c *FakeRoles) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(rolesResource, c.ns, listOptions) +func (c *FakeRoles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(rolesResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &rbacv1.RoleList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rolebinding.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rolebinding.go index dcdc0897512..4962aa7c8bf 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rolebinding.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rolebinding.go @@ -103,7 +103,7 @@ func (c *FakeRoleBindings) Update(ctx context.Context, roleBinding *rbacv1.RoleB } // Delete takes name of the roleBinding and deletes it. Returns an error if one occurs. -func (c *FakeRoleBindings) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeRoleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(rolebindingsResource, c.ns, name), &rbacv1.RoleBinding{}) @@ -111,8 +111,8 @@ func (c *FakeRoleBindings) Delete(ctx context.Context, name string, options *v1. } // DeleteCollection deletes a collection of objects. -func (c *FakeRoleBindings) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(rolebindingsResource, c.ns, listOptions) +func (c *FakeRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(rolebindingsResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &rbacv1.RoleBindingList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/role.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/role.go index 64c08912b0a..c31e22b63e8 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/role.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/role.go @@ -40,8 +40,8 @@ type RolesGetter interface { type RoleInterface interface { Create(ctx context.Context, role *v1.Role, opts metav1.CreateOptions) (*v1.Role, error) Update(ctx context.Context, role *v1.Role, opts metav1.UpdateOptions) (*v1.Role, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Role, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.RoleList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -136,28 +136,28 @@ func (c *roles) Update(ctx context.Context, role *v1.Role, opts metav1.UpdateOpt } // Delete takes name of the role and deletes it. Returns an error if one occurs. -func (c *roles) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *roles) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("roles"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *roles) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *roles) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("roles"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/rolebinding.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/rolebinding.go index 70334e356c9..160fc16e6b4 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/rolebinding.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1/rolebinding.go @@ -40,8 +40,8 @@ type RoleBindingsGetter interface { type RoleBindingInterface interface { Create(ctx context.Context, roleBinding *v1.RoleBinding, opts metav1.CreateOptions) (*v1.RoleBinding, error) Update(ctx context.Context, roleBinding *v1.RoleBinding, opts metav1.UpdateOptions) (*v1.RoleBinding, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.RoleBinding, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.RoleBindingList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -136,28 +136,28 @@ func (c *roleBindings) Update(ctx context.Context, roleBinding *v1.RoleBinding, } // Delete takes name of the roleBinding and deletes it. Returns an error if one occurs. -func (c *roleBindings) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *roleBindings) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("rolebindings"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *roleBindings) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *roleBindings) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("rolebindings"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrole.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrole.go index 9397cd8d427..678d3711f31 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrole.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrole.go @@ -40,8 +40,8 @@ type ClusterRolesGetter interface { type ClusterRoleInterface interface { Create(ctx context.Context, clusterRole *v1alpha1.ClusterRole, opts v1.CreateOptions) (*v1alpha1.ClusterRole, error) Update(ctx context.Context, clusterRole *v1alpha1.ClusterRole, opts v1.UpdateOptions) (*v1alpha1.ClusterRole, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ClusterRole, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterRoleList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -129,26 +129,26 @@ func (c *clusterRoles) Update(ctx context.Context, clusterRole *v1alpha1.Cluster } // Delete takes name of the clusterRole and deletes it. Returns an error if one occurs. -func (c *clusterRoles) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *clusterRoles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("clusterroles"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *clusterRoles) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *clusterRoles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("clusterroles"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go index 3d36d87b906..7a9ca295336 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go @@ -40,8 +40,8 @@ type ClusterRoleBindingsGetter interface { type ClusterRoleBindingInterface interface { Create(ctx context.Context, clusterRoleBinding *v1alpha1.ClusterRoleBinding, opts v1.CreateOptions) (*v1alpha1.ClusterRoleBinding, error) Update(ctx context.Context, clusterRoleBinding *v1alpha1.ClusterRoleBinding, opts v1.UpdateOptions) (*v1alpha1.ClusterRoleBinding, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ClusterRoleBinding, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterRoleBindingList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -129,26 +129,26 @@ func (c *clusterRoleBindings) Update(ctx context.Context, clusterRoleBinding *v1 } // Delete takes name of the clusterRoleBinding and deletes it. Returns an error if one occurs. -func (c *clusterRoleBindings) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *clusterRoleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("clusterrolebindings"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *clusterRoleBindings) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *clusterRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("clusterrolebindings"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go index 966c601f3b2..3bdccbfad6c 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go @@ -97,15 +97,15 @@ func (c *FakeClusterRoles) Update(ctx context.Context, clusterRole *v1alpha1.Clu } // Delete takes name of the clusterRole and deletes it. Returns an error if one occurs. -func (c *FakeClusterRoles) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeClusterRoles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(clusterrolesResource, name), &v1alpha1.ClusterRole{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeClusterRoles) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clusterrolesResource, listOptions) +func (c *FakeClusterRoles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(clusterrolesResource, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.ClusterRoleList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go index c1d43dcd888..6557f73b0ce 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go @@ -97,15 +97,15 @@ func (c *FakeClusterRoleBindings) Update(ctx context.Context, clusterRoleBinding } // Delete takes name of the clusterRoleBinding and deletes it. Returns an error if one occurs. -func (c *FakeClusterRoleBindings) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeClusterRoleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(clusterrolebindingsResource, name), &v1alpha1.ClusterRoleBinding{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeClusterRoleBindings) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clusterrolebindingsResource, listOptions) +func (c *FakeClusterRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(clusterrolebindingsResource, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.ClusterRoleBindingList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go index 63579bbbb74..8a7f2fea251 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go @@ -103,7 +103,7 @@ func (c *FakeRoles) Update(ctx context.Context, role *v1alpha1.Role, opts v1.Upd } // Delete takes name of the role and deletes it. Returns an error if one occurs. -func (c *FakeRoles) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeRoles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(rolesResource, c.ns, name), &v1alpha1.Role{}) @@ -111,8 +111,8 @@ func (c *FakeRoles) Delete(ctx context.Context, name string, options *v1.DeleteO } // DeleteCollection deletes a collection of objects. -func (c *FakeRoles) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(rolesResource, c.ns, listOptions) +func (c *FakeRoles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(rolesResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.RoleList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go index 21bbb6c8dcb..744ce031551 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go @@ -103,7 +103,7 @@ func (c *FakeRoleBindings) Update(ctx context.Context, roleBinding *v1alpha1.Rol } // Delete takes name of the roleBinding and deletes it. Returns an error if one occurs. -func (c *FakeRoleBindings) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeRoleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(rolebindingsResource, c.ns, name), &v1alpha1.RoleBinding{}) @@ -111,8 +111,8 @@ func (c *FakeRoleBindings) Delete(ctx context.Context, name string, options *v1. } // DeleteCollection deletes a collection of objects. -func (c *FakeRoleBindings) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(rolebindingsResource, c.ns, listOptions) +func (c *FakeRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(rolebindingsResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.RoleBindingList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/role.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/role.go index b2bd377961b..56ec6e373d3 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/role.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/role.go @@ -40,8 +40,8 @@ type RolesGetter interface { type RoleInterface interface { Create(ctx context.Context, role *v1alpha1.Role, opts v1.CreateOptions) (*v1alpha1.Role, error) Update(ctx context.Context, role *v1alpha1.Role, opts v1.UpdateOptions) (*v1alpha1.Role, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Role, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.RoleList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -136,28 +136,28 @@ func (c *roles) Update(ctx context.Context, role *v1alpha1.Role, opts v1.UpdateO } // Delete takes name of the role and deletes it. Returns an error if one occurs. -func (c *roles) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *roles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("roles"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *roles) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *roles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("roles"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rolebinding.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rolebinding.go index 859515bf091..b4b1df5dc3a 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rolebinding.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rolebinding.go @@ -40,8 +40,8 @@ type RoleBindingsGetter interface { type RoleBindingInterface interface { Create(ctx context.Context, roleBinding *v1alpha1.RoleBinding, opts v1.CreateOptions) (*v1alpha1.RoleBinding, error) Update(ctx context.Context, roleBinding *v1alpha1.RoleBinding, opts v1.UpdateOptions) (*v1alpha1.RoleBinding, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.RoleBinding, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.RoleBindingList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -136,28 +136,28 @@ func (c *roleBindings) Update(ctx context.Context, roleBinding *v1alpha1.RoleBin } // Delete takes name of the roleBinding and deletes it. Returns an error if one occurs. -func (c *roleBindings) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *roleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("rolebindings"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *roleBindings) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *roleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("rolebindings"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrole.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrole.go index 803b892e746..4db46666abf 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrole.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrole.go @@ -40,8 +40,8 @@ type ClusterRolesGetter interface { type ClusterRoleInterface interface { Create(ctx context.Context, clusterRole *v1beta1.ClusterRole, opts v1.CreateOptions) (*v1beta1.ClusterRole, error) Update(ctx context.Context, clusterRole *v1beta1.ClusterRole, opts v1.UpdateOptions) (*v1beta1.ClusterRole, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ClusterRole, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ClusterRoleList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -129,26 +129,26 @@ func (c *clusterRoles) Update(ctx context.Context, clusterRole *v1beta1.ClusterR } // Delete takes name of the clusterRole and deletes it. Returns an error if one occurs. -func (c *clusterRoles) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *clusterRoles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("clusterroles"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *clusterRoles) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *clusterRoles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("clusterroles"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go index 81e07f33226..f45777c232c 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go @@ -40,8 +40,8 @@ type ClusterRoleBindingsGetter interface { type ClusterRoleBindingInterface interface { Create(ctx context.Context, clusterRoleBinding *v1beta1.ClusterRoleBinding, opts v1.CreateOptions) (*v1beta1.ClusterRoleBinding, error) Update(ctx context.Context, clusterRoleBinding *v1beta1.ClusterRoleBinding, opts v1.UpdateOptions) (*v1beta1.ClusterRoleBinding, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ClusterRoleBinding, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ClusterRoleBindingList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -129,26 +129,26 @@ func (c *clusterRoleBindings) Update(ctx context.Context, clusterRoleBinding *v1 } // Delete takes name of the clusterRoleBinding and deletes it. Returns an error if one occurs. -func (c *clusterRoleBindings) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *clusterRoleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("clusterrolebindings"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *clusterRoleBindings) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *clusterRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("clusterrolebindings"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrole.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrole.go index 48d437cabaf..38fdc83f8ba 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrole.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrole.go @@ -97,15 +97,15 @@ func (c *FakeClusterRoles) Update(ctx context.Context, clusterRole *v1beta1.Clus } // Delete takes name of the clusterRole and deletes it. Returns an error if one occurs. -func (c *FakeClusterRoles) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeClusterRoles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(clusterrolesResource, name), &v1beta1.ClusterRole{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeClusterRoles) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clusterrolesResource, listOptions) +func (c *FakeClusterRoles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(clusterrolesResource, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.ClusterRoleList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrolebinding.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrolebinding.go index b20a6fa6cf7..a47c011b5b4 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrolebinding.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrolebinding.go @@ -97,15 +97,15 @@ func (c *FakeClusterRoleBindings) Update(ctx context.Context, clusterRoleBinding } // Delete takes name of the clusterRoleBinding and deletes it. Returns an error if one occurs. -func (c *FakeClusterRoleBindings) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeClusterRoleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(clusterrolebindingsResource, name), &v1beta1.ClusterRoleBinding{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeClusterRoleBindings) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clusterrolebindingsResource, listOptions) +func (c *FakeClusterRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(clusterrolebindingsResource, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.ClusterRoleBindingList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_role.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_role.go index eec0ef6f898..dad8915d079 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_role.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_role.go @@ -103,7 +103,7 @@ func (c *FakeRoles) Update(ctx context.Context, role *v1beta1.Role, opts v1.Upda } // Delete takes name of the role and deletes it. Returns an error if one occurs. -func (c *FakeRoles) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeRoles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(rolesResource, c.ns, name), &v1beta1.Role{}) @@ -111,8 +111,8 @@ func (c *FakeRoles) Delete(ctx context.Context, name string, options *v1.DeleteO } // DeleteCollection deletes a collection of objects. -func (c *FakeRoles) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(rolesResource, c.ns, listOptions) +func (c *FakeRoles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(rolesResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.RoleList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rolebinding.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rolebinding.go index 80f9638bcbd..1d7456b18bd 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rolebinding.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rolebinding.go @@ -103,7 +103,7 @@ func (c *FakeRoleBindings) Update(ctx context.Context, roleBinding *v1beta1.Role } // Delete takes name of the roleBinding and deletes it. Returns an error if one occurs. -func (c *FakeRoleBindings) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeRoleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(rolebindingsResource, c.ns, name), &v1beta1.RoleBinding{}) @@ -111,8 +111,8 @@ func (c *FakeRoleBindings) Delete(ctx context.Context, name string, options *v1. } // DeleteCollection deletes a collection of objects. -func (c *FakeRoleBindings) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(rolebindingsResource, c.ns, listOptions) +func (c *FakeRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(rolebindingsResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.RoleBindingList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/role.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/role.go index 3a0233265ca..c172e7f671d 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/role.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/role.go @@ -40,8 +40,8 @@ type RolesGetter interface { type RoleInterface interface { Create(ctx context.Context, role *v1beta1.Role, opts v1.CreateOptions) (*v1beta1.Role, error) Update(ctx context.Context, role *v1beta1.Role, opts v1.UpdateOptions) (*v1beta1.Role, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Role, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.RoleList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -136,28 +136,28 @@ func (c *roles) Update(ctx context.Context, role *v1beta1.Role, opts v1.UpdateOp } // Delete takes name of the role and deletes it. Returns an error if one occurs. -func (c *roles) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *roles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("roles"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *roles) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *roles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("roles"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rolebinding.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rolebinding.go index a0cb0763d7d..f37bfb74413 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rolebinding.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rolebinding.go @@ -40,8 +40,8 @@ type RoleBindingsGetter interface { type RoleBindingInterface interface { Create(ctx context.Context, roleBinding *v1beta1.RoleBinding, opts v1.CreateOptions) (*v1beta1.RoleBinding, error) Update(ctx context.Context, roleBinding *v1beta1.RoleBinding, opts v1.UpdateOptions) (*v1beta1.RoleBinding, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.RoleBinding, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.RoleBindingList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -136,28 +136,28 @@ func (c *roleBindings) Update(ctx context.Context, roleBinding *v1beta1.RoleBind } // Delete takes name of the roleBinding and deletes it. Returns an error if one occurs. -func (c *roleBindings) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *roleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("rolebindings"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *roleBindings) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *roleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("rolebindings"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/scheduling/v1/fake/fake_priorityclass.go b/staging/src/k8s.io/client-go/kubernetes/typed/scheduling/v1/fake/fake_priorityclass.go index 05c2d7ae66d..df095d87d13 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/scheduling/v1/fake/fake_priorityclass.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/scheduling/v1/fake/fake_priorityclass.go @@ -97,15 +97,15 @@ func (c *FakePriorityClasses) Update(ctx context.Context, priorityClass *schedul } // Delete takes name of the priorityClass and deletes it. Returns an error if one occurs. -func (c *FakePriorityClasses) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakePriorityClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(priorityclassesResource, name), &schedulingv1.PriorityClass{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakePriorityClasses) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(priorityclassesResource, listOptions) +func (c *FakePriorityClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(priorityclassesResource, listOpts) _, err := c.Fake.Invokes(action, &schedulingv1.PriorityClassList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/scheduling/v1/priorityclass.go b/staging/src/k8s.io/client-go/kubernetes/typed/scheduling/v1/priorityclass.go index 394adf44606..06185d5fb6d 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/scheduling/v1/priorityclass.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/scheduling/v1/priorityclass.go @@ -40,8 +40,8 @@ type PriorityClassesGetter interface { type PriorityClassInterface interface { Create(ctx context.Context, priorityClass *v1.PriorityClass, opts metav1.CreateOptions) (*v1.PriorityClass, error) Update(ctx context.Context, priorityClass *v1.PriorityClass, opts metav1.UpdateOptions) (*v1.PriorityClass, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PriorityClass, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.PriorityClassList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -129,26 +129,26 @@ func (c *priorityClasses) Update(ctx context.Context, priorityClass *v1.Priority } // Delete takes name of the priorityClass and deletes it. Returns an error if one occurs. -func (c *priorityClasses) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *priorityClasses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Resource("priorityclasses"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *priorityClasses) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *priorityClasses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("priorityclasses"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_priorityclass.go b/staging/src/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_priorityclass.go index 8b264e07acb..0f246c032d7 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_priorityclass.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_priorityclass.go @@ -97,15 +97,15 @@ func (c *FakePriorityClasses) Update(ctx context.Context, priorityClass *v1alpha } // Delete takes name of the priorityClass and deletes it. Returns an error if one occurs. -func (c *FakePriorityClasses) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakePriorityClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(priorityclassesResource, name), &v1alpha1.PriorityClass{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakePriorityClasses) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(priorityclassesResource, listOptions) +func (c *FakePriorityClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(priorityclassesResource, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.PriorityClassList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/priorityclass.go b/staging/src/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/priorityclass.go index 74a9b44ed5f..ae9875e9a08 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/priorityclass.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/priorityclass.go @@ -40,8 +40,8 @@ type PriorityClassesGetter interface { type PriorityClassInterface interface { Create(ctx context.Context, priorityClass *v1alpha1.PriorityClass, opts v1.CreateOptions) (*v1alpha1.PriorityClass, error) Update(ctx context.Context, priorityClass *v1alpha1.PriorityClass, opts v1.UpdateOptions) (*v1alpha1.PriorityClass, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.PriorityClass, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.PriorityClassList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -129,26 +129,26 @@ func (c *priorityClasses) Update(ctx context.Context, priorityClass *v1alpha1.Pr } // Delete takes name of the priorityClass and deletes it. Returns an error if one occurs. -func (c *priorityClasses) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *priorityClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("priorityclasses"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *priorityClasses) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *priorityClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("priorityclasses"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/fake/fake_priorityclass.go b/staging/src/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/fake/fake_priorityclass.go index 7381e634507..256590177c3 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/fake/fake_priorityclass.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/fake/fake_priorityclass.go @@ -97,15 +97,15 @@ func (c *FakePriorityClasses) Update(ctx context.Context, priorityClass *v1beta1 } // Delete takes name of the priorityClass and deletes it. Returns an error if one occurs. -func (c *FakePriorityClasses) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakePriorityClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(priorityclassesResource, name), &v1beta1.PriorityClass{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakePriorityClasses) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(priorityclassesResource, listOptions) +func (c *FakePriorityClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(priorityclassesResource, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.PriorityClassList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/priorityclass.go b/staging/src/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/priorityclass.go index 80db5299b84..70ed597bb41 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/priorityclass.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/priorityclass.go @@ -40,8 +40,8 @@ type PriorityClassesGetter interface { type PriorityClassInterface interface { Create(ctx context.Context, priorityClass *v1beta1.PriorityClass, opts v1.CreateOptions) (*v1beta1.PriorityClass, error) Update(ctx context.Context, priorityClass *v1beta1.PriorityClass, opts v1.UpdateOptions) (*v1beta1.PriorityClass, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.PriorityClass, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PriorityClassList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -129,26 +129,26 @@ func (c *priorityClasses) Update(ctx context.Context, priorityClass *v1beta1.Pri } // Delete takes name of the priorityClass and deletes it. Returns an error if one occurs. -func (c *priorityClasses) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *priorityClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("priorityclasses"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *priorityClasses) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *priorityClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("priorityclasses"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake/fake_podpreset.go b/staging/src/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake/fake_podpreset.go index 00dc34d2c32..c8ecd09cecb 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake/fake_podpreset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake/fake_podpreset.go @@ -103,7 +103,7 @@ func (c *FakePodPresets) Update(ctx context.Context, podPreset *v1alpha1.PodPres } // Delete takes name of the podPreset and deletes it. Returns an error if one occurs. -func (c *FakePodPresets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakePodPresets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(podpresetsResource, c.ns, name), &v1alpha1.PodPreset{}) @@ -111,8 +111,8 @@ func (c *FakePodPresets) Delete(ctx context.Context, name string, options *v1.De } // DeleteCollection deletes a collection of objects. -func (c *FakePodPresets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(podpresetsResource, c.ns, listOptions) +func (c *FakePodPresets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(podpresetsResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.PodPresetList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/podpreset.go b/staging/src/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/podpreset.go index 01eaa9a82ca..aa1cb364ea6 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/podpreset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/podpreset.go @@ -40,8 +40,8 @@ type PodPresetsGetter interface { type PodPresetInterface interface { Create(ctx context.Context, podPreset *v1alpha1.PodPreset, opts v1.CreateOptions) (*v1alpha1.PodPreset, error) Update(ctx context.Context, podPreset *v1alpha1.PodPreset, opts v1.UpdateOptions) (*v1alpha1.PodPreset, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.PodPreset, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.PodPresetList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -136,28 +136,28 @@ func (c *podPresets) Update(ctx context.Context, podPreset *v1alpha1.PodPreset, } // Delete takes name of the podPreset and deletes it. Returns an error if one occurs. -func (c *podPresets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *podPresets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("podpresets"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *podPresets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *podPresets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("podpresets"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/csinode.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/csinode.go index 6ecde5933cb..f8ba2454475 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/csinode.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/csinode.go @@ -40,8 +40,8 @@ type CSINodesGetter interface { type CSINodeInterface interface { Create(ctx context.Context, cSINode *v1.CSINode, opts metav1.CreateOptions) (*v1.CSINode, error) Update(ctx context.Context, cSINode *v1.CSINode, opts metav1.UpdateOptions) (*v1.CSINode, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.CSINode, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.CSINodeList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -129,26 +129,26 @@ func (c *cSINodes) Update(ctx context.Context, cSINode *v1.CSINode, opts metav1. } // Delete takes name of the cSINode and deletes it. Returns an error if one occurs. -func (c *cSINodes) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *cSINodes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Resource("csinodes"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *cSINodes) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *cSINodes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("csinodes"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_csinode.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_csinode.go index 94452160de8..46662d20a36 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_csinode.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_csinode.go @@ -97,15 +97,15 @@ func (c *FakeCSINodes) Update(ctx context.Context, cSINode *storagev1.CSINode, o } // Delete takes name of the cSINode and deletes it. Returns an error if one occurs. -func (c *FakeCSINodes) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeCSINodes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(csinodesResource, name), &storagev1.CSINode{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeCSINodes) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(csinodesResource, listOptions) +func (c *FakeCSINodes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(csinodesResource, listOpts) _, err := c.Fake.Invokes(action, &storagev1.CSINodeList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storageclass.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storageclass.go index 2d5d1f2c76c..dbd38c76537 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storageclass.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storageclass.go @@ -97,15 +97,15 @@ func (c *FakeStorageClasses) Update(ctx context.Context, storageClass *storagev1 } // Delete takes name of the storageClass and deletes it. Returns an error if one occurs. -func (c *FakeStorageClasses) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeStorageClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(storageclassesResource, name), &storagev1.StorageClass{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeStorageClasses) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(storageclassesResource, listOptions) +func (c *FakeStorageClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(storageclassesResource, listOpts) _, err := c.Fake.Invokes(action, &storagev1.StorageClassList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_volumeattachment.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_volumeattachment.go index 479bf6ff8c5..72a3238f972 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_volumeattachment.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_volumeattachment.go @@ -108,15 +108,15 @@ func (c *FakeVolumeAttachments) UpdateStatus(ctx context.Context, volumeAttachme } // Delete takes name of the volumeAttachment and deletes it. Returns an error if one occurs. -func (c *FakeVolumeAttachments) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeVolumeAttachments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(volumeattachmentsResource, name), &storagev1.VolumeAttachment{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeVolumeAttachments) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(volumeattachmentsResource, listOptions) +func (c *FakeVolumeAttachments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(volumeattachmentsResource, listOpts) _, err := c.Fake.Invokes(action, &storagev1.VolumeAttachmentList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/storageclass.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/storageclass.go index b23725cce9c..046ec3a1b97 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/storageclass.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/storageclass.go @@ -40,8 +40,8 @@ type StorageClassesGetter interface { type StorageClassInterface interface { Create(ctx context.Context, storageClass *v1.StorageClass, opts metav1.CreateOptions) (*v1.StorageClass, error) Update(ctx context.Context, storageClass *v1.StorageClass, opts metav1.UpdateOptions) (*v1.StorageClass, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.StorageClass, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.StorageClassList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -129,26 +129,26 @@ func (c *storageClasses) Update(ctx context.Context, storageClass *v1.StorageCla } // Delete takes name of the storageClass and deletes it. Returns an error if one occurs. -func (c *storageClasses) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *storageClasses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Resource("storageclasses"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *storageClasses) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *storageClasses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("storageclasses"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/volumeattachment.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/volumeattachment.go index 1a466070e9e..e4162975fc2 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/volumeattachment.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1/volumeattachment.go @@ -41,8 +41,8 @@ type VolumeAttachmentInterface interface { Create(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.CreateOptions) (*v1.VolumeAttachment, error) Update(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.UpdateOptions) (*v1.VolumeAttachment, error) UpdateStatus(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.UpdateOptions) (*v1.VolumeAttachment, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.VolumeAttachment, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.VolumeAttachmentList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -145,26 +145,26 @@ func (c *volumeAttachments) UpdateStatus(ctx context.Context, volumeAttachment * } // Delete takes name of the volumeAttachment and deletes it. Returns an error if one occurs. -func (c *volumeAttachments) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *volumeAttachments) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Resource("volumeattachments"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *volumeAttachments) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *volumeAttachments) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("volumeattachments"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattachment.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattachment.go index 96cbf0259fd..a3140e72178 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattachment.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattachment.go @@ -108,15 +108,15 @@ func (c *FakeVolumeAttachments) UpdateStatus(ctx context.Context, volumeAttachme } // Delete takes name of the volumeAttachment and deletes it. Returns an error if one occurs. -func (c *FakeVolumeAttachments) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeVolumeAttachments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(volumeattachmentsResource, name), &v1alpha1.VolumeAttachment{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeVolumeAttachments) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(volumeattachmentsResource, listOptions) +func (c *FakeVolumeAttachments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(volumeattachmentsResource, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.VolumeAttachmentList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/volumeattachment.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/volumeattachment.go index 4ecc7eb21c4..9012fde99d0 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/volumeattachment.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/volumeattachment.go @@ -41,8 +41,8 @@ type VolumeAttachmentInterface interface { Create(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.CreateOptions) (*v1alpha1.VolumeAttachment, error) Update(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.UpdateOptions) (*v1alpha1.VolumeAttachment, error) UpdateStatus(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.UpdateOptions) (*v1alpha1.VolumeAttachment, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.VolumeAttachment, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.VolumeAttachmentList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -145,26 +145,26 @@ func (c *volumeAttachments) UpdateStatus(ctx context.Context, volumeAttachment * } // Delete takes name of the volumeAttachment and deletes it. Returns an error if one occurs. -func (c *volumeAttachments) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *volumeAttachments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("volumeattachments"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *volumeAttachments) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *volumeAttachments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("volumeattachments"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/csidriver.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/csidriver.go index 0420bf9b26e..2ad26304201 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/csidriver.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/csidriver.go @@ -40,8 +40,8 @@ type CSIDriversGetter interface { type CSIDriverInterface interface { Create(ctx context.Context, cSIDriver *v1beta1.CSIDriver, opts v1.CreateOptions) (*v1beta1.CSIDriver, error) Update(ctx context.Context, cSIDriver *v1beta1.CSIDriver, opts v1.UpdateOptions) (*v1beta1.CSIDriver, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.CSIDriver, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CSIDriverList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -129,26 +129,26 @@ func (c *cSIDrivers) Update(ctx context.Context, cSIDriver *v1beta1.CSIDriver, o } // Delete takes name of the cSIDriver and deletes it. Returns an error if one occurs. -func (c *cSIDrivers) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *cSIDrivers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("csidrivers"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *cSIDrivers) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *cSIDrivers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("csidrivers"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/csinode.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/csinode.go index 7f737017535..babb89aba63 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/csinode.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/csinode.go @@ -40,8 +40,8 @@ type CSINodesGetter interface { type CSINodeInterface interface { Create(ctx context.Context, cSINode *v1beta1.CSINode, opts v1.CreateOptions) (*v1beta1.CSINode, error) Update(ctx context.Context, cSINode *v1beta1.CSINode, opts v1.UpdateOptions) (*v1beta1.CSINode, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.CSINode, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CSINodeList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -129,26 +129,26 @@ func (c *cSINodes) Update(ctx context.Context, cSINode *v1beta1.CSINode, opts v1 } // Delete takes name of the cSINode and deletes it. Returns an error if one occurs. -func (c *cSINodes) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *cSINodes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("csinodes"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *cSINodes) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *cSINodes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("csinodes"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_csidriver.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_csidriver.go index 7fe60c7304c..35b2449ee59 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_csidriver.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_csidriver.go @@ -97,15 +97,15 @@ func (c *FakeCSIDrivers) Update(ctx context.Context, cSIDriver *v1beta1.CSIDrive } // Delete takes name of the cSIDriver and deletes it. Returns an error if one occurs. -func (c *FakeCSIDrivers) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeCSIDrivers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(csidriversResource, name), &v1beta1.CSIDriver{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeCSIDrivers) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(csidriversResource, listOptions) +func (c *FakeCSIDrivers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(csidriversResource, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.CSIDriverList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_csinode.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_csinode.go index af22e22f9d5..81e5bc6d924 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_csinode.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_csinode.go @@ -97,15 +97,15 @@ func (c *FakeCSINodes) Update(ctx context.Context, cSINode *v1beta1.CSINode, opt } // Delete takes name of the cSINode and deletes it. Returns an error if one occurs. -func (c *FakeCSINodes) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeCSINodes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(csinodesResource, name), &v1beta1.CSINode{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeCSINodes) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(csinodesResource, listOptions) +func (c *FakeCSINodes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(csinodesResource, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.CSINodeList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go index 8d53f8240dc..3b0a8688cb8 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go @@ -97,15 +97,15 @@ func (c *FakeStorageClasses) Update(ctx context.Context, storageClass *v1beta1.S } // Delete takes name of the storageClass and deletes it. Returns an error if one occurs. -func (c *FakeStorageClasses) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeStorageClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(storageclassesResource, name), &v1beta1.StorageClass{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeStorageClasses) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(storageclassesResource, listOptions) +func (c *FakeStorageClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(storageclassesResource, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.StorageClassList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_volumeattachment.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_volumeattachment.go index 30061b0619b..0bc91bf5663 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_volumeattachment.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_volumeattachment.go @@ -108,15 +108,15 @@ func (c *FakeVolumeAttachments) UpdateStatus(ctx context.Context, volumeAttachme } // Delete takes name of the volumeAttachment and deletes it. Returns an error if one occurs. -func (c *FakeVolumeAttachments) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeVolumeAttachments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(volumeattachmentsResource, name), &v1beta1.VolumeAttachment{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeVolumeAttachments) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(volumeattachmentsResource, listOptions) +func (c *FakeVolumeAttachments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(volumeattachmentsResource, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.VolumeAttachmentList{}) return err diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storageclass.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storageclass.go index 553d40f6840..d6a8da98a39 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storageclass.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storageclass.go @@ -40,8 +40,8 @@ type StorageClassesGetter interface { type StorageClassInterface interface { Create(ctx context.Context, storageClass *v1beta1.StorageClass, opts v1.CreateOptions) (*v1beta1.StorageClass, error) Update(ctx context.Context, storageClass *v1beta1.StorageClass, opts v1.UpdateOptions) (*v1beta1.StorageClass, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.StorageClass, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.StorageClassList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -129,26 +129,26 @@ func (c *storageClasses) Update(ctx context.Context, storageClass *v1beta1.Stora } // Delete takes name of the storageClass and deletes it. Returns an error if one occurs. -func (c *storageClasses) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *storageClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("storageclasses"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *storageClasses) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *storageClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("storageclasses"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/volumeattachment.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/volumeattachment.go index f9eb953845c..951a5e71bf2 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/volumeattachment.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/volumeattachment.go @@ -41,8 +41,8 @@ type VolumeAttachmentInterface interface { Create(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.CreateOptions) (*v1beta1.VolumeAttachment, error) Update(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.UpdateOptions) (*v1beta1.VolumeAttachment, error) UpdateStatus(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.UpdateOptions) (*v1beta1.VolumeAttachment, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.VolumeAttachment, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.VolumeAttachmentList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -145,26 +145,26 @@ func (c *volumeAttachments) UpdateStatus(ctx context.Context, volumeAttachment * } // Delete takes name of the volumeAttachment and deletes it. Returns an error if one occurs. -func (c *volumeAttachments) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *volumeAttachments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("volumeattachments"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *volumeAttachments) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *volumeAttachments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("volumeattachments"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/clustertesttype.go b/staging/src/k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/clustertesttype.go index 06e3280f389..7d2b1501251 100644 --- a/staging/src/k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/clustertesttype.go +++ b/staging/src/k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/clustertesttype.go @@ -42,8 +42,8 @@ type ClusterTestTypeInterface interface { Create(ctx context.Context, clusterTestType *v1.ClusterTestType, opts metav1.CreateOptions) (*v1.ClusterTestType, error) Update(ctx context.Context, clusterTestType *v1.ClusterTestType, opts metav1.UpdateOptions) (*v1.ClusterTestType, error) UpdateStatus(ctx context.Context, clusterTestType *v1.ClusterTestType, opts metav1.UpdateOptions) (*v1.ClusterTestType, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ClusterTestType, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterTestTypeList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -149,26 +149,26 @@ func (c *clusterTestTypes) UpdateStatus(ctx context.Context, clusterTestType *v1 } // Delete takes name of the clusterTestType and deletes it. Returns an error if one occurs. -func (c *clusterTestTypes) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *clusterTestTypes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Resource("clustertesttypes"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *clusterTestTypes) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *clusterTestTypes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("clustertesttypes"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go b/staging/src/k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go index 51fca40a932..497d2669aaf 100644 --- a/staging/src/k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go +++ b/staging/src/k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go @@ -109,15 +109,15 @@ func (c *FakeClusterTestTypes) UpdateStatus(ctx context.Context, clusterTestType } // Delete takes name of the clusterTestType and deletes it. Returns an error if one occurs. -func (c *FakeClusterTestTypes) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeClusterTestTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(clustertesttypesResource, name), &examplev1.ClusterTestType{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeClusterTestTypes) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clustertesttypesResource, listOptions) +func (c *FakeClusterTestTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(clustertesttypesResource, listOpts) _, err := c.Fake.Invokes(action, &examplev1.ClusterTestTypeList{}) return err diff --git a/staging/src/k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/fake/fake_testtype.go b/staging/src/k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/fake/fake_testtype.go index b669a795f53..d910dd31bb2 100644 --- a/staging/src/k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/fake/fake_testtype.go +++ b/staging/src/k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/fake/fake_testtype.go @@ -115,7 +115,7 @@ func (c *FakeTestTypes) UpdateStatus(ctx context.Context, testType *examplev1.Te } // Delete takes name of the testType and deletes it. Returns an error if one occurs. -func (c *FakeTestTypes) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeTestTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(testtypesResource, c.ns, name), &examplev1.TestType{}) @@ -123,8 +123,8 @@ func (c *FakeTestTypes) Delete(ctx context.Context, name string, options *v1.Del } // DeleteCollection deletes a collection of objects. -func (c *FakeTestTypes) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOptions) +func (c *FakeTestTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &examplev1.TestTypeList{}) return err diff --git a/staging/src/k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/testtype.go b/staging/src/k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/testtype.go index 69a7bc1868d..798c1f37902 100644 --- a/staging/src/k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/testtype.go +++ b/staging/src/k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/testtype.go @@ -41,8 +41,8 @@ type TestTypeInterface interface { Create(ctx context.Context, testType *v1.TestType, opts metav1.CreateOptions) (*v1.TestType, error) Update(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (*v1.TestType, error) UpdateStatus(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (*v1.TestType, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.TestType, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.TestTypeList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *testTypes) UpdateStatus(ctx context.Context, testType *v1.TestType, opt } // Delete takes name of the testType and deletes it. Returns an error if one occurs. -func (c *testTypes) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *testTypes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *testTypes) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *testTypes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/clustertesttype.go b/staging/src/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/clustertesttype.go index fcff8bab355..824501d66d3 100644 --- a/staging/src/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/clustertesttype.go +++ b/staging/src/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/clustertesttype.go @@ -42,8 +42,8 @@ type ClusterTestTypeInterface interface { Create(ctx context.Context, clusterTestType *v1.ClusterTestType, opts metav1.CreateOptions) (*v1.ClusterTestType, error) Update(ctx context.Context, clusterTestType *v1.ClusterTestType, opts metav1.UpdateOptions) (*v1.ClusterTestType, error) UpdateStatus(ctx context.Context, clusterTestType *v1.ClusterTestType, opts metav1.UpdateOptions) (*v1.ClusterTestType, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ClusterTestType, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterTestTypeList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -149,26 +149,26 @@ func (c *clusterTestTypes) UpdateStatus(ctx context.Context, clusterTestType *v1 } // Delete takes name of the clusterTestType and deletes it. Returns an error if one occurs. -func (c *clusterTestTypes) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *clusterTestTypes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Resource("clustertesttypes"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *clusterTestTypes) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *clusterTestTypes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("clustertesttypes"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go b/staging/src/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go index 84ed4a99ccd..669c97c740a 100644 --- a/staging/src/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go +++ b/staging/src/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go @@ -109,15 +109,15 @@ func (c *FakeClusterTestTypes) UpdateStatus(ctx context.Context, clusterTestType } // Delete takes name of the clusterTestType and deletes it. Returns an error if one occurs. -func (c *FakeClusterTestTypes) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeClusterTestTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(clustertesttypesResource, name), &examplev1.ClusterTestType{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeClusterTestTypes) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clustertesttypesResource, listOptions) +func (c *FakeClusterTestTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(clustertesttypesResource, listOpts) _, err := c.Fake.Invokes(action, &examplev1.ClusterTestTypeList{}) return err diff --git a/staging/src/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/fake_testtype.go b/staging/src/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/fake_testtype.go index 6346ee204e1..c1b550b4480 100644 --- a/staging/src/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/fake_testtype.go +++ b/staging/src/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/fake_testtype.go @@ -115,7 +115,7 @@ func (c *FakeTestTypes) UpdateStatus(ctx context.Context, testType *examplev1.Te } // Delete takes name of the testType and deletes it. Returns an error if one occurs. -func (c *FakeTestTypes) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeTestTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(testtypesResource, c.ns, name), &examplev1.TestType{}) @@ -123,8 +123,8 @@ func (c *FakeTestTypes) Delete(ctx context.Context, name string, options *v1.Del } // DeleteCollection deletes a collection of objects. -func (c *FakeTestTypes) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOptions) +func (c *FakeTestTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &examplev1.TestTypeList{}) return err diff --git a/staging/src/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/testtype.go b/staging/src/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/testtype.go index 530a45e974f..56c201a54f4 100644 --- a/staging/src/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/testtype.go +++ b/staging/src/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/testtype.go @@ -41,8 +41,8 @@ type TestTypeInterface interface { Create(ctx context.Context, testType *v1.TestType, opts metav1.CreateOptions) (*v1.TestType, error) Update(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (*v1.TestType, error) UpdateStatus(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (*v1.TestType, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.TestType, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.TestTypeList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *testTypes) UpdateStatus(ctx context.Context, testType *v1.TestType, opt } // Delete takes name of the testType and deletes it. Returns an error if one occurs. -func (c *testTypes) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *testTypes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *testTypes) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *testTypes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/fake_testtype.go b/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/fake_testtype.go index 86c652af574..a0d0316df2c 100644 --- a/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/fake_testtype.go +++ b/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/fake_testtype.go @@ -115,7 +115,7 @@ func (c *FakeTestTypes) UpdateStatus(ctx context.Context, testType *example.Test } // Delete takes name of the testType and deletes it. Returns an error if one occurs. -func (c *FakeTestTypes) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeTestTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(testtypesResource, c.ns, name), &example.TestType{}) @@ -123,8 +123,8 @@ func (c *FakeTestTypes) Delete(ctx context.Context, name string, options *v1.Del } // DeleteCollection deletes a collection of objects. -func (c *FakeTestTypes) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOptions) +func (c *FakeTestTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &example.TestTypeList{}) return err diff --git a/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/testtype.go b/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/testtype.go index 3c4bf279eb9..7237bdda799 100644 --- a/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/testtype.go +++ b/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/testtype.go @@ -41,8 +41,8 @@ type TestTypeInterface interface { Create(ctx context.Context, testType *example.TestType, opts v1.CreateOptions) (*example.TestType, error) Update(ctx context.Context, testType *example.TestType, opts v1.UpdateOptions) (*example.TestType, error) UpdateStatus(ctx context.Context, testType *example.TestType, opts v1.UpdateOptions) (*example.TestType, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*example.TestType, error) List(ctx context.Context, opts v1.ListOptions) (*example.TestTypeList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *testTypes) UpdateStatus(ctx context.Context, testType *example.TestType } // Delete takes name of the testType and deletes it. Returns an error if one occurs. -func (c *testTypes) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *testTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *testTypes) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *testTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/fake_testtype.go b/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/fake_testtype.go index 7595b6478a9..db009eb03e1 100644 --- a/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/fake_testtype.go +++ b/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/fake_testtype.go @@ -108,15 +108,15 @@ func (c *FakeTestTypes) UpdateStatus(ctx context.Context, testType *example2.Tes } // Delete takes name of the testType and deletes it. Returns an error if one occurs. -func (c *FakeTestTypes) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeTestTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(testtypesResource, name), &example2.TestType{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeTestTypes) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(testtypesResource, listOptions) +func (c *FakeTestTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(testtypesResource, listOpts) _, err := c.Fake.Invokes(action, &example2.TestTypeList{}) return err diff --git a/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/testtype.go b/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/testtype.go index f29f593db2c..9aecdfcda39 100644 --- a/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/testtype.go +++ b/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/testtype.go @@ -41,8 +41,8 @@ type TestTypeInterface interface { Create(ctx context.Context, testType *example2.TestType, opts v1.CreateOptions) (*example2.TestType, error) Update(ctx context.Context, testType *example2.TestType, opts v1.UpdateOptions) (*example2.TestType, error) UpdateStatus(ctx context.Context, testType *example2.TestType, opts v1.UpdateOptions) (*example2.TestType, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*example2.TestType, error) List(ctx context.Context, opts v1.ListOptions) (*example2.TestTypeList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -145,26 +145,26 @@ func (c *testTypes) UpdateStatus(ctx context.Context, testType *example2.TestTyp } // Delete takes name of the testType and deletes it. Returns an error if one occurs. -func (c *testTypes) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *testTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("testtypes"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *testTypes) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *testTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("testtypes"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/fake/fake_testtype.go b/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/fake/fake_testtype.go index a26b42d1e53..f7d80c18ffa 100644 --- a/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/fake/fake_testtype.go +++ b/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/fake/fake_testtype.go @@ -115,7 +115,7 @@ func (c *FakeTestTypes) UpdateStatus(ctx context.Context, testType *example3io.T } // Delete takes name of the testType and deletes it. Returns an error if one occurs. -func (c *FakeTestTypes) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeTestTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(testtypesResource, c.ns, name), &example3io.TestType{}) @@ -123,8 +123,8 @@ func (c *FakeTestTypes) Delete(ctx context.Context, name string, options *v1.Del } // DeleteCollection deletes a collection of objects. -func (c *FakeTestTypes) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOptions) +func (c *FakeTestTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &example3io.TestTypeList{}) return err diff --git a/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/testtype.go b/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/testtype.go index d2e51d5e2cd..f82b4487500 100644 --- a/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/testtype.go +++ b/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/testtype.go @@ -41,8 +41,8 @@ type TestTypeInterface interface { Create(ctx context.Context, testType *example3io.TestType, opts v1.CreateOptions) (*example3io.TestType, error) Update(ctx context.Context, testType *example3io.TestType, opts v1.UpdateOptions) (*example3io.TestType, error) UpdateStatus(ctx context.Context, testType *example3io.TestType, opts v1.UpdateOptions) (*example3io.TestType, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*example3io.TestType, error) List(ctx context.Context, opts v1.ListOptions) (*example3io.TestTypeList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *testTypes) UpdateStatus(ctx context.Context, testType *example3io.TestT } // Delete takes name of the testType and deletes it. Returns an error if one occurs. -func (c *testTypes) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *testTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *testTypes) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *testTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/fake_testtype.go b/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/fake_testtype.go index d3ef16e5a90..b9b1e203c30 100644 --- a/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/fake_testtype.go +++ b/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/fake_testtype.go @@ -115,7 +115,7 @@ func (c *FakeTestTypes) UpdateStatus(ctx context.Context, testType *examplev1.Te } // Delete takes name of the testType and deletes it. Returns an error if one occurs. -func (c *FakeTestTypes) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeTestTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(testtypesResource, c.ns, name), &examplev1.TestType{}) @@ -123,8 +123,8 @@ func (c *FakeTestTypes) Delete(ctx context.Context, name string, options *v1.Del } // DeleteCollection deletes a collection of objects. -func (c *FakeTestTypes) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOptions) +func (c *FakeTestTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &examplev1.TestTypeList{}) return err diff --git a/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/testtype.go b/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/testtype.go index 2d42149182f..d53290dc3dd 100644 --- a/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/testtype.go +++ b/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/testtype.go @@ -41,8 +41,8 @@ type TestTypeInterface interface { Create(ctx context.Context, testType *v1.TestType, opts metav1.CreateOptions) (*v1.TestType, error) Update(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (*v1.TestType, error) UpdateStatus(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (*v1.TestType, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.TestType, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.TestTypeList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *testTypes) UpdateStatus(ctx context.Context, testType *v1.TestType, opt } // Delete takes name of the testType and deletes it. Returns an error if one occurs. -func (c *testTypes) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *testTypes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *testTypes) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *testTypes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/fake_testtype.go b/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/fake_testtype.go index 7d64e588697..6187002d766 100644 --- a/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/fake_testtype.go +++ b/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/fake_testtype.go @@ -115,7 +115,7 @@ func (c *FakeTestTypes) UpdateStatus(ctx context.Context, testType *example2v1.T } // Delete takes name of the testType and deletes it. Returns an error if one occurs. -func (c *FakeTestTypes) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeTestTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(testtypesResource, c.ns, name), &example2v1.TestType{}) @@ -123,8 +123,8 @@ func (c *FakeTestTypes) Delete(ctx context.Context, name string, options *v1.Del } // DeleteCollection deletes a collection of objects. -func (c *FakeTestTypes) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOptions) +func (c *FakeTestTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &example2v1.TestTypeList{}) return err diff --git a/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/testtype.go b/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/testtype.go index ea5650dbbe1..5e23a04896a 100644 --- a/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/testtype.go +++ b/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/testtype.go @@ -41,8 +41,8 @@ type TestTypeInterface interface { Create(ctx context.Context, testType *v1.TestType, opts metav1.CreateOptions) (*v1.TestType, error) Update(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (*v1.TestType, error) UpdateStatus(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (*v1.TestType, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.TestType, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.TestTypeList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *testTypes) UpdateStatus(ctx context.Context, testType *v1.TestType, opt } // Delete takes name of the testType and deletes it. Returns an error if one occurs. -func (c *testTypes) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *testTypes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *testTypes) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *testTypes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/fake/fake_testtype.go b/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/fake/fake_testtype.go index 18689dbd2b2..8a67d81a967 100644 --- a/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/fake/fake_testtype.go +++ b/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/fake/fake_testtype.go @@ -115,7 +115,7 @@ func (c *FakeTestTypes) UpdateStatus(ctx context.Context, testType *example3iov1 } // Delete takes name of the testType and deletes it. Returns an error if one occurs. -func (c *FakeTestTypes) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeTestTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(testtypesResource, c.ns, name), &example3iov1.TestType{}) @@ -123,8 +123,8 @@ func (c *FakeTestTypes) Delete(ctx context.Context, name string, options *v1.Del } // DeleteCollection deletes a collection of objects. -func (c *FakeTestTypes) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOptions) +func (c *FakeTestTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &example3iov1.TestTypeList{}) return err diff --git a/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/testtype.go b/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/testtype.go index 9ac449a514b..f9caafa80c4 100644 --- a/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/testtype.go +++ b/staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/testtype.go @@ -41,8 +41,8 @@ type TestTypeInterface interface { Create(ctx context.Context, testType *v1.TestType, opts metav1.CreateOptions) (*v1.TestType, error) Update(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (*v1.TestType, error) UpdateStatus(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (*v1.TestType, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.TestType, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.TestTypeList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *testTypes) UpdateStatus(ctx context.Context, testType *v1.TestType, opt } // Delete takes name of the testType and deletes it. Returns an error if one occurs. -func (c *testTypes) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *testTypes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *testTypes) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *testTypes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/clustertesttype.go b/staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/clustertesttype.go index 3343e9db2a6..72af4f00cf7 100644 --- a/staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/clustertesttype.go +++ b/staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/clustertesttype.go @@ -42,8 +42,8 @@ type ClusterTestTypeInterface interface { Create(ctx context.Context, clusterTestType *v1.ClusterTestType, opts metav1.CreateOptions) (*v1.ClusterTestType, error) Update(ctx context.Context, clusterTestType *v1.ClusterTestType, opts metav1.UpdateOptions) (*v1.ClusterTestType, error) UpdateStatus(ctx context.Context, clusterTestType *v1.ClusterTestType, opts metav1.UpdateOptions) (*v1.ClusterTestType, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ClusterTestType, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterTestTypeList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -149,26 +149,26 @@ func (c *clusterTestTypes) UpdateStatus(ctx context.Context, clusterTestType *v1 } // Delete takes name of the clusterTestType and deletes it. Returns an error if one occurs. -func (c *clusterTestTypes) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *clusterTestTypes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Resource("clustertesttypes"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *clusterTestTypes) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *clusterTestTypes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("clustertesttypes"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go b/staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go index 4e9baad5bf0..8adf09021ff 100644 --- a/staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go +++ b/staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go @@ -109,15 +109,15 @@ func (c *FakeClusterTestTypes) UpdateStatus(ctx context.Context, clusterTestType } // Delete takes name of the clusterTestType and deletes it. Returns an error if one occurs. -func (c *FakeClusterTestTypes) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeClusterTestTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(clustertesttypesResource, name), &examplev1.ClusterTestType{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeClusterTestTypes) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clustertesttypesResource, listOptions) +func (c *FakeClusterTestTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(clustertesttypesResource, listOpts) _, err := c.Fake.Invokes(action, &examplev1.ClusterTestTypeList{}) return err diff --git a/staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_testtype.go b/staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_testtype.go index dfbc8caf564..8bfa33ed67e 100644 --- a/staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_testtype.go +++ b/staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_testtype.go @@ -115,7 +115,7 @@ func (c *FakeTestTypes) UpdateStatus(ctx context.Context, testType *examplev1.Te } // Delete takes name of the testType and deletes it. Returns an error if one occurs. -func (c *FakeTestTypes) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeTestTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(testtypesResource, c.ns, name), &examplev1.TestType{}) @@ -123,8 +123,8 @@ func (c *FakeTestTypes) Delete(ctx context.Context, name string, options *v1.Del } // DeleteCollection deletes a collection of objects. -func (c *FakeTestTypes) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOptions) +func (c *FakeTestTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &examplev1.TestTypeList{}) return err diff --git a/staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/testtype.go b/staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/testtype.go index 779dd5767d7..862154ad66a 100644 --- a/staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/testtype.go +++ b/staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/testtype.go @@ -41,8 +41,8 @@ type TestTypeInterface interface { Create(ctx context.Context, testType *v1.TestType, opts metav1.CreateOptions) (*v1.TestType, error) Update(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (*v1.TestType, error) UpdateStatus(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (*v1.TestType, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.TestType, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.TestTypeList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *testTypes) UpdateStatus(ctx context.Context, testType *v1.TestType, opt } // Delete takes name of the testType and deletes it. Returns an error if one occurs. -func (c *testTypes) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *testTypes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *testTypes) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *testTypes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/fake_testtype.go b/staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/fake_testtype.go index ea843c6bfda..8a01670dd77 100644 --- a/staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/fake_testtype.go +++ b/staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/fake_testtype.go @@ -115,7 +115,7 @@ func (c *FakeTestTypes) UpdateStatus(ctx context.Context, testType *example2v1.T } // Delete takes name of the testType and deletes it. Returns an error if one occurs. -func (c *FakeTestTypes) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeTestTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(testtypesResource, c.ns, name), &example2v1.TestType{}) @@ -123,8 +123,8 @@ func (c *FakeTestTypes) Delete(ctx context.Context, name string, options *v1.Del } // DeleteCollection deletes a collection of objects. -func (c *FakeTestTypes) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOptions) +func (c *FakeTestTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &example2v1.TestTypeList{}) return err diff --git a/staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/testtype.go b/staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/testtype.go index 3f5af5f97ce..8a33b1c5a85 100644 --- a/staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/testtype.go +++ b/staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/testtype.go @@ -41,8 +41,8 @@ type TestTypeInterface interface { Create(ctx context.Context, testType *v1.TestType, opts metav1.CreateOptions) (*v1.TestType, error) Update(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (*v1.TestType, error) UpdateStatus(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (*v1.TestType, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.TestType, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.TestTypeList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *testTypes) UpdateStatus(ctx context.Context, testType *v1.TestType, opt } // Delete takes name of the testType and deletes it. Returns an error if one occurs. -func (c *testTypes) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *testTypes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *testTypes) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *testTypes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go b/staging/src/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go index e3c03d6e3f8..ebd8506ec94 100644 --- a/staging/src/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go +++ b/staging/src/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go @@ -375,7 +375,7 @@ func (c *Fake$.type|publicPlural$) Get(ctx context.Context, $.type|private$Name var deleteTemplate = ` // Delete takes name of the $.type|private$ and deletes it. Returns an error if one occurs. -func (c *Fake$.type|publicPlural$) Delete(ctx context.Context, name string, options *$.DeleteOptions|raw$) error { +func (c *Fake$.type|publicPlural$) Delete(ctx context.Context, name string, opts $.DeleteOptions|raw$) error { _, err := c.Fake. $if .namespaced$Invokes($.NewDeleteAction|raw$($.type|allLowercasePlural$Resource, c.ns, name), &$.type|raw${}) $else$Invokes($.NewRootDeleteAction|raw$($.type|allLowercasePlural$Resource, name), &$.type|raw${})$end$ @@ -385,9 +385,9 @@ func (c *Fake$.type|publicPlural$) Delete(ctx context.Context, name string, opti var deleteCollectionTemplate = ` // DeleteCollection deletes a collection of objects. -func (c *Fake$.type|publicPlural$) DeleteCollection(ctx context.Context, options *$.DeleteOptions|raw$, listOptions $.ListOptions|raw$) error { - $if .namespaced$action := $.NewDeleteCollectionAction|raw$($.type|allLowercasePlural$Resource, c.ns, listOptions) - $else$action := $.NewRootDeleteCollectionAction|raw$($.type|allLowercasePlural$Resource, listOptions) +func (c *Fake$.type|publicPlural$) DeleteCollection(ctx context.Context, opts $.DeleteOptions|raw$, listOpts $.ListOptions|raw$) error { + $if .namespaced$action := $.NewDeleteCollectionAction|raw$($.type|allLowercasePlural$Resource, c.ns, listOpts) + $else$action := $.NewRootDeleteCollectionAction|raw$($.type|allLowercasePlural$Resource, listOpts) $end$ _, err := c.Fake.Invokes(action, &$.type|raw$List{}) return err diff --git a/staging/src/k8s.io/code-generator/cmd/client-gen/generators/generator_for_type.go b/staging/src/k8s.io/code-generator/cmd/client-gen/generators/generator_for_type.go index 9aa419a00ac..13664d0d924 100644 --- a/staging/src/k8s.io/code-generator/cmd/client-gen/generators/generator_for_type.go +++ b/staging/src/k8s.io/code-generator/cmd/client-gen/generators/generator_for_type.go @@ -320,8 +320,8 @@ var defaultVerbTemplates = map[string]string{ "create": `Create(ctx context.Context, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (*$.resultType|raw$, error)`, "update": `Update(ctx context.Context, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (*$.resultType|raw$, error)`, "updateStatus": `UpdateStatus(ctx context.Context, $.inputType|private$ *$.type|raw$, opts $.UpdateOptions|raw$) (*$.type|raw$, error)`, - "delete": `Delete(ctx context.Context, name string, opts *$.DeleteOptions|raw$) error`, - "deleteCollection": `DeleteCollection(ctx context.Context, opts *$.DeleteOptions|raw$, listOpts $.ListOptions|raw$) error`, + "delete": `Delete(ctx context.Context, name string, opts $.DeleteOptions|raw$) error`, + "deleteCollection": `DeleteCollection(ctx context.Context, opts $.DeleteOptions|raw$, listOpts $.ListOptions|raw$) error`, "get": `Get(ctx context.Context, name string, opts $.GetOptions|raw$) (*$.resultType|raw$, error)`, "list": `List(ctx context.Context, opts $.ListOptions|raw$) (*$.resultType|raw$List, error)`, "watch": `Watch(ctx context.Context, opts $.ListOptions|raw$) ($.watchInterface|raw$, error)`, @@ -463,12 +463,12 @@ func (c *$.type|privatePlural$) Get(ctx context.Context, $.type|private$Name str var deleteTemplate = ` // Delete takes name of the $.type|private$ and deletes it. Returns an error if one occurs. -func (c *$.type|privatePlural$) Delete(ctx context.Context, name string, options *$.DeleteOptions|raw$) error { +func (c *$.type|privatePlural$) Delete(ctx context.Context, name string, opts $.DeleteOptions|raw$) error { return c.client.Delete(). $if .namespaced$Namespace(c.ns).$end$ Resource("$.type|resource$"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } @@ -476,17 +476,17 @@ func (c *$.type|privatePlural$) Delete(ctx context.Context, name string, options var deleteCollectionTemplate = ` // DeleteCollection deletes a collection of objects. -func (c *$.type|privatePlural$) DeleteCollection(ctx context.Context, options *$.DeleteOptions|raw$, listOptions $.ListOptions|raw$) error { +func (c *$.type|privatePlural$) DeleteCollection(ctx context.Context, opts $.DeleteOptions|raw$, listOpts $.ListOptions|raw$) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil{ - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil{ + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). $if .namespaced$Namespace(c.ns).$end$ Resource("$.type|resource$"). - VersionedParams(&listOptions, $.schemeParameterCodec|raw$). + VersionedParams(&listOpts, $.schemeParameterCodec|raw$). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1/apiservice.go b/staging/src/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1/apiservice.go index dfaaee3ed0e..25bf6ea44b9 100644 --- a/staging/src/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1/apiservice.go +++ b/staging/src/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1/apiservice.go @@ -41,8 +41,8 @@ type APIServiceInterface interface { Create(ctx context.Context, aPIService *v1.APIService, opts metav1.CreateOptions) (*v1.APIService, error) Update(ctx context.Context, aPIService *v1.APIService, opts metav1.UpdateOptions) (*v1.APIService, error) UpdateStatus(ctx context.Context, aPIService *v1.APIService, opts metav1.UpdateOptions) (*v1.APIService, error) - Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.APIService, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.APIServiceList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) @@ -145,26 +145,26 @@ func (c *aPIServices) UpdateStatus(ctx context.Context, aPIService *v1.APIServic } // Delete takes name of the aPIService and deletes it. Returns an error if one occurs. -func (c *aPIServices) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error { +func (c *aPIServices) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Resource("apiservices"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *aPIServices) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *aPIServices) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("apiservices"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1/fake/fake_apiservice.go b/staging/src/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1/fake/fake_apiservice.go index 4d5001c6ccc..54cd4576d12 100644 --- a/staging/src/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1/fake/fake_apiservice.go +++ b/staging/src/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1/fake/fake_apiservice.go @@ -108,15 +108,15 @@ func (c *FakeAPIServices) UpdateStatus(ctx context.Context, aPIService *apiregis } // Delete takes name of the aPIService and deletes it. Returns an error if one occurs. -func (c *FakeAPIServices) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeAPIServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(apiservicesResource, name), &apiregistrationv1.APIService{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeAPIServices) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(apiservicesResource, listOptions) +func (c *FakeAPIServices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(apiservicesResource, listOpts) _, err := c.Fake.Invokes(action, &apiregistrationv1.APIServiceList{}) return err diff --git a/staging/src/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/apiservice.go b/staging/src/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/apiservice.go index b39d9b2dc01..a5e76412e1d 100644 --- a/staging/src/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/apiservice.go +++ b/staging/src/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/apiservice.go @@ -41,8 +41,8 @@ type APIServiceInterface interface { Create(ctx context.Context, aPIService *v1beta1.APIService, opts v1.CreateOptions) (*v1beta1.APIService, error) Update(ctx context.Context, aPIService *v1beta1.APIService, opts v1.UpdateOptions) (*v1beta1.APIService, error) UpdateStatus(ctx context.Context, aPIService *v1beta1.APIService, opts v1.UpdateOptions) (*v1beta1.APIService, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.APIService, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.APIServiceList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -145,26 +145,26 @@ func (c *aPIServices) UpdateStatus(ctx context.Context, aPIService *v1beta1.APIS } // Delete takes name of the aPIService and deletes it. Returns an error if one occurs. -func (c *aPIServices) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *aPIServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("apiservices"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *aPIServices) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *aPIServices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("apiservices"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/fake/fake_apiservice.go b/staging/src/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/fake/fake_apiservice.go index 36b59e11aa7..dbc3037cdaa 100644 --- a/staging/src/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/fake/fake_apiservice.go +++ b/staging/src/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/fake/fake_apiservice.go @@ -108,15 +108,15 @@ func (c *FakeAPIServices) UpdateStatus(ctx context.Context, aPIService *v1beta1. } // Delete takes name of the aPIService and deletes it. Returns an error if one occurs. -func (c *FakeAPIServices) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeAPIServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(apiservicesResource, name), &v1beta1.APIService{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeAPIServices) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(apiservicesResource, listOptions) +func (c *FakeAPIServices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(apiservicesResource, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.APIServiceList{}) return err diff --git a/staging/src/k8s.io/kube-aggregator/pkg/controllers/autoregister/autoregister_controller.go b/staging/src/k8s.io/kube-aggregator/pkg/controllers/autoregister/autoregister_controller.go index a72a4f0b2ff..48dcd209c64 100644 --- a/staging/src/k8s.io/kube-aggregator/pkg/controllers/autoregister/autoregister_controller.go +++ b/staging/src/k8s.io/kube-aggregator/pkg/controllers/autoregister/autoregister_controller.go @@ -262,7 +262,7 @@ func (c *autoRegisterController) checkAPIService(name string) (err error) { // we have a spurious APIService that we're managing, delete it (5A,6A) case desired == nil: - opts := &metav1.DeleteOptions{Preconditions: metav1.NewUIDPreconditions(string(curr.UID))} + opts := metav1.DeleteOptions{Preconditions: metav1.NewUIDPreconditions(string(curr.UID))} err := c.apiServiceClient.APIServices().Delete(context.TODO(), curr.Name, opts) if apierrors.IsNotFound(err) || apierrors.IsConflict(err) { // deleted or changed in the meantime, we'll get called again diff --git a/staging/src/k8s.io/kubectl/pkg/drain/drain.go b/staging/src/k8s.io/kubectl/pkg/drain/drain.go index 1d3819f5765..225c0fcedac 100644 --- a/staging/src/k8s.io/kubectl/pkg/drain/drain.go +++ b/staging/src/k8s.io/kubectl/pkg/drain/drain.go @@ -121,8 +121,8 @@ func CheckEvictionSupport(clientset kubernetes.Interface) (string, error) { return "", nil } -func (d *Helper) makeDeleteOptions() *metav1.DeleteOptions { - deleteOptions := &metav1.DeleteOptions{} +func (d *Helper) makeDeleteOptions() metav1.DeleteOptions { + deleteOptions := metav1.DeleteOptions{} if d.GracePeriodSeconds >= 0 { gracePeriodSeconds := int64(d.GracePeriodSeconds) deleteOptions.GracePeriodSeconds = &gracePeriodSeconds @@ -150,6 +150,8 @@ func (d *Helper) EvictPod(pod corev1.Pod, policyGroupVersion string) error { return err } } + + delOpts := d.makeDeleteOptions() eviction := &policyv1beta1.Eviction{ TypeMeta: metav1.TypeMeta{ APIVersion: policyGroupVersion, @@ -159,8 +161,9 @@ func (d *Helper) EvictPod(pod corev1.Pod, policyGroupVersion string) error { Name: pod.Name, Namespace: pod.Namespace, }, - DeleteOptions: d.makeDeleteOptions(), + DeleteOptions: &delOpts, } + // Remember to change change the URL manipulation func when Eviction's version change return d.Client.PolicyV1beta1().Evictions(eviction.Namespace).Evict(eviction) } diff --git a/staging/src/k8s.io/kubectl/pkg/drain/drain_test.go b/staging/src/k8s.io/kubectl/pkg/drain/drain_test.go index b8795d421ee..ce0c0b63ea5 100644 --- a/staging/src/k8s.io/kubectl/pkg/drain/drain_test.go +++ b/staging/src/k8s.io/kubectl/pkg/drain/drain_test.go @@ -241,7 +241,7 @@ func addEvictionSupport(t *testing.T, k *fake.Clientset) { eviction := *action.(ktest.CreateAction).GetObject().(*policyv1beta1.Eviction) // Avoid the lock go func() { - err := k.CoreV1().Pods(eviction.Namespace).Delete(context.TODO(), eviction.Name, &metav1.DeleteOptions{}) + err := k.CoreV1().Pods(eviction.Namespace).Delete(context.TODO(), eviction.Name, metav1.DeleteOptions{}) if err != nil { // Errorf because we can't call Fatalf from another goroutine t.Errorf("failed to delete pod: %s/%s", eviction.Namespace, eviction.Name) diff --git a/staging/src/k8s.io/sample-apiserver/pkg/generated/clientset/versioned/typed/wardle/v1alpha1/fake/fake_fischer.go b/staging/src/k8s.io/sample-apiserver/pkg/generated/clientset/versioned/typed/wardle/v1alpha1/fake/fake_fischer.go index 9e2d2ad36ca..ef956b5af17 100644 --- a/staging/src/k8s.io/sample-apiserver/pkg/generated/clientset/versioned/typed/wardle/v1alpha1/fake/fake_fischer.go +++ b/staging/src/k8s.io/sample-apiserver/pkg/generated/clientset/versioned/typed/wardle/v1alpha1/fake/fake_fischer.go @@ -97,15 +97,15 @@ func (c *FakeFischers) Update(ctx context.Context, fischer *v1alpha1.Fischer, op } // Delete takes name of the fischer and deletes it. Returns an error if one occurs. -func (c *FakeFischers) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeFischers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(fischersResource, name), &v1alpha1.Fischer{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeFischers) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(fischersResource, listOptions) +func (c *FakeFischers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(fischersResource, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.FischerList{}) return err diff --git a/staging/src/k8s.io/sample-apiserver/pkg/generated/clientset/versioned/typed/wardle/v1alpha1/fake/fake_flunder.go b/staging/src/k8s.io/sample-apiserver/pkg/generated/clientset/versioned/typed/wardle/v1alpha1/fake/fake_flunder.go index d1b76d43716..2ea793eb696 100644 --- a/staging/src/k8s.io/sample-apiserver/pkg/generated/clientset/versioned/typed/wardle/v1alpha1/fake/fake_flunder.go +++ b/staging/src/k8s.io/sample-apiserver/pkg/generated/clientset/versioned/typed/wardle/v1alpha1/fake/fake_flunder.go @@ -115,7 +115,7 @@ func (c *FakeFlunders) UpdateStatus(ctx context.Context, flunder *v1alpha1.Flund } // Delete takes name of the flunder and deletes it. Returns an error if one occurs. -func (c *FakeFlunders) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeFlunders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(flundersResource, c.ns, name), &v1alpha1.Flunder{}) @@ -123,8 +123,8 @@ func (c *FakeFlunders) Delete(ctx context.Context, name string, options *v1.Dele } // DeleteCollection deletes a collection of objects. -func (c *FakeFlunders) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(flundersResource, c.ns, listOptions) +func (c *FakeFlunders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(flundersResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.FlunderList{}) return err diff --git a/staging/src/k8s.io/sample-apiserver/pkg/generated/clientset/versioned/typed/wardle/v1alpha1/fischer.go b/staging/src/k8s.io/sample-apiserver/pkg/generated/clientset/versioned/typed/wardle/v1alpha1/fischer.go index 51ab0e9c152..d2d9df76c65 100644 --- a/staging/src/k8s.io/sample-apiserver/pkg/generated/clientset/versioned/typed/wardle/v1alpha1/fischer.go +++ b/staging/src/k8s.io/sample-apiserver/pkg/generated/clientset/versioned/typed/wardle/v1alpha1/fischer.go @@ -40,8 +40,8 @@ type FischersGetter interface { type FischerInterface interface { Create(ctx context.Context, fischer *v1alpha1.Fischer, opts v1.CreateOptions) (*v1alpha1.Fischer, error) Update(ctx context.Context, fischer *v1alpha1.Fischer, opts v1.UpdateOptions) (*v1alpha1.Fischer, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Fischer, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.FischerList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -129,26 +129,26 @@ func (c *fischers) Update(ctx context.Context, fischer *v1alpha1.Fischer, opts v } // Delete takes name of the fischer and deletes it. Returns an error if one occurs. -func (c *fischers) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *fischers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("fischers"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *fischers) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *fischers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("fischers"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/sample-apiserver/pkg/generated/clientset/versioned/typed/wardle/v1alpha1/flunder.go b/staging/src/k8s.io/sample-apiserver/pkg/generated/clientset/versioned/typed/wardle/v1alpha1/flunder.go index ae8dffeb62c..30b1f5c297c 100644 --- a/staging/src/k8s.io/sample-apiserver/pkg/generated/clientset/versioned/typed/wardle/v1alpha1/flunder.go +++ b/staging/src/k8s.io/sample-apiserver/pkg/generated/clientset/versioned/typed/wardle/v1alpha1/flunder.go @@ -41,8 +41,8 @@ type FlunderInterface interface { Create(ctx context.Context, flunder *v1alpha1.Flunder, opts v1.CreateOptions) (*v1alpha1.Flunder, error) Update(ctx context.Context, flunder *v1alpha1.Flunder, opts v1.UpdateOptions) (*v1alpha1.Flunder, error) UpdateStatus(ctx context.Context, flunder *v1alpha1.Flunder, opts v1.UpdateOptions) (*v1alpha1.Flunder, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Flunder, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.FlunderList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *flunders) UpdateStatus(ctx context.Context, flunder *v1alpha1.Flunder, } // Delete takes name of the flunder and deletes it. Returns an error if one occurs. -func (c *flunders) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *flunders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("flunders"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *flunders) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *flunders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("flunders"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/sample-apiserver/pkg/generated/clientset/versioned/typed/wardle/v1beta1/fake/fake_flunder.go b/staging/src/k8s.io/sample-apiserver/pkg/generated/clientset/versioned/typed/wardle/v1beta1/fake/fake_flunder.go index 5039134bd8f..5302630febe 100644 --- a/staging/src/k8s.io/sample-apiserver/pkg/generated/clientset/versioned/typed/wardle/v1beta1/fake/fake_flunder.go +++ b/staging/src/k8s.io/sample-apiserver/pkg/generated/clientset/versioned/typed/wardle/v1beta1/fake/fake_flunder.go @@ -115,7 +115,7 @@ func (c *FakeFlunders) UpdateStatus(ctx context.Context, flunder *v1beta1.Flunde } // Delete takes name of the flunder and deletes it. Returns an error if one occurs. -func (c *FakeFlunders) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeFlunders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(flundersResource, c.ns, name), &v1beta1.Flunder{}) @@ -123,8 +123,8 @@ func (c *FakeFlunders) Delete(ctx context.Context, name string, options *v1.Dele } // DeleteCollection deletes a collection of objects. -func (c *FakeFlunders) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(flundersResource, c.ns, listOptions) +func (c *FakeFlunders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(flundersResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.FlunderList{}) return err diff --git a/staging/src/k8s.io/sample-apiserver/pkg/generated/clientset/versioned/typed/wardle/v1beta1/flunder.go b/staging/src/k8s.io/sample-apiserver/pkg/generated/clientset/versioned/typed/wardle/v1beta1/flunder.go index 61900687e7d..9afcb3a17d5 100644 --- a/staging/src/k8s.io/sample-apiserver/pkg/generated/clientset/versioned/typed/wardle/v1beta1/flunder.go +++ b/staging/src/k8s.io/sample-apiserver/pkg/generated/clientset/versioned/typed/wardle/v1beta1/flunder.go @@ -41,8 +41,8 @@ type FlunderInterface interface { Create(ctx context.Context, flunder *v1beta1.Flunder, opts v1.CreateOptions) (*v1beta1.Flunder, error) Update(ctx context.Context, flunder *v1beta1.Flunder, opts v1.UpdateOptions) (*v1beta1.Flunder, error) UpdateStatus(ctx context.Context, flunder *v1beta1.Flunder, opts v1.UpdateOptions) (*v1beta1.Flunder, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Flunder, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.FlunderList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *flunders) UpdateStatus(ctx context.Context, flunder *v1beta1.Flunder, o } // Delete takes name of the flunder and deletes it. Returns an error if one occurs. -func (c *flunders) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *flunders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("flunders"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *flunders) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *flunders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("flunders"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/staging/src/k8s.io/sample-controller/pkg/generated/clientset/versioned/typed/samplecontroller/v1alpha1/fake/fake_foo.go b/staging/src/k8s.io/sample-controller/pkg/generated/clientset/versioned/typed/samplecontroller/v1alpha1/fake/fake_foo.go index e1434da222c..adddb140126 100644 --- a/staging/src/k8s.io/sample-controller/pkg/generated/clientset/versioned/typed/samplecontroller/v1alpha1/fake/fake_foo.go +++ b/staging/src/k8s.io/sample-controller/pkg/generated/clientset/versioned/typed/samplecontroller/v1alpha1/fake/fake_foo.go @@ -115,7 +115,7 @@ func (c *FakeFoos) UpdateStatus(ctx context.Context, foo *v1alpha1.Foo, opts v1. } // Delete takes name of the foo and deletes it. Returns an error if one occurs. -func (c *FakeFoos) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *FakeFoos) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(foosResource, c.ns, name), &v1alpha1.Foo{}) @@ -123,8 +123,8 @@ func (c *FakeFoos) Delete(ctx context.Context, name string, options *v1.DeleteOp } // DeleteCollection deletes a collection of objects. -func (c *FakeFoos) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(foosResource, c.ns, listOptions) +func (c *FakeFoos) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(foosResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.FooList{}) return err diff --git a/staging/src/k8s.io/sample-controller/pkg/generated/clientset/versioned/typed/samplecontroller/v1alpha1/foo.go b/staging/src/k8s.io/sample-controller/pkg/generated/clientset/versioned/typed/samplecontroller/v1alpha1/foo.go index bf0eae3a006..ab190b2fa73 100644 --- a/staging/src/k8s.io/sample-controller/pkg/generated/clientset/versioned/typed/samplecontroller/v1alpha1/foo.go +++ b/staging/src/k8s.io/sample-controller/pkg/generated/clientset/versioned/typed/samplecontroller/v1alpha1/foo.go @@ -41,8 +41,8 @@ type FooInterface interface { Create(ctx context.Context, foo *v1alpha1.Foo, opts v1.CreateOptions) (*v1alpha1.Foo, error) Update(ctx context.Context, foo *v1alpha1.Foo, opts v1.UpdateOptions) (*v1alpha1.Foo, error) UpdateStatus(ctx context.Context, foo *v1alpha1.Foo, opts v1.UpdateOptions) (*v1alpha1.Foo, error) - Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Foo, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.FooList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) @@ -153,28 +153,28 @@ func (c *foos) UpdateStatus(ctx context.Context, foo *v1alpha1.Foo, opts v1.Upda } // Delete takes name of the foo and deletes it. Returns an error if one occurs. -func (c *foos) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error { +func (c *foos) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("foos"). Name(name). - Body(options). + Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *foos) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *foos) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("foos"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). + Body(&opts). Do(ctx). Error() } diff --git a/test/e2e/apimachinery/aggregator.go b/test/e2e/apimachinery/aggregator.go index 635517d2a6f..c7c6b27d43f 100644 --- a/test/e2e/apimachinery/aggregator.go +++ b/test/e2e/apimachinery/aggregator.go @@ -102,16 +102,16 @@ var _ = SIGDescribe("Aggregator", func() { func cleanTest(client clientset.Interface, aggrclient *aggregatorclient.Clientset, namespace string) { // delete the APIService first to avoid causing discovery errors - _ = aggrclient.ApiregistrationV1().APIServices().Delete(context.TODO(), "v1alpha1.wardle.example.com", nil) + _ = aggrclient.ApiregistrationV1().APIServices().Delete(context.TODO(), "v1alpha1.wardle.example.com", metav1.DeleteOptions{}) - _ = client.AppsV1().Deployments(namespace).Delete(context.TODO(), "sample-apiserver-deployment", nil) - _ = client.CoreV1().Secrets(namespace).Delete(context.TODO(), "sample-apiserver-secret", nil) - _ = client.CoreV1().Services(namespace).Delete(context.TODO(), "sample-api", nil) - _ = client.CoreV1().ServiceAccounts(namespace).Delete(context.TODO(), "sample-apiserver", nil) - _ = client.RbacV1().RoleBindings("kube-system").Delete(context.TODO(), "wardler-auth-reader", nil) - _ = client.RbacV1().ClusterRoleBindings().Delete(context.TODO(), "wardler:"+namespace+":auth-delegator", nil) - _ = client.RbacV1().ClusterRoles().Delete(context.TODO(), "sample-apiserver-reader", nil) - _ = client.RbacV1().ClusterRoleBindings().Delete(context.TODO(), "wardler:"+namespace+":sample-apiserver-reader", nil) + _ = client.AppsV1().Deployments(namespace).Delete(context.TODO(), "sample-apiserver-deployment", metav1.DeleteOptions{}) + _ = client.CoreV1().Secrets(namespace).Delete(context.TODO(), "sample-apiserver-secret", metav1.DeleteOptions{}) + _ = client.CoreV1().Services(namespace).Delete(context.TODO(), "sample-api", metav1.DeleteOptions{}) + _ = client.CoreV1().ServiceAccounts(namespace).Delete(context.TODO(), "sample-apiserver", metav1.DeleteOptions{}) + _ = client.RbacV1().RoleBindings("kube-system").Delete(context.TODO(), "wardler-auth-reader", metav1.DeleteOptions{}) + _ = client.RbacV1().ClusterRoleBindings().Delete(context.TODO(), "wardler:"+namespace+":auth-delegator", metav1.DeleteOptions{}) + _ = client.RbacV1().ClusterRoles().Delete(context.TODO(), "sample-apiserver-reader", metav1.DeleteOptions{}) + _ = client.RbacV1().ClusterRoleBindings().Delete(context.TODO(), "wardler:"+namespace+":sample-apiserver-reader", metav1.DeleteOptions{}) } // TestSampleAPIServer is a basic test if the sample-apiserver code from 1.10 and compiled against 1.10 diff --git a/test/e2e/apimachinery/crd_conversion_webhook.go b/test/e2e/apimachinery/crd_conversion_webhook.go index 01fcd3f999f..e6acbe27d43 100644 --- a/test/e2e/apimachinery/crd_conversion_webhook.go +++ b/test/e2e/apimachinery/crd_conversion_webhook.go @@ -209,10 +209,10 @@ var _ = SIGDescribe("CustomResourceConversionWebhook [Privileged:ClusterAdmin]", }) func cleanCRDWebhookTest(client clientset.Interface, namespaceName string) { - _ = client.CoreV1().Services(namespaceName).Delete(context.TODO(), serviceCRDName, nil) - _ = client.AppsV1().Deployments(namespaceName).Delete(context.TODO(), deploymentCRDName, nil) - _ = client.CoreV1().Secrets(namespaceName).Delete(context.TODO(), secretCRDName, nil) - _ = client.RbacV1().RoleBindings("kube-system").Delete(context.TODO(), roleBindingCRDName, nil) + _ = client.CoreV1().Services(namespaceName).Delete(context.TODO(), serviceCRDName, metav1.DeleteOptions{}) + _ = client.AppsV1().Deployments(namespaceName).Delete(context.TODO(), deploymentCRDName, metav1.DeleteOptions{}) + _ = client.CoreV1().Secrets(namespaceName).Delete(context.TODO(), secretCRDName, metav1.DeleteOptions{}) + _ = client.RbacV1().RoleBindings("kube-system").Delete(context.TODO(), roleBindingCRDName, metav1.DeleteOptions{}) } func createAuthReaderRoleBindingForCRDConversion(f *framework.Framework, namespace string) { diff --git a/test/e2e/apimachinery/etcd_failure.go b/test/e2e/apimachinery/etcd_failure.go index 5d2875038dc..c53e38db19f 100644 --- a/test/e2e/apimachinery/etcd_failure.go +++ b/test/e2e/apimachinery/etcd_failure.go @@ -125,7 +125,7 @@ func checkExistingRCRecovers(f *framework.Framework) { return false, nil } for _, pod := range pods.Items { - err = podClient.Delete(context.TODO(), pod.Name, metav1.NewDeleteOptions(0)) + err = podClient.Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err, "failed to delete pod %s in namespace: %s", pod.Name, f.Namespace.Name) } framework.Logf("apiserver has recovered") diff --git a/test/e2e/apimachinery/garbage_collector.go b/test/e2e/apimachinery/garbage_collector.go index edc25da2e17..7c7ffbee063 100644 --- a/test/e2e/apimachinery/garbage_collector.go +++ b/test/e2e/apimachinery/garbage_collector.go @@ -79,19 +79,19 @@ func estimateMaximumPods(c clientset.Interface, min, max int32) int32 { return availablePods } -func getForegroundOptions() *metav1.DeleteOptions { +func getForegroundOptions() metav1.DeleteOptions { policy := metav1.DeletePropagationForeground - return &metav1.DeleteOptions{PropagationPolicy: &policy} + return metav1.DeleteOptions{PropagationPolicy: &policy} } -func getBackgroundOptions() *metav1.DeleteOptions { +func getBackgroundOptions() metav1.DeleteOptions { policy := metav1.DeletePropagationBackground - return &metav1.DeleteOptions{PropagationPolicy: &policy} + return metav1.DeleteOptions{PropagationPolicy: &policy} } -func getOrphanOptions() *metav1.DeleteOptions { +func getOrphanOptions() metav1.DeleteOptions { policy := metav1.DeletePropagationOrphan - return &metav1.DeleteOptions{PropagationPolicy: &policy} + return metav1.DeleteOptions{PropagationPolicy: &policy} } var ( @@ -473,8 +473,9 @@ var _ = SIGDescribe("Garbage collector", func() { framework.Failf("failed to wait for the rc.Status.Replicas to reach rc.Spec.Replicas: %v", err) } ginkgo.By("delete the rc") - deleteOptions := &metav1.DeleteOptions{} - deleteOptions.Preconditions = metav1.NewUIDPreconditions(string(rc.UID)) + deleteOptions := metav1.DeleteOptions{ + Preconditions: metav1.NewUIDPreconditions(string(rc.UID)), + } if err := rcClient.Delete(context.TODO(), rc.ObjectMeta.Name, deleteOptions); err != nil { framework.Failf("failed to delete the rc: %v", err) } @@ -1101,7 +1102,8 @@ var _ = SIGDescribe("Garbage collector", func() { framework.Logf("created dependent resource %q", dependentName) // Delete the owner and orphan the dependent. - err = resourceClient.Delete(ownerName, getOrphanOptions()) + delOpts := getOrphanOptions() + err = resourceClient.Delete(ownerName, &delOpts) if err != nil { framework.Failf("failed to delete owner resource %q: %v", ownerName, err) } diff --git a/test/e2e/apimachinery/generated_clientset.go b/test/e2e/apimachinery/generated_clientset.go index 3e1d4b69b76..be0d4a4d2a0 100644 --- a/test/e2e/apimachinery/generated_clientset.go +++ b/test/e2e/apimachinery/generated_clientset.go @@ -151,7 +151,7 @@ var _ = SIGDescribe("Generated clientset", func() { ginkgo.By("deleting the pod gracefully") gracePeriod := int64(31) - if err := podClient.Delete(context.TODO(), pod.Name, metav1.NewDeleteOptions(gracePeriod)); err != nil { + if err := podClient.Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(gracePeriod)); err != nil { framework.Failf("Failed to delete pod: %v", err) } @@ -264,7 +264,7 @@ var _ = SIGDescribe("Generated clientset", func() { ginkgo.By("deleting the cronJob") // Use DeletePropagationBackground so the CronJob is really gone when the call returns. propagationPolicy := metav1.DeletePropagationBackground - if err := cronJobClient.Delete(context.TODO(), cronJob.Name, &metav1.DeleteOptions{PropagationPolicy: &propagationPolicy}); err != nil { + if err := cronJobClient.Delete(context.TODO(), cronJob.Name, metav1.DeleteOptions{PropagationPolicy: &propagationPolicy}); err != nil { framework.Failf("Failed to delete cronJob: %v", err) } diff --git a/test/e2e/apimachinery/namespace.go b/test/e2e/apimachinery/namespace.go index 180eb873b07..2289533eb64 100644 --- a/test/e2e/apimachinery/namespace.go +++ b/test/e2e/apimachinery/namespace.go @@ -117,7 +117,7 @@ func ensurePodsAreRemovedWhenNamespaceIsDeleted(f *framework.Framework) { framework.ExpectNoError(e2epod.WaitForPodRunningInNamespace(f.ClientSet, pod)) ginkgo.By("Deleting the namespace") - err = f.ClientSet.CoreV1().Namespaces().Delete(context.TODO(), namespace.Name, nil) + err = f.ClientSet.CoreV1().Namespaces().Delete(context.TODO(), namespace.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete namespace: %s", namespace.Name) ginkgo.By("Waiting for the namespace to be removed.") @@ -174,7 +174,7 @@ func ensureServicesAreRemovedWhenNamespaceIsDeleted(f *framework.Framework) { framework.ExpectNoError(err, "failed to create service %s in namespace %s", serviceName, namespace.Name) ginkgo.By("Deleting the namespace") - err = f.ClientSet.CoreV1().Namespaces().Delete(context.TODO(), namespace.Name, nil) + err = f.ClientSet.CoreV1().Namespaces().Delete(context.TODO(), namespace.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete namespace: %s", namespace.Name) ginkgo.By("Waiting for the namespace to be removed.") diff --git a/test/e2e/apimachinery/resource_quota.go b/test/e2e/apimachinery/resource_quota.go index a5d0e4cb964..b4826f3e017 100644 --- a/test/e2e/apimachinery/resource_quota.go +++ b/test/e2e/apimachinery/resource_quota.go @@ -112,7 +112,7 @@ var _ = SIGDescribe("ResourceQuota", func() { framework.ExpectNoError(err) ginkgo.By("Deleting a Service") - err = f.ClientSet.CoreV1().Services(f.Namespace.Name).Delete(context.TODO(), service.Name, nil) + err = f.ClientSet.CoreV1().Services(f.Namespace.Name).Delete(context.TODO(), service.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err) ginkgo.By("Ensuring resource quota status released usage") @@ -180,7 +180,7 @@ var _ = SIGDescribe("ResourceQuota", func() { framework.ExpectNoError(err) ginkgo.By("Deleting a secret") - err = f.ClientSet.CoreV1().Secrets(f.Namespace.Name).Delete(context.TODO(), secret.Name, nil) + err = f.ClientSet.CoreV1().Secrets(f.Namespace.Name).Delete(context.TODO(), secret.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err) ginkgo.By("Ensuring resource quota status released usage") @@ -274,7 +274,7 @@ var _ = SIGDescribe("ResourceQuota", func() { framework.ExpectNoError(err) ginkgo.By("Deleting the pod") - err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), podName, metav1.NewDeleteOptions(0)) + err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), podName, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err) ginkgo.By("Ensuring resource quota status released the pod usage") @@ -346,7 +346,7 @@ var _ = SIGDescribe("ResourceQuota", func() { framework.ExpectNoError(err) ginkgo.By("Deleting a ConfigMap") - err = f.ClientSet.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), configMap.Name, nil) + err = f.ClientSet.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), configMap.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err) ginkgo.By("Ensuring resource quota status released usage") @@ -397,7 +397,7 @@ var _ = SIGDescribe("ResourceQuota", func() { // detached. ReplicationControllers default to "orphan", which // is different from most resources. (Why? To preserve a common // workflow from prior to the GC's introduction.) - err = f.ClientSet.CoreV1().ReplicationControllers(f.Namespace.Name).Delete(context.TODO(), replicationController.Name, &metav1.DeleteOptions{ + err = f.ClientSet.CoreV1().ReplicationControllers(f.Namespace.Name).Delete(context.TODO(), replicationController.Name, metav1.DeleteOptions{ PropagationPolicy: func() *metav1.DeletionPropagation { p := metav1.DeletePropagationBackground return &p @@ -448,7 +448,7 @@ var _ = SIGDescribe("ResourceQuota", func() { framework.ExpectNoError(err) ginkgo.By("Deleting a ReplicaSet") - err = f.ClientSet.AppsV1().ReplicaSets(f.Namespace.Name).Delete(context.TODO(), replicaSet.Name, nil) + err = f.ClientSet.AppsV1().ReplicaSets(f.Namespace.Name).Delete(context.TODO(), replicaSet.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err) ginkgo.By("Ensuring resource quota status released usage") @@ -497,7 +497,7 @@ var _ = SIGDescribe("ResourceQuota", func() { framework.ExpectNoError(err) ginkgo.By("Deleting a PersistentVolumeClaim") - err = f.ClientSet.CoreV1().PersistentVolumeClaims(f.Namespace.Name).Delete(context.TODO(), pvc.Name, nil) + err = f.ClientSet.CoreV1().PersistentVolumeClaims(f.Namespace.Name).Delete(context.TODO(), pvc.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err) ginkgo.By("Ensuring resource quota status released usage") @@ -554,7 +554,7 @@ var _ = SIGDescribe("ResourceQuota", func() { framework.ExpectNoError(err) ginkgo.By("Deleting a PersistentVolumeClaim") - err = f.ClientSet.CoreV1().PersistentVolumeClaims(f.Namespace.Name).Delete(context.TODO(), pvc.Name, nil) + err = f.ClientSet.CoreV1().PersistentVolumeClaims(f.Namespace.Name).Delete(context.TODO(), pvc.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err) ginkgo.By("Ensuring resource quota status released usage") @@ -588,7 +588,7 @@ var _ = SIGDescribe("ResourceQuota", func() { framework.ExpectNoError(err) err = updateResourceQuotaUntilUsageAppears(f.ClientSet, f.Namespace.Name, quotaName, v1.ResourceName(countResourceName)) framework.ExpectNoError(err) - err = f.ClientSet.CoreV1().ResourceQuotas(f.Namespace.Name).Delete(context.TODO(), quotaName, nil) + err = f.ClientSet.CoreV1().ResourceQuotas(f.Namespace.Name).Delete(context.TODO(), quotaName, metav1.DeleteOptions{}) framework.ExpectNoError(err) ginkgo.By("Counting existing ResourceQuota") @@ -712,7 +712,7 @@ var _ = SIGDescribe("ResourceQuota", func() { framework.ExpectNoError(err) ginkgo.By("Deleting the pod") - err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), podName, metav1.NewDeleteOptions(0)) + err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), podName, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err) ginkgo.By("Ensuring resource quota status released the pod usage") @@ -751,7 +751,7 @@ var _ = SIGDescribe("ResourceQuota", func() { framework.ExpectNoError(err) ginkgo.By("Deleting the pod") - err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), podName, metav1.NewDeleteOptions(0)) + err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), podName, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err) ginkgo.By("Ensuring resource quota status released the pod usage") @@ -808,7 +808,7 @@ var _ = SIGDescribe("ResourceQuota", func() { framework.ExpectNoError(err) ginkgo.By("Deleting the pod") - err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod.Name, metav1.NewDeleteOptions(0)) + err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err) ginkgo.By("Ensuring resource quota status released the pod usage") @@ -838,7 +838,7 @@ var _ = SIGDescribe("ResourceQuota", func() { framework.ExpectNoError(err) ginkgo.By("Deleting the pod") - err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod.Name, metav1.NewDeleteOptions(0)) + err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err) ginkgo.By("Ensuring resource quota status released the pod usage") @@ -938,7 +938,7 @@ var _ = SIGDescribe("ResourceQuota [Feature:ScopeSelectors]", func() { framework.ExpectNoError(err) ginkgo.By("Deleting the pod") - err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod.Name, metav1.NewDeleteOptions(0)) + err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err) ginkgo.By("Ensuring resource quota status released the pod usage") @@ -968,7 +968,7 @@ var _ = SIGDescribe("ResourceQuota [Feature:ScopeSelectors]", func() { framework.ExpectNoError(err) ginkgo.By("Deleting the pod") - err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod.Name, metav1.NewDeleteOptions(0)) + err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err) ginkgo.By("Ensuring resource quota status released the pod usage") @@ -1028,7 +1028,7 @@ var _ = SIGDescribe("ResourceQuota [Feature:ScopeSelectors]", func() { framework.ExpectNoError(err) ginkgo.By("Deleting the pod") - err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), podName, metav1.NewDeleteOptions(0)) + err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), podName, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err) ginkgo.By("Ensuring resource quota status released the pod usage") @@ -1067,7 +1067,7 @@ var _ = SIGDescribe("ResourceQuota [Feature:ScopeSelectors]", func() { framework.ExpectNoError(err) ginkgo.By("Deleting the pod") - err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), podName, metav1.NewDeleteOptions(0)) + err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), podName, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err) ginkgo.By("Ensuring resource quota status released the pod usage") @@ -1114,7 +1114,7 @@ var _ = SIGDescribe("ResourceQuota [Feature:PodPriority]", func() { framework.ExpectNoError(err) ginkgo.By("Deleting the pod") - err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod.Name, metav1.NewDeleteOptions(0)) + err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err) ginkgo.By("Ensuring resource quota status released the pod usage") @@ -1159,7 +1159,7 @@ var _ = SIGDescribe("ResourceQuota [Feature:PodPriority]", func() { framework.ExpectError(err) ginkgo.By("Deleting first pod") - err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod.Name, metav1.NewDeleteOptions(0)) + err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err) ginkgo.By("Ensuring resource quota status released the pod usage") @@ -1209,9 +1209,9 @@ var _ = SIGDescribe("ResourceQuota [Feature:PodPriority]", func() { framework.ExpectNoError(err) ginkgo.By("Deleting both pods") - err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod.Name, metav1.NewDeleteOptions(0)) + err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err) - err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod2.Name, metav1.NewDeleteOptions(0)) + err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod2.Name, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err) }) @@ -1258,9 +1258,9 @@ var _ = SIGDescribe("ResourceQuota [Feature:PodPriority]", func() { framework.ExpectNoError(err) ginkgo.By("Deleting both pods") - err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod.Name, metav1.NewDeleteOptions(0)) + err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err) - err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod2.Name, metav1.NewDeleteOptions(0)) + err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod2.Name, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err) ginkgo.By("Ensuring resource quota status released the pod usage") @@ -1299,7 +1299,7 @@ var _ = SIGDescribe("ResourceQuota [Feature:PodPriority]", func() { framework.ExpectNoError(err) ginkgo.By("Deleting the pod") - err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod.Name, metav1.NewDeleteOptions(0)) + err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err) }) @@ -1333,7 +1333,7 @@ var _ = SIGDescribe("ResourceQuota [Feature:PodPriority]", func() { framework.ExpectNoError(err) ginkgo.By("Deleting the pod") - err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod.Name, metav1.NewDeleteOptions(0)) + err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err) ginkgo.By("Ensuring resource quota status released the pod usage") @@ -1391,7 +1391,7 @@ var _ = SIGDescribe("ResourceQuota [Feature:PodPriority]", func() { framework.ExpectNoError(err) ginkgo.By("Deleting the pod") - err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod.Name, metav1.NewDeleteOptions(0)) + err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err) ginkgo.By("Ensuring resource quota status released the pod usage") @@ -1662,7 +1662,7 @@ func createResourceQuota(c clientset.Interface, namespace string, resourceQuota // deleteResourceQuota with the specified name func deleteResourceQuota(c clientset.Interface, namespace, name string) error { - return c.CoreV1().ResourceQuotas(namespace).Delete(context.TODO(), name, nil) + return c.CoreV1().ResourceQuotas(namespace).Delete(context.TODO(), name, metav1.DeleteOptions{}) } // countResourceQuota counts the number of ResourceQuota in the specified namespace diff --git a/test/e2e/apimachinery/watch.go b/test/e2e/apimachinery/watch.go index 569347324ea..c75f4babd45 100644 --- a/test/e2e/apimachinery/watch.go +++ b/test/e2e/apimachinery/watch.go @@ -110,7 +110,7 @@ var _ = SIGDescribe("Watchers", func() { expectNoEvent(watchB, watch.Modified, testConfigMapA) ginkgo.By("deleting configmap A and ensuring the correct watchers observe the notification") - err = c.CoreV1().ConfigMaps(ns).Delete(context.TODO(), testConfigMapA.GetName(), nil) + err = c.CoreV1().ConfigMaps(ns).Delete(context.TODO(), testConfigMapA.GetName(), metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete configmap %s in namespace: %s", testConfigMapA.GetName(), ns) expectEvent(watchA, watch.Deleted, nil) expectEvent(watchAB, watch.Deleted, nil) @@ -124,7 +124,7 @@ var _ = SIGDescribe("Watchers", func() { expectNoEvent(watchA, watch.Added, testConfigMapB) ginkgo.By("deleting configmap B and ensuring the correct watchers observe the notification") - err = c.CoreV1().ConfigMaps(ns).Delete(context.TODO(), testConfigMapB.GetName(), nil) + err = c.CoreV1().ConfigMaps(ns).Delete(context.TODO(), testConfigMapB.GetName(), metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete configmap %s in namespace: %s", testConfigMapB.GetName(), ns) expectEvent(watchB, watch.Deleted, nil) expectEvent(watchAB, watch.Deleted, nil) @@ -166,7 +166,7 @@ var _ = SIGDescribe("Watchers", func() { framework.ExpectNoError(err, "failed to update configmap %s in namespace %s a second time", testConfigMap.GetName(), ns) ginkgo.By("deleting the configmap") - err = c.CoreV1().ConfigMaps(ns).Delete(context.TODO(), testConfigMap.GetName(), nil) + err = c.CoreV1().ConfigMaps(ns).Delete(context.TODO(), testConfigMap.GetName(), metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete configmap %s in namespace: %s", testConfigMap.GetName(), ns) ginkgo.By("creating a watch on configmaps from the resource version returned by the first update") @@ -235,7 +235,7 @@ var _ = SIGDescribe("Watchers", func() { framework.ExpectNoError(err, "failed to create a new watch on configmaps from the last resource version %s observed by the first watch", lastEventConfigMap.ObjectMeta.ResourceVersion) ginkgo.By("deleting the configmap") - err = c.CoreV1().ConfigMaps(ns).Delete(context.TODO(), testConfigMap.GetName(), nil) + err = c.CoreV1().ConfigMaps(ns).Delete(context.TODO(), testConfigMap.GetName(), metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete configmap %s in namespace: %s", configMapName, ns) ginkgo.By("Expecting to observe notifications for all changes to the configmap since the first watch closed") @@ -310,7 +310,7 @@ var _ = SIGDescribe("Watchers", func() { framework.ExpectNoError(err, "failed to update configmap %s in namespace %s a third time", configMapName, ns) ginkgo.By("deleting the configmap") - err = c.CoreV1().ConfigMaps(ns).Delete(context.TODO(), testConfigMap.GetName(), nil) + err = c.CoreV1().ConfigMaps(ns).Delete(context.TODO(), testConfigMap.GetName(), metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete configmap %s in namespace: %s", configMapName, ns) ginkgo.By("Expecting to observe an add notification for the watched object when the label value was restored") @@ -482,7 +482,7 @@ func produceConfigMapEvents(f *framework.Framework, stopc <-chan struct{}, minWa framework.ExpectNoError(err, "Failed to update configmap %s in namespace %s", cm.Name, ns) case deleteEvent: idx := rand.Intn(len(existing)) - err := c.CoreV1().ConfigMaps(ns).Delete(context.TODO(), name(existing[idx]), &metav1.DeleteOptions{}) + err := c.CoreV1().ConfigMaps(ns).Delete(context.TODO(), name(existing[idx]), metav1.DeleteOptions{}) framework.ExpectNoError(err, "Failed to delete configmap %s in namespace %s", name(existing[idx]), ns) existing = append(existing[:idx], existing[idx+1:]...) default: diff --git a/test/e2e/apimachinery/webhook.go b/test/e2e/apimachinery/webhook.go index 8dd47aa6652..4fe6ed8b057 100644 --- a/test/e2e/apimachinery/webhook.go +++ b/test/e2e/apimachinery/webhook.go @@ -423,7 +423,7 @@ var _ = SIGDescribe("AdmissionWebhook [Privileged:ClusterAdmin]", func() { }) framework.ExpectNoError(err, "Creating validating webhook configuration") defer func() { - err := client.AdmissionregistrationV1().ValidatingWebhookConfigurations().Delete(context.TODO(), hook.Name, nil) + err := client.AdmissionregistrationV1().ValidatingWebhookConfigurations().Delete(context.TODO(), hook.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "Deleting validating webhook configuration") }() @@ -436,7 +436,7 @@ var _ = SIGDescribe("AdmissionWebhook [Privileged:ClusterAdmin]", func() { cm := namedNonCompliantConfigMap(string(uuid.NewUUID()), f) _, err = client.CoreV1().ConfigMaps(f.Namespace.Name).Create(context.TODO(), cm, metav1.CreateOptions{}) if err == nil { - err = client.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), cm.Name, nil) + err = client.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), cm.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "Deleting successfully created configMap") return false, nil } @@ -466,7 +466,7 @@ var _ = SIGDescribe("AdmissionWebhook [Privileged:ClusterAdmin]", func() { } return false, nil } - err = client.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), cm.Name, nil) + err = client.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), cm.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "Deleting successfully created configMap") return true, nil }) @@ -483,7 +483,7 @@ var _ = SIGDescribe("AdmissionWebhook [Privileged:ClusterAdmin]", func() { cm := namedNonCompliantConfigMap(string(uuid.NewUUID()), f) _, err = client.CoreV1().ConfigMaps(f.Namespace.Name).Create(context.TODO(), cm, metav1.CreateOptions{}) if err == nil { - err = client.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), cm.Name, nil) + err = client.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), cm.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "Deleting successfully created configMap") return false, nil } @@ -518,7 +518,7 @@ var _ = SIGDescribe("AdmissionWebhook [Privileged:ClusterAdmin]", func() { }) framework.ExpectNoError(err, "Creating mutating webhook configuration") defer func() { - err := client.AdmissionregistrationV1().MutatingWebhookConfigurations().Delete(context.TODO(), hook.Name, nil) + err := client.AdmissionregistrationV1().MutatingWebhookConfigurations().Delete(context.TODO(), hook.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "Deleting mutating webhook configuration") }() @@ -540,7 +540,7 @@ var _ = SIGDescribe("AdmissionWebhook [Privileged:ClusterAdmin]", func() { if err != nil { return false, err } - err = client.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), cm.Name, nil) + err = client.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), cm.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "Deleting successfully created configMap") _, ok := created.Data["mutation-stage-1"] return !ok, nil @@ -560,7 +560,7 @@ var _ = SIGDescribe("AdmissionWebhook [Privileged:ClusterAdmin]", func() { if err != nil { return false, err } - err = client.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), cm.Name, nil) + err = client.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), cm.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "Deleting successfully created configMap") _, ok := created.Data["mutation-stage-1"] return ok, nil @@ -610,7 +610,7 @@ var _ = SIGDescribe("AdmissionWebhook [Privileged:ClusterAdmin]", func() { cm := namedNonCompliantConfigMap(string(uuid.NewUUID()), f) _, err = client.CoreV1().ConfigMaps(f.Namespace.Name).Create(context.TODO(), cm, metav1.CreateOptions{}) if err == nil { - err = client.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), cm.Name, nil) + err = client.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), cm.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "Deleting successfully created configMap") return false, nil } @@ -622,7 +622,7 @@ var _ = SIGDescribe("AdmissionWebhook [Privileged:ClusterAdmin]", func() { framework.ExpectNoError(err, "Waiting for configMap in namespace %s to be denied creation by validating webhook", f.Namespace.Name) ginkgo.By("Deleting the collection of validation webhooks") - err = client.AdmissionregistrationV1().ValidatingWebhookConfigurations().DeleteCollection(context.TODO(), nil, selectorListOpts) + err = client.AdmissionregistrationV1().ValidatingWebhookConfigurations().DeleteCollection(context.TODO(), metav1.DeleteOptions{}, selectorListOpts) framework.ExpectNoError(err, "Deleting collection of validating webhook configurations") ginkgo.By("Creating a configMap that does not comply to the validation webhook rules") @@ -635,7 +635,7 @@ var _ = SIGDescribe("AdmissionWebhook [Privileged:ClusterAdmin]", func() { } return false, nil } - err = client.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), cm.Name, nil) + err = client.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), cm.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "Deleting successfully created configMap") return true, nil }) @@ -686,7 +686,7 @@ var _ = SIGDescribe("AdmissionWebhook [Privileged:ClusterAdmin]", func() { if err != nil { return false, err } - err = client.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), cm.Name, nil) + err = client.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), cm.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "Deleting successfully created configMap") _, ok := created.Data["mutation-stage-1"] return ok, nil @@ -694,7 +694,7 @@ var _ = SIGDescribe("AdmissionWebhook [Privileged:ClusterAdmin]", func() { framework.ExpectNoError(err, "Waiting for configMap in namespace %s to be mutated", f.Namespace.Name) ginkgo.By("Deleting the collection of validation webhooks") - err = client.AdmissionregistrationV1().MutatingWebhookConfigurations().DeleteCollection(context.TODO(), nil, selectorListOpts) + err = client.AdmissionregistrationV1().MutatingWebhookConfigurations().DeleteCollection(context.TODO(), metav1.DeleteOptions{}, selectorListOpts) framework.ExpectNoError(err, "Deleting collection of mutating webhook configurations") ginkgo.By("Creating a configMap that should not be mutated") @@ -704,7 +704,7 @@ var _ = SIGDescribe("AdmissionWebhook [Privileged:ClusterAdmin]", func() { if err != nil { return false, err } - err = client.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), cm.Name, nil) + err = client.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), cm.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "Deleting successfully created configMap") _, ok := created.Data["mutation-stage-1"] return !ok, nil @@ -909,7 +909,7 @@ func registerWebhook(f *framework.Framework, configName string, certCtx *certCon framework.ExpectNoError(err, "waiting for webhook configuration to be ready") return func() { - client.AdmissionregistrationV1().ValidatingWebhookConfigurations().Delete(context.TODO(), configName, nil) + client.AdmissionregistrationV1().ValidatingWebhookConfigurations().Delete(context.TODO(), configName, metav1.DeleteOptions{}) } } @@ -961,7 +961,7 @@ func registerWebhookForAttachingPod(f *framework.Framework, configName string, c framework.ExpectNoError(err, "waiting for webhook configuration to be ready") return func() { - client.AdmissionregistrationV1().ValidatingWebhookConfigurations().Delete(context.TODO(), configName, nil) + client.AdmissionregistrationV1().ValidatingWebhookConfigurations().Delete(context.TODO(), configName, metav1.DeleteOptions{}) } } @@ -987,7 +987,7 @@ func registerMutatingWebhookForConfigMap(f *framework.Framework, configName stri err = waitWebhookConfigurationReady(f) framework.ExpectNoError(err, "waiting for webhook configuration to be ready") return func() { - client.AdmissionregistrationV1().MutatingWebhookConfigurations().Delete(context.TODO(), configName, nil) + client.AdmissionregistrationV1().MutatingWebhookConfigurations().Delete(context.TODO(), configName, metav1.DeleteOptions{}) } } @@ -1055,7 +1055,7 @@ func registerMutatingWebhookForPod(f *framework.Framework, configName string, ce framework.ExpectNoError(err, "waiting for webhook configuration to be ready") return func() { - client.AdmissionregistrationV1().MutatingWebhookConfigurations().Delete(context.TODO(), configName, nil) + client.AdmissionregistrationV1().MutatingWebhookConfigurations().Delete(context.TODO(), configName, metav1.DeleteOptions{}) } } @@ -1181,7 +1181,7 @@ func testWebhook(f *framework.Framework) { }}) framework.ExpectNoError(err, "creating namespace %q", skippedNamespaceName) // clean up the namespace - defer client.CoreV1().Namespaces().Delete(context.TODO(), skippedNamespaceName, nil) + defer client.CoreV1().Namespaces().Delete(context.TODO(), skippedNamespaceName, metav1.DeleteOptions{}) ginkgo.By("create a configmap that violates the webhook policy but is in a whitelisted namespace") configmap = nonCompliantConfigMap(f) @@ -1274,7 +1274,7 @@ func registerFailClosedWebhook(f *framework.Framework, configName string, certCt err = waitWebhookConfigurationReady(f) framework.ExpectNoError(err, "waiting for webhook configuration to be ready") return func() { - f.ClientSet.AdmissionregistrationV1().ValidatingWebhookConfigurations().Delete(context.TODO(), configName, nil) + f.ClientSet.AdmissionregistrationV1().ValidatingWebhookConfigurations().Delete(context.TODO(), configName, metav1.DeleteOptions{}) } } @@ -1289,7 +1289,7 @@ func testFailClosedWebhook(f *framework.Framework) { }, }}) framework.ExpectNoError(err, "creating namespace %q", failNamespaceName) - defer client.CoreV1().Namespaces().Delete(context.TODO(), failNamespaceName, nil) + defer client.CoreV1().Namespaces().Delete(context.TODO(), failNamespaceName, metav1.DeleteOptions{}) ginkgo.By("create a configmap should be unconditionally rejected by the webhook") configmap := &v1.ConfigMap{ @@ -1360,7 +1360,7 @@ func registerValidatingWebhookForWebhookConfigurations(f *framework.Framework, c err = waitWebhookConfigurationReady(f) framework.ExpectNoError(err, "waiting for webhook configuration to be ready") return func() { - err := client.AdmissionregistrationV1().ValidatingWebhookConfigurations().Delete(context.TODO(), configName, nil) + err := client.AdmissionregistrationV1().ValidatingWebhookConfigurations().Delete(context.TODO(), configName, metav1.DeleteOptions{}) framework.ExpectNoError(err, "deleting webhook config %s with namespace %s", configName, namespace) } } @@ -1421,7 +1421,7 @@ func registerMutatingWebhookForWebhookConfigurations(f *framework.Framework, con err = waitWebhookConfigurationReady(f) framework.ExpectNoError(err, "waiting for webhook configuration to be ready") return func() { - err := client.AdmissionregistrationV1().MutatingWebhookConfigurations().Delete(context.TODO(), configName, nil) + err := client.AdmissionregistrationV1().MutatingWebhookConfigurations().Delete(context.TODO(), configName, metav1.DeleteOptions{}) framework.ExpectNoError(err, "deleting webhook config %s with namespace %s", configName, namespace) } } @@ -1489,7 +1489,7 @@ func testWebhooksForWebhookConfigurations(f *framework.Framework, configName str ginkgo.By("Deleting the validating-webhook-configuration, which should be possible to remove") - err = client.AdmissionregistrationV1().ValidatingWebhookConfigurations().Delete(context.TODO(), configName, nil) + err = client.AdmissionregistrationV1().ValidatingWebhookConfigurations().Delete(context.TODO(), configName, metav1.DeleteOptions{}) framework.ExpectNoError(err, "deleting webhook config %s with namespace %s", configName, namespace) ginkgo.By("Creating a dummy mutating-webhook-configuration object") @@ -1545,7 +1545,7 @@ func testWebhooksForWebhookConfigurations(f *framework.Framework, configName str ginkgo.By("Deleting the mutating-webhook-configuration, which should be possible to remove") - err = client.AdmissionregistrationV1().MutatingWebhookConfigurations().Delete(context.TODO(), configName, nil) + err = client.AdmissionregistrationV1().MutatingWebhookConfigurations().Delete(context.TODO(), configName, metav1.DeleteOptions{}) framework.ExpectNoError(err, "deleting webhook config %s with namespace %s", configName, namespace) } @@ -1695,10 +1695,10 @@ func updateCustomResource(c dynamic.ResourceInterface, ns, name string, update u } func cleanWebhookTest(client clientset.Interface, namespaceName string) { - _ = client.CoreV1().Services(namespaceName).Delete(context.TODO(), serviceName, nil) - _ = client.AppsV1().Deployments(namespaceName).Delete(context.TODO(), deploymentName, nil) - _ = client.CoreV1().Secrets(namespaceName).Delete(context.TODO(), secretName, nil) - _ = client.RbacV1().RoleBindings("kube-system").Delete(context.TODO(), roleBindingName, nil) + _ = client.CoreV1().Services(namespaceName).Delete(context.TODO(), serviceName, metav1.DeleteOptions{}) + _ = client.AppsV1().Deployments(namespaceName).Delete(context.TODO(), deploymentName, metav1.DeleteOptions{}) + _ = client.CoreV1().Secrets(namespaceName).Delete(context.TODO(), secretName, metav1.DeleteOptions{}) + _ = client.RbacV1().RoleBindings("kube-system").Delete(context.TODO(), roleBindingName, metav1.DeleteOptions{}) } func registerWebhookForCustomResource(f *framework.Framework, configName string, certCtx *certContext, testcrd *crd.TestCrd, servicePort int32) func() { @@ -1748,7 +1748,7 @@ func registerWebhookForCustomResource(f *framework.Framework, configName string, err = waitWebhookConfigurationReady(f) framework.ExpectNoError(err, "waiting for webhook configuration to be ready") return func() { - client.AdmissionregistrationV1().ValidatingWebhookConfigurations().Delete(context.TODO(), configName, nil) + client.AdmissionregistrationV1().ValidatingWebhookConfigurations().Delete(context.TODO(), configName, metav1.DeleteOptions{}) } } @@ -1826,7 +1826,7 @@ func registerMutatingWebhookForCustomResource(f *framework.Framework, configName framework.ExpectNoError(err, "waiting for webhook configuration to be ready") return func() { - client.AdmissionregistrationV1().MutatingWebhookConfigurations().Delete(context.TODO(), configName, nil) + client.AdmissionregistrationV1().MutatingWebhookConfigurations().Delete(context.TODO(), configName, metav1.DeleteOptions{}) } } @@ -2058,7 +2058,7 @@ func registerValidatingWebhookForCRD(f *framework.Framework, configName string, err = waitWebhookConfigurationReady(f) framework.ExpectNoError(err, "waiting for webhook configuration to be ready") return func() { - client.AdmissionregistrationV1().ValidatingWebhookConfigurations().Delete(context.TODO(), configName, nil) + client.AdmissionregistrationV1().ValidatingWebhookConfigurations().Delete(context.TODO(), configName, metav1.DeleteOptions{}) } } @@ -2188,7 +2188,7 @@ func registerSlowWebhook(f *framework.Framework, configName string, certCtx *cer framework.ExpectNoError(err, "waiting for webhook configuration to be ready") return func() { - client.AdmissionregistrationV1().ValidatingWebhookConfigurations().Delete(context.TODO(), configName, nil) + client.AdmissionregistrationV1().ValidatingWebhookConfigurations().Delete(context.TODO(), configName, metav1.DeleteOptions{}) } } @@ -2212,7 +2212,7 @@ func testSlowWebhookTimeoutNoError(f *framework.Framework) { name := "e2e-test-slow-webhook-configmap" _, err := client.CoreV1().ConfigMaps(f.Namespace.Name).Create(context.TODO(), &v1.ConfigMap{ObjectMeta: metav1.ObjectMeta{Name: name}}, metav1.CreateOptions{}) gomega.Expect(err).To(gomega.BeNil()) - err = client.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), name, &metav1.DeleteOptions{}) + err = client.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), name, metav1.DeleteOptions{}) gomega.Expect(err).To(gomega.BeNil()) } @@ -2422,7 +2422,7 @@ func waitWebhookConfigurationReady(f *framework.Framework) error { return false, err } // best effort cleanup of markers that are no longer needed - _ = cmClient.Delete(context.TODO(), marker.GetName(), nil) + _ = cmClient.Delete(context.TODO(), marker.GetName(), metav1.DeleteOptions{}) framework.Logf("Waiting for webhook configuration to be ready...") return false, nil }) diff --git a/test/e2e/apps/cronjob.go b/test/e2e/apps/cronjob.go index 3786a98b717..61722019086 100644 --- a/test/e2e/apps/cronjob.go +++ b/test/e2e/apps/cronjob.go @@ -364,7 +364,7 @@ func getCronJob(c clientset.Interface, ns, name string) (*batchv1beta1.CronJob, func deleteCronJob(c clientset.Interface, ns, name string) error { propagationPolicy := metav1.DeletePropagationBackground // Also delete jobs and pods related to cronjob - return c.BatchV1beta1().CronJobs(ns).Delete(context.TODO(), name, &metav1.DeleteOptions{PropagationPolicy: &propagationPolicy}) + return c.BatchV1beta1().CronJobs(ns).Delete(context.TODO(), name, metav1.DeleteOptions{PropagationPolicy: &propagationPolicy}) } // Wait for at least given amount of active jobs. diff --git a/test/e2e/apps/daemon_set.go b/test/e2e/apps/daemon_set.go index ed345e0950f..a5742a930c9 100644 --- a/test/e2e/apps/daemon_set.go +++ b/test/e2e/apps/daemon_set.go @@ -166,7 +166,7 @@ var _ = SIGDescribe("Daemon set [Serial]", func() { ginkgo.By("Stop a daemon pod, check that the daemon pod is revived.") podList := listDaemonPods(c, ns, label) pod := podList.Items[0] - err = c.CoreV1().Pods(ns).Delete(context.TODO(), pod.Name, nil) + err = c.CoreV1().Pods(ns).Delete(context.TODO(), pod.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err) err = wait.PollImmediate(dsRetryPeriod, dsRetryTimeout, checkRunningOnAllNodes(f, ds)) framework.ExpectNoError(err, "error waiting for daemon pod to revive") diff --git a/test/e2e/apps/deployment.go b/test/e2e/apps/deployment.go index aae984c3e74..8b7027052d3 100644 --- a/test/e2e/apps/deployment.go +++ b/test/e2e/apps/deployment.go @@ -607,7 +607,7 @@ func testIterativeDeployments(f *framework.Framework) { } name := podList.Items[p].Name framework.Logf("%02d: deleting deployment pod %q", i, name) - err := c.CoreV1().Pods(ns).Delete(context.TODO(), name, nil) + err := c.CoreV1().Pods(ns).Delete(context.TODO(), name, metav1.DeleteOptions{}) if err != nil && !apierrors.IsNotFound(err) { framework.ExpectNoError(err) } @@ -854,7 +854,7 @@ func listDeploymentReplicaSets(c clientset.Interface, ns string, label map[strin func orphanDeploymentReplicaSets(c clientset.Interface, d *appsv1.Deployment) error { trueVar := true - deleteOptions := &metav1.DeleteOptions{OrphanDependents: &trueVar} + deleteOptions := metav1.DeleteOptions{OrphanDependents: &trueVar} deleteOptions.Preconditions = metav1.NewUIDPreconditions(string(d.UID)) return c.AppsV1().Deployments(d.Namespace).Delete(context.TODO(), d.Name, deleteOptions) } diff --git a/test/e2e/apps/disruption.go b/test/e2e/apps/disruption.go index b785218fd61..69ec790be66 100644 --- a/test/e2e/apps/disruption.go +++ b/test/e2e/apps/disruption.go @@ -404,7 +404,7 @@ func patchPDBOrDie(cs kubernetes.Interface, dc dynamic.Interface, ns string, nam } func deletePDBOrDie(cs kubernetes.Interface, ns string, name string) { - err := cs.PolicyV1beta1().PodDisruptionBudgets(ns).Delete(context.TODO(), name, &metav1.DeleteOptions{}) + err := cs.PolicyV1beta1().PodDisruptionBudgets(ns).Delete(context.TODO(), name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "Deleting pdb in namespace %s", ns) waitForPdbToBeDeleted(cs, ns, name) } @@ -423,7 +423,7 @@ func listPDBs(cs kubernetes.Interface, ns string, labelSelector string, count in func deletePDBCollection(cs kubernetes.Interface, ns string) { ginkgo.By("deleting a collection of PDBs") - err := cs.PolicyV1beta1().PodDisruptionBudgets(ns).DeleteCollection(context.TODO(), &metav1.DeleteOptions{}, metav1.ListOptions{}) + err := cs.PolicyV1beta1().PodDisruptionBudgets(ns).DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{}) framework.ExpectNoError(err, "Deleting PDB set in namespace %s", ns) waitForPDBCollectionToBeDeleted(cs, ns) diff --git a/test/e2e/apps/statefulset.go b/test/e2e/apps/statefulset.go index 4fb21042804..d92d9db191c 100644 --- a/test/e2e/apps/statefulset.go +++ b/test/e2e/apps/statefulset.go @@ -763,7 +763,7 @@ var _ = SIGDescribe("StatefulSet", func() { } ginkgo.By("Removing pod with conflicting port in namespace " + f.Namespace.Name) - err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod.Name, metav1.NewDeleteOptions(0)) + err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err) ginkgo.By("Waiting when stateful pod " + statefulPodName + " will be recreated in namespace " + f.Namespace.Name + " and will be in running state") @@ -1268,7 +1268,7 @@ func restorePodHTTPProbe(ss *appsv1.StatefulSet, pod *v1.Pod) error { func deleteStatefulPodAtIndex(c clientset.Interface, index int, ss *appsv1.StatefulSet) { name := getStatefulSetPodNameAtIndex(index, ss) noGrace := int64(0) - if err := c.CoreV1().Pods(ss.Namespace).Delete(context.TODO(), name, &metav1.DeleteOptions{GracePeriodSeconds: &noGrace}); err != nil { + if err := c.CoreV1().Pods(ss.Namespace).Delete(context.TODO(), name, metav1.DeleteOptions{GracePeriodSeconds: &noGrace}); err != nil { framework.Failf("Failed to delete stateful pod %v for StatefulSet %v/%v: %v", name, ss.Namespace, ss.Name, err) } } diff --git a/test/e2e/auth/audit.go b/test/e2e/auth/audit.go index 9700a0e4f4a..3fb88cee86d 100644 --- a/test/e2e/auth/audit.go +++ b/test/e2e/auth/audit.go @@ -99,7 +99,7 @@ var _ = SIGDescribe("Advanced Audit [DisabledForLargeClusters][Flaky]", func() { _, err = f.PodClient().Patch(context.TODO(), pod.Name, types.JSONPatchType, patch, metav1.PatchOptions{}) framework.ExpectNoError(err, "failed to patch pod") - f.PodClient().DeleteSync(pod.Name, &metav1.DeleteOptions{}, framework.DefaultPodDeletionTimeout) + f.PodClient().DeleteSync(pod.Name, metav1.DeleteOptions{}, framework.DefaultPodDeletionTimeout) expectEvents(f, []utils.AuditEvent{ { @@ -225,7 +225,7 @@ var _ = SIGDescribe("Advanced Audit [DisabledForLargeClusters][Flaky]", func() { _, err = f.ClientSet.AppsV1().Deployments(namespace).List(context.TODO(), metav1.ListOptions{}) framework.ExpectNoError(err, "failed to create list deployments") - err = f.ClientSet.AppsV1().Deployments(namespace).Delete(context.TODO(), "audit-deployment", &metav1.DeleteOptions{}) + err = f.ClientSet.AppsV1().Deployments(namespace).Delete(context.TODO(), "audit-deployment", metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete deployments") expectEvents(f, []utils.AuditEvent{ @@ -358,7 +358,7 @@ var _ = SIGDescribe("Advanced Audit [DisabledForLargeClusters][Flaky]", func() { _, err = f.ClientSet.CoreV1().ConfigMaps(namespace).List(context.TODO(), metav1.ListOptions{}) framework.ExpectNoError(err, "failed to list config maps") - err = f.ClientSet.CoreV1().ConfigMaps(namespace).Delete(context.TODO(), configMap.Name, &metav1.DeleteOptions{}) + err = f.ClientSet.CoreV1().ConfigMaps(namespace).Delete(context.TODO(), configMap.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete audit-configmap") expectEvents(f, []utils.AuditEvent{ @@ -490,7 +490,7 @@ var _ = SIGDescribe("Advanced Audit [DisabledForLargeClusters][Flaky]", func() { _, err = f.ClientSet.CoreV1().Secrets(namespace).List(context.TODO(), metav1.ListOptions{}) framework.ExpectNoError(err, "failed to list secrets") - err = f.ClientSet.CoreV1().Secrets(namespace).Delete(context.TODO(), secret.Name, &metav1.DeleteOptions{}) + err = f.ClientSet.CoreV1().Secrets(namespace).Delete(context.TODO(), secret.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete audit-secret") expectEvents(f, []utils.AuditEvent{ diff --git a/test/e2e/auth/audit_dynamic.go b/test/e2e/auth/audit_dynamic.go index 5882e2cd3d1..2fc99b61eac 100644 --- a/test/e2e/auth/audit_dynamic.go +++ b/test/e2e/auth/audit_dynamic.go @@ -211,7 +211,7 @@ var _ = SIGDescribe("[Feature:DynamicAudit]", func() { _, err = f.PodClient().Patch(context.TODO(), pod.Name, types.JSONPatchType, patch, metav1.PatchOptions{}) framework.ExpectNoError(err, "failed to patch pod") - f.PodClient().DeleteSync(pod.Name, &metav1.DeleteOptions{}, framework.DefaultPodDeletionTimeout) + f.PodClient().DeleteSync(pod.Name, metav1.DeleteOptions{}, framework.DefaultPodDeletionTimeout) }, []utils.AuditEvent{ { @@ -376,7 +376,7 @@ var _ = SIGDescribe("[Feature:DynamicAudit]", func() { return len(missingReport.MissingEvents) == 0, nil }) framework.ExpectNoError(err, "after %v failed to observe audit events", pollingTimeout) - err = f.ClientSet.AuditregistrationV1alpha1().AuditSinks().Delete(context.TODO(), "test", &metav1.DeleteOptions{}) + err = f.ClientSet.AuditregistrationV1alpha1().AuditSinks().Delete(context.TODO(), "test", metav1.DeleteOptions{}) framework.ExpectNoError(err, "could not delete audit configuration") }) }) diff --git a/test/e2e/auth/certificates.go b/test/e2e/auth/certificates.go index 561b9583dae..a426e929abd 100644 --- a/test/e2e/auth/certificates.go +++ b/test/e2e/auth/certificates.go @@ -119,6 +119,6 @@ var _ = SIGDescribe("Certificates API", func() { newClient, err := v1beta1client.NewForConfig(rcfg) framework.ExpectNoError(err) - framework.ExpectNoError(newClient.CertificateSigningRequests().Delete(context.TODO(), csrName, nil)) + framework.ExpectNoError(newClient.CertificateSigningRequests().Delete(context.TODO(), csrName, metav1.DeleteOptions{})) }) }) diff --git a/test/e2e/auth/node_authz.go b/test/e2e/auth/node_authz.go index 0710bb04d67..f235c0cf724 100644 --- a/test/e2e/auth/node_authz.go +++ b/test/e2e/auth/node_authz.go @@ -179,7 +179,7 @@ var _ = SIGDescribe("[Feature:NodeAuthorizer]", func() { ginkgo.It("A node shouldn't be able to delete another node", func() { ginkgo.By(fmt.Sprintf("Create node foo by user: %v", asUser)) - err := c.CoreV1().Nodes().Delete(context.TODO(), "foo", &metav1.DeleteOptions{}) + err := c.CoreV1().Nodes().Delete(context.TODO(), "foo", metav1.DeleteOptions{}) framework.ExpectEqual(apierrors.IsForbidden(err), true) }) }) diff --git a/test/e2e/auth/pod_security_policy.go b/test/e2e/auth/pod_security_policy.go index 264a7d258cc..3d87baa5593 100644 --- a/test/e2e/auth/pod_security_policy.go +++ b/test/e2e/auth/pod_security_policy.go @@ -246,7 +246,7 @@ func createAndBindPSP(f *framework.Framework, pspTemplate *policyv1beta1.PodSecu return psp, func() { // Cleanup non-namespaced PSP object. - f.ClientSet.PolicyV1beta1().PodSecurityPolicies().Delete(context.TODO(), name, &metav1.DeleteOptions{}) + f.ClientSet.PolicyV1beta1().PodSecurityPolicies().Delete(context.TODO(), name, metav1.DeleteOptions{}) } } diff --git a/test/e2e/auth/service_accounts.go b/test/e2e/auth/service_accounts.go index 34659ce2106..d4eb0771e04 100644 --- a/test/e2e/auth/service_accounts.go +++ b/test/e2e/auth/service_accounts.go @@ -83,7 +83,7 @@ var _ = SIGDescribe("ServiceAccounts", func() { // delete the referenced secret ginkgo.By("deleting the service account token") - framework.ExpectNoError(f.ClientSet.CoreV1().Secrets(f.Namespace.Name).Delete(context.TODO(), secrets[0].Name, nil)) + framework.ExpectNoError(f.ClientSet.CoreV1().Secrets(f.Namespace.Name).Delete(context.TODO(), secrets[0].Name, metav1.DeleteOptions{})) // wait for the referenced secret to be removed, and another one autocreated framework.ExpectNoError(wait.Poll(time.Millisecond*500, framework.ServiceAccountProvisionTimeout, func() (bool, error) { diff --git a/test/e2e/autoscaling/cluster_size_autoscaling.go b/test/e2e/autoscaling/cluster_size_autoscaling.go index 7ae78971900..f8c2ffa53d6 100644 --- a/test/e2e/autoscaling/cluster_size_autoscaling.go +++ b/test/e2e/autoscaling/cluster_size_autoscaling.go @@ -1039,7 +1039,7 @@ func runDrainTest(f *framework.Framework, migSizes map[string]int, namespace str _, err = f.ClientSet.PolicyV1beta1().PodDisruptionBudgets(namespace).Create(context.TODO(), pdb, metav1.CreateOptions{}) defer func() { - f.ClientSet.PolicyV1beta1().PodDisruptionBudgets(namespace).Delete(context.TODO(), pdb.Name, &metav1.DeleteOptions{}) + f.ClientSet.PolicyV1beta1().PodDisruptionBudgets(namespace).Delete(context.TODO(), pdb.Name, metav1.DeleteOptions{}) }() framework.ExpectNoError(err) @@ -1451,7 +1451,7 @@ func drainNode(f *framework.Framework, node *v1.Node) { pods, err := f.ClientSet.CoreV1().Pods(metav1.NamespaceAll).List(context.TODO(), podOpts) framework.ExpectNoError(err) for _, pod := range pods.Items { - err = f.ClientSet.CoreV1().Pods(pod.Namespace).Delete(context.TODO(), pod.Name, metav1.NewDeleteOptions(0)) + err = f.ClientSet.CoreV1().Pods(pod.Namespace).Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err) } } @@ -1879,7 +1879,7 @@ func addKubeSystemPdbs(f *framework.Framework) (func(), error) { var finalErr error for _, newPdbName := range newPdbs { ginkgo.By(fmt.Sprintf("Delete PodDisruptionBudget %v", newPdbName)) - err := f.ClientSet.PolicyV1beta1().PodDisruptionBudgets("kube-system").Delete(context.TODO(), newPdbName, &metav1.DeleteOptions{}) + err := f.ClientSet.PolicyV1beta1().PodDisruptionBudgets("kube-system").Delete(context.TODO(), newPdbName, metav1.DeleteOptions{}) if err != nil { // log error, but attempt to remove other pdbs klog.Errorf("Failed to delete PodDisruptionBudget %v, err: %v", newPdbName, err) @@ -1942,7 +1942,7 @@ func createPriorityClasses(f *framework.Framework) func() { return func() { for className := range priorityClasses { - err := f.ClientSet.SchedulingV1().PriorityClasses().Delete(context.TODO(), className, nil) + err := f.ClientSet.SchedulingV1().PriorityClasses().Delete(context.TODO(), className, metav1.DeleteOptions{}) if err != nil { klog.Errorf("Error deleting priority class: %v", err) } diff --git a/test/e2e/autoscaling/custom_metrics_stackdriver_autoscaling.go b/test/e2e/autoscaling/custom_metrics_stackdriver_autoscaling.go index 0d7099e5609..d3a7862d338 100644 --- a/test/e2e/autoscaling/custom_metrics_stackdriver_autoscaling.go +++ b/test/e2e/autoscaling/custom_metrics_stackdriver_autoscaling.go @@ -280,7 +280,7 @@ func (tc *CustomMetricTestCase) Run() { if err != nil { framework.Failf("Failed to create HPA: %v", err) } - defer tc.kubeClient.AutoscalingV2beta1().HorizontalPodAutoscalers(tc.framework.Namespace.ObjectMeta.Name).Delete(context.TODO(), tc.hpa.ObjectMeta.Name, &metav1.DeleteOptions{}) + defer tc.kubeClient.AutoscalingV2beta1().HorizontalPodAutoscalers(tc.framework.Namespace.ObjectMeta.Name).Delete(context.TODO(), tc.hpa.ObjectMeta.Name, metav1.DeleteOptions{}) waitForReplicas(tc.deployment.ObjectMeta.Name, tc.framework.Namespace.ObjectMeta.Name, tc.kubeClient, 15*time.Minute, tc.scaledReplicas) } @@ -303,10 +303,10 @@ func createDeploymentToScale(f *framework.Framework, cs clientset.Interface, dep func cleanupDeploymentsToScale(f *framework.Framework, cs clientset.Interface, deployment *appsv1.Deployment, pod *v1.Pod) { if deployment != nil { - _ = cs.AppsV1().Deployments(f.Namespace.ObjectMeta.Name).Delete(context.TODO(), deployment.ObjectMeta.Name, &metav1.DeleteOptions{}) + _ = cs.AppsV1().Deployments(f.Namespace.ObjectMeta.Name).Delete(context.TODO(), deployment.ObjectMeta.Name, metav1.DeleteOptions{}) } if pod != nil { - _ = cs.CoreV1().Pods(f.Namespace.ObjectMeta.Name).Delete(context.TODO(), pod.ObjectMeta.Name, &metav1.DeleteOptions{}) + _ = cs.CoreV1().Pods(f.Namespace.ObjectMeta.Name).Delete(context.TODO(), pod.ObjectMeta.Name, metav1.DeleteOptions{}) } } diff --git a/test/e2e/autoscaling/dns_autoscaling.go b/test/e2e/autoscaling/dns_autoscaling.go index 14dff8eaafc..f81f22a8a28 100644 --- a/test/e2e/autoscaling/dns_autoscaling.go +++ b/test/e2e/autoscaling/dns_autoscaling.go @@ -274,7 +274,7 @@ func fetchDNSScalingConfigMap(c clientset.Interface) (*v1.ConfigMap, error) { } func deleteDNSScalingConfigMap(c clientset.Interface) error { - if err := c.CoreV1().ConfigMaps(metav1.NamespaceSystem).Delete(context.TODO(), DNSAutoscalerLabelName, nil); err != nil { + if err := c.CoreV1().ConfigMaps(metav1.NamespaceSystem).Delete(context.TODO(), DNSAutoscalerLabelName, metav1.DeleteOptions{}); err != nil { return err } framework.Logf("DNS autoscaling ConfigMap deleted.") @@ -335,7 +335,7 @@ func deleteDNSAutoscalerPod(c clientset.Interface) error { } podName := pods.Items[0].Name - if err := c.CoreV1().Pods(metav1.NamespaceSystem).Delete(context.TODO(), podName, nil); err != nil { + if err := c.CoreV1().Pods(metav1.NamespaceSystem).Delete(context.TODO(), podName, metav1.DeleteOptions{}); err != nil { return err } framework.Logf("DNS autoscaling pod %v deleted.", podName) diff --git a/test/e2e/cloud/gcp/addon_update.go b/test/e2e/cloud/gcp/addon_update.go index 62b4554a3b7..f1ee3c0ad93 100644 --- a/test/e2e/cloud/gcp/addon_update.go +++ b/test/e2e/cloud/gcp/addon_update.go @@ -302,7 +302,7 @@ var _ = SIGDescribe("Addon update", func() { // Delete the "ensure exist class" addon at the end. defer func() { framework.Logf("Cleaning up ensure exist class addon.") - err := f.ClientSet.CoreV1().Services(addonNsName).Delete(context.TODO(), "addon-ensure-exists-test", nil) + err := f.ClientSet.CoreV1().Services(addonNsName).Delete(context.TODO(), "addon-ensure-exists-test", metav1.DeleteOptions{}) framework.ExpectNoError(err) }() diff --git a/test/e2e/common/configmap.go b/test/e2e/common/configmap.go index db1d3ca391b..106bd4fc40d 100644 --- a/test/e2e/common/configmap.go +++ b/test/e2e/common/configmap.go @@ -212,7 +212,7 @@ var _ = ginkgo.Describe("[sig-node] ConfigMap", func() { } framework.ExpectEqual(testConfigMapFound, true, "failed to find ConfigMap in list") - err = f.ClientSet.CoreV1().ConfigMaps(testNamespaceName).DeleteCollection(context.TODO(), &metav1.DeleteOptions{}, metav1.ListOptions{ + err = f.ClientSet.CoreV1().ConfigMaps(testNamespaceName).DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{ LabelSelector: "test-configmap-static=true", }) framework.ExpectNoError(err, "failed to delete ConfigMap collection with LabelSelector") diff --git a/test/e2e/common/configmap_volume.go b/test/e2e/common/configmap_volume.go index 38f2dd718b5..e88a3cccd21 100644 --- a/test/e2e/common/configmap_volume.go +++ b/test/e2e/common/configmap_volume.go @@ -453,7 +453,7 @@ var _ = ginkgo.Describe("[sig-storage] ConfigMap", func() { gomega.Eventually(pollDeleteLogs, podLogTimeout, framework.Poll).Should(gomega.ContainSubstring("value-1")) ginkgo.By(fmt.Sprintf("Deleting configmap %v", deleteConfigMap.Name)) - err = f.ClientSet.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), deleteConfigMap.Name, &metav1.DeleteOptions{}) + err = f.ClientSet.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), deleteConfigMap.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "Failed to delete configmap %q in namespace %q", deleteConfigMap.Name, f.Namespace.Name) ginkgo.By(fmt.Sprintf("Updating configmap %v", updateConfigMap.Name)) @@ -594,7 +594,7 @@ var _ = ginkgo.Describe("[sig-storage] ConfigMap", func() { framework.ExpectNoError(err, "Failed to update config map %q in namespace %q", configMap.Name, configMap.Namespace) // Ensure that immutable config map can be deleted. - err = f.ClientSet.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), name, &metav1.DeleteOptions{}) + err = f.ClientSet.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "Failed to delete config map %q in namespace %q", configMap.Name, configMap.Namespace) }) diff --git a/test/e2e/common/container.go b/test/e2e/common/container.go index a1ad000f5ee..cd5a2be9e90 100644 --- a/test/e2e/common/container.go +++ b/test/e2e/common/container.go @@ -70,7 +70,7 @@ func (cc *ConformanceContainer) Create() { } func (cc *ConformanceContainer) Delete() error { - return cc.PodClient.Delete(context.TODO(), cc.podName, metav1.NewDeleteOptions(0)) + return cc.PodClient.Delete(context.TODO(), cc.podName, *metav1.NewDeleteOptions(0)) } func (cc *ConformanceContainer) IsReady() (bool, error) { diff --git a/test/e2e/common/container_probe.go b/test/e2e/common/container_probe.go index 3af84b05b27..62c36116cc2 100644 --- a/test/e2e/common/container_probe.go +++ b/test/e2e/common/container_probe.go @@ -415,7 +415,7 @@ func RunLivenessTest(f *framework.Framework, pod *v1.Pod, expectNumRestarts int, // At the end of the test, clean up by removing the pod. defer func() { ginkgo.By("deleting the pod") - podClient.Delete(context.TODO(), pod.Name, metav1.NewDeleteOptions(0)) + podClient.Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(0)) }() ginkgo.By(fmt.Sprintf("Creating pod %s in namespace %s", pod.Name, ns)) podClient.Create(pod) diff --git a/test/e2e/common/kubelet.go b/test/e2e/common/kubelet.go index 579ca7c4358..1c0502d2802 100644 --- a/test/e2e/common/kubelet.go +++ b/test/e2e/common/kubelet.go @@ -130,7 +130,7 @@ var _ = framework.KubeDescribe("Kubelet", func() { Description: Create a Pod with terminated state. This terminated pod MUST be able to be deleted. */ framework.ConformanceIt("should be possible to delete [NodeConformance]", func() { - err := podClient.Delete(context.TODO(), podName, &metav1.DeleteOptions{}) + err := podClient.Delete(context.TODO(), podName, metav1.DeleteOptions{}) gomega.Expect(err).To(gomega.BeNil(), fmt.Sprintf("Error deleting Pod %v", err)) }) }) diff --git a/test/e2e/common/lease.go b/test/e2e/common/lease.go index 7bb1b64c71c..f87ca02e9a6 100644 --- a/test/e2e/common/lease.go +++ b/test/e2e/common/lease.go @@ -144,14 +144,14 @@ var _ = framework.KubeDescribe("Lease", func() { framework.ExpectEqual(len(leases.Items), 2) selector := labels.Set(map[string]string{"deletecollection": "true"}).AsSelector() - err = leaseClient.DeleteCollection(context.TODO(), &metav1.DeleteOptions{}, metav1.ListOptions{LabelSelector: selector.String()}) + err = leaseClient.DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{LabelSelector: selector.String()}) framework.ExpectNoError(err, "couldn't delete collection") leases, err = leaseClient.List(context.TODO(), metav1.ListOptions{}) framework.ExpectNoError(err, "couldn't list Leases") framework.ExpectEqual(len(leases.Items), 1) - err = leaseClient.Delete(context.TODO(), name, &metav1.DeleteOptions{}) + err = leaseClient.Delete(context.TODO(), name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "deleting Lease failed") _, err = leaseClient.Get(context.TODO(), name, metav1.GetOptions{}) diff --git a/test/e2e/common/lifecycle_hook.go b/test/e2e/common/lifecycle_hook.go index a5f226545bd..3ae5511caba 100644 --- a/test/e2e/common/lifecycle_hook.go +++ b/test/e2e/common/lifecycle_hook.go @@ -82,7 +82,7 @@ var _ = framework.KubeDescribe("Container Lifecycle Hook", func() { }, postStartWaitTimeout, podCheckInterval).Should(gomega.BeNil()) } ginkgo.By("delete the pod with lifecycle hook") - podClient.DeleteSync(podWithHook.Name, metav1.NewDeleteOptions(15), framework.DefaultPodDeletionTimeout) + podClient.DeleteSync(podWithHook.Name, *metav1.NewDeleteOptions(15), framework.DefaultPodDeletionTimeout) if podWithHook.Spec.Containers[0].Lifecycle.PreStop != nil { ginkgo.By("check prestop hook") gomega.Eventually(func() error { diff --git a/test/e2e/common/pods.go b/test/e2e/common/pods.go index d0b7e9d80d3..0dc11b19665 100644 --- a/test/e2e/common/pods.go +++ b/test/e2e/common/pods.go @@ -296,7 +296,7 @@ var _ = framework.KubeDescribe("Pods", func() { framework.ExpectNoError(err, "failed to GET scheduled pod") ginkgo.By("deleting the pod gracefully") - err = podClient.Delete(context.TODO(), pod.Name, metav1.NewDeleteOptions(30)) + err = podClient.Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(30)) framework.ExpectNoError(err, "failed to delete pod") ginkgo.By("verifying the kubelet observed the termination notice") diff --git a/test/e2e/common/podtemplates.go b/test/e2e/common/podtemplates.go index f289797466c..420528a49cf 100644 --- a/test/e2e/common/podtemplates.go +++ b/test/e2e/common/podtemplates.go @@ -84,7 +84,7 @@ var _ = ginkgo.Describe("[sig-architecture] PodTemplates", func() { framework.ExpectEqual(podTemplateRead.ObjectMeta.Labels["podtemplate"], "patched", "failed to patch template, new label not found") // delete the PodTemplate - err = f.ClientSet.CoreV1().PodTemplates(testNamespaceName).Delete(context.TODO(), podTemplateName, &metav1.DeleteOptions{}) + err = f.ClientSet.CoreV1().PodTemplates(testNamespaceName).Delete(context.TODO(), podTemplateName, metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete PodTemplate") // list the PodTemplates diff --git a/test/e2e/common/projected_configmap.go b/test/e2e/common/projected_configmap.go index bbf92234f81..76ebed5366c 100644 --- a/test/e2e/common/projected_configmap.go +++ b/test/e2e/common/projected_configmap.go @@ -380,7 +380,7 @@ var _ = ginkgo.Describe("[sig-storage] Projected configMap", func() { gomega.Eventually(pollDeleteLogs, podLogTimeout, framework.Poll).Should(gomega.ContainSubstring("value-1")) ginkgo.By(fmt.Sprintf("Deleting configmap %v", deleteConfigMap.Name)) - err = f.ClientSet.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), deleteConfigMap.Name, &metav1.DeleteOptions{}) + err = f.ClientSet.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), deleteConfigMap.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "Failed to delete configmap %q in namespace %q", deleteConfigMap.Name, f.Namespace.Name) ginkgo.By(fmt.Sprintf("Updating configmap %v", updateConfigMap.Name)) diff --git a/test/e2e/common/projected_secret.go b/test/e2e/common/projected_secret.go index 306f8039ed2..3da67ba7715 100644 --- a/test/e2e/common/projected_secret.go +++ b/test/e2e/common/projected_secret.go @@ -382,7 +382,7 @@ var _ = ginkgo.Describe("[sig-storage] Projected secret", func() { gomega.Eventually(pollDeleteLogs, podLogTimeout, framework.Poll).Should(gomega.ContainSubstring("value-1")) ginkgo.By(fmt.Sprintf("Deleting secret %v", deleteSecret.Name)) - err = f.ClientSet.CoreV1().Secrets(f.Namespace.Name).Delete(context.TODO(), deleteSecret.Name, &metav1.DeleteOptions{}) + err = f.ClientSet.CoreV1().Secrets(f.Namespace.Name).Delete(context.TODO(), deleteSecret.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "Failed to delete secret %q in namespace %q", deleteSecret.Name, f.Namespace.Name) ginkgo.By(fmt.Sprintf("Updating secret %v", updateSecret.Name)) diff --git a/test/e2e/common/runtime.go b/test/e2e/common/runtime.go index 2c161a355c6..939d58acda6 100644 --- a/test/e2e/common/runtime.go +++ b/test/e2e/common/runtime.go @@ -303,7 +303,7 @@ while true; do sleep 1; done ginkgo.By("create image pull secret") _, err := f.ClientSet.CoreV1().Secrets(f.Namespace.Name).Create(context.TODO(), secret, metav1.CreateOptions{}) framework.ExpectNoError(err) - defer f.ClientSet.CoreV1().Secrets(f.Namespace.Name).Delete(context.TODO(), secret.Name, nil) + defer f.ClientSet.CoreV1().Secrets(f.Namespace.Name).Delete(context.TODO(), secret.Name, metav1.DeleteOptions{}) container.ImagePullSecrets = []string{secret.Name} } // checkContainerStatus checks whether the container status matches expectation. diff --git a/test/e2e/common/runtimeclass.go b/test/e2e/common/runtimeclass.go index b4217955c4e..6b7b5b4776f 100644 --- a/test/e2e/common/runtimeclass.go +++ b/test/e2e/common/runtimeclass.go @@ -66,7 +66,7 @@ var _ = ginkgo.Describe("[sig-node] RuntimeClass", func() { rcClient := f.ClientSet.NodeV1beta1().RuntimeClasses() ginkgo.By("Deleting RuntimeClass "+rcName, func() { - err := rcClient.Delete(context.TODO(), rcName, nil) + err := rcClient.Delete(context.TODO(), rcName, metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete RuntimeClass %s", rcName) ginkgo.By("Waiting for the RuntimeClass to disappear") diff --git a/test/e2e/common/secrets.go b/test/e2e/common/secrets.go index 5cca4a2d023..538dd7fd7c7 100644 --- a/test/e2e/common/secrets.go +++ b/test/e2e/common/secrets.go @@ -209,7 +209,7 @@ var _ = ginkgo.Describe("[sig-api-machinery] Secrets", func() { framework.ExpectEqual(string(secretDecodedstring), "value1", "found secret, but the data wasn't updated from the patch") ginkgo.By("deleting the secret using a LabelSelector") - err = f.ClientSet.CoreV1().Secrets(f.Namespace.Name).DeleteCollection(context.TODO(), &metav1.DeleteOptions{}, metav1.ListOptions{ + err = f.ClientSet.CoreV1().Secrets(f.Namespace.Name).DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{ LabelSelector: "testsecret=true", }) framework.ExpectNoError(err, "failed to delete patched secret") diff --git a/test/e2e/common/secrets_volume.go b/test/e2e/common/secrets_volume.go index 102440a5d21..80c8b3001a5 100644 --- a/test/e2e/common/secrets_volume.go +++ b/test/e2e/common/secrets_volume.go @@ -348,7 +348,7 @@ var _ = ginkgo.Describe("[sig-storage] Secrets", func() { gomega.Eventually(pollDeleteLogs, podLogTimeout, framework.Poll).Should(gomega.ContainSubstring("value-1")) ginkgo.By(fmt.Sprintf("Deleting secret %v", deleteSecret.Name)) - err = f.ClientSet.CoreV1().Secrets(f.Namespace.Name).Delete(context.TODO(), deleteSecret.Name, &metav1.DeleteOptions{}) + err = f.ClientSet.CoreV1().Secrets(f.Namespace.Name).Delete(context.TODO(), deleteSecret.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "Failed to delete secret %q in namespace %q", deleteSecret.Name, f.Namespace.Name) ginkgo.By(fmt.Sprintf("Updating secret %v", updateSecret.Name)) @@ -412,7 +412,7 @@ var _ = ginkgo.Describe("[sig-storage] Secrets", func() { framework.ExpectNoError(err, "Failed to update secret %q in namespace %q", secret.Name, secret.Namespace) // Ensure that immutable secret can be deleted. - err = f.ClientSet.CoreV1().Secrets(f.Namespace.Name).Delete(context.TODO(), name, &metav1.DeleteOptions{}) + err = f.ClientSet.CoreV1().Secrets(f.Namespace.Name).Delete(context.TODO(), name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "Failed to delete secret %q in namespace %q", secret.Name, secret.Namespace) }) diff --git a/test/e2e/common/volumes.go b/test/e2e/common/volumes.go index 1d1b0975fee..192e5874a18 100644 --- a/test/e2e/common/volumes.go +++ b/test/e2e/common/volumes.go @@ -46,6 +46,7 @@ import ( "context" v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" clientset "k8s.io/client-go/kubernetes" "k8s.io/kubernetes/test/e2e/framework" e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper" @@ -131,7 +132,7 @@ var _ = ginkgo.Describe("[sig-storage] GCP Volumes", func() { name := config.Prefix + "-server" defer func() { volume.TestServerCleanup(f, config) - err := c.CoreV1().Endpoints(namespace.Name).Delete(context.TODO(), name, nil) + err := c.CoreV1().Endpoints(namespace.Name).Delete(context.TODO(), name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "defer: Gluster delete endpoints failed") }() diff --git a/test/e2e/e2e.go b/test/e2e/e2e.go index 9477e4879ee..54a3ddbb4f9 100644 --- a/test/e2e/e2e.go +++ b/test/e2e/e2e.go @@ -141,7 +141,7 @@ func runKubernetesServiceTestContainer(c clientset.Interface, ns string) { return } defer func() { - if err := c.CoreV1().Pods(ns).Delete(context.TODO(), p.Name, nil); err != nil { + if err := c.CoreV1().Pods(ns).Delete(context.TODO(), p.Name, metav1.DeleteOptions{}); err != nil { framework.Logf("Failed to delete pod %v: %v", p.Name, err) } }() diff --git a/test/e2e/framework/autoscaling/autoscaling_utils.go b/test/e2e/framework/autoscaling/autoscaling_utils.go index 2d3e1fa8fb1..6cbeb51600d 100644 --- a/test/e2e/framework/autoscaling/autoscaling_utils.go +++ b/test/e2e/framework/autoscaling/autoscaling_utils.go @@ -415,9 +415,9 @@ func (rc *ResourceConsumer) CleanUp() { time.Sleep(10 * time.Second) kind := rc.kind.GroupKind() framework.ExpectNoError(framework.DeleteResourceAndWaitForGC(rc.clientSet, kind, rc.nsName, rc.name)) - framework.ExpectNoError(rc.clientSet.CoreV1().Services(rc.nsName).Delete(context.TODO(), rc.name, nil)) + framework.ExpectNoError(rc.clientSet.CoreV1().Services(rc.nsName).Delete(context.TODO(), rc.name, metav1.DeleteOptions{})) framework.ExpectNoError(framework.DeleteResourceAndWaitForGC(rc.clientSet, schema.GroupKind{Kind: "ReplicationController"}, rc.nsName, rc.controllerName)) - framework.ExpectNoError(rc.clientSet.CoreV1().Services(rc.nsName).Delete(context.TODO(), rc.controllerName, nil)) + framework.ExpectNoError(rc.clientSet.CoreV1().Services(rc.nsName).Delete(context.TODO(), rc.controllerName, metav1.DeleteOptions{})) } func runServiceAndWorkloadForResourceConsumer(c clientset.Interface, ns, name string, kind schema.GroupVersionKind, replicas int, cpuLimitMillis, memLimitMb int64, podAnnotations, serviceAnnotations map[string]string) { @@ -538,7 +538,7 @@ func CreateCPUHorizontalPodAutoscaler(rc *ResourceConsumer, cpu, minReplicas, ma // DeleteHorizontalPodAutoscaler delete the horizontalPodAutoscaler for consuming resources. func DeleteHorizontalPodAutoscaler(rc *ResourceConsumer, autoscalerName string) { - rc.clientSet.AutoscalingV1().HorizontalPodAutoscalers(rc.nsName).Delete(context.TODO(), autoscalerName, nil) + rc.clientSet.AutoscalingV1().HorizontalPodAutoscalers(rc.nsName).Delete(context.TODO(), autoscalerName, metav1.DeleteOptions{}) } // runReplicaSet launches (and verifies correctness) of a replicaset. diff --git a/test/e2e/framework/framework.go b/test/e2e/framework/framework.go index 0fbe3d129dd..e574a8ee3b9 100644 --- a/test/e2e/framework/framework.go +++ b/test/e2e/framework/framework.go @@ -386,7 +386,7 @@ func (f *Framework) AfterEach() { if TestContext.DeleteNamespace && (TestContext.DeleteNamespaceOnFailure || !ginkgo.CurrentGinkgoTestDescription().Failed) { for _, ns := range f.namespacesToDelete { ginkgo.By(fmt.Sprintf("Destroying namespace %q for this suite.", ns.Name)) - if err := f.ClientSet.CoreV1().Namespaces().Delete(context.TODO(), ns.Name, nil); err != nil { + if err := f.ClientSet.CoreV1().Namespaces().Delete(context.TODO(), ns.Name, metav1.DeleteOptions{}); err != nil { if !apierrors.IsNotFound(err) { nsDeletionErrors[ns.Name] = err diff --git a/test/e2e/framework/ingress/ingress_utils.go b/test/e2e/framework/ingress/ingress_utils.go index 9684aa8a6cd..23ae490f909 100644 --- a/test/e2e/framework/ingress/ingress_utils.go +++ b/test/e2e/framework/ingress/ingress_utils.go @@ -653,7 +653,7 @@ func (j *TestJig) tryDeleteGivenIngress(ing *networkingv1beta1.Ingress) { // runDelete runs the required command to delete the given ingress. func (j *TestJig) runDelete(ing *networkingv1beta1.Ingress) error { if j.Class != MulticlusterIngressClassValue { - return j.Client.NetworkingV1beta1().Ingresses(ing.Namespace).Delete(context.TODO(), ing.Name, nil) + return j.Client.NetworkingV1beta1().Ingresses(ing.Namespace).Delete(context.TODO(), ing.Name, metav1.DeleteOptions{}) } // Use kubemci to delete a multicluster ingress. filePath := framework.TestContext.OutputDir + "/mci.yaml" @@ -1145,12 +1145,12 @@ func (j *TestJig) DeleteTestResource(cs clientset.Interface, deploy *appsv1.Depl } } if svc != nil { - if err := cs.CoreV1().Services(svc.Namespace).Delete(context.TODO(), svc.Name, nil); err != nil { + if err := cs.CoreV1().Services(svc.Namespace).Delete(context.TODO(), svc.Name, metav1.DeleteOptions{}); err != nil { errs = append(errs, fmt.Errorf("error while deleting service %s/%s: %v", svc.Namespace, svc.Name, err)) } } if deploy != nil { - if err := cs.AppsV1().Deployments(deploy.Namespace).Delete(context.TODO(), deploy.Name, nil); err != nil { + if err := cs.AppsV1().Deployments(deploy.Namespace).Delete(context.TODO(), deploy.Name, metav1.DeleteOptions{}); err != nil { errs = append(errs, fmt.Errorf("error while deleting deployment %s/%s: %v", deploy.Namespace, deploy.Name, err)) } } diff --git a/test/e2e/framework/network/utils.go b/test/e2e/framework/network/utils.go index cea7e30ed0c..b3ba73fabe3 100644 --- a/test/e2e/framework/network/utils.go +++ b/test/e2e/framework/network/utils.go @@ -553,7 +553,7 @@ func (config *NetworkingTestConfig) createSessionAffinityService(selector map[st // DeleteNodePortService deletes NodePort service. func (config *NetworkingTestConfig) DeleteNodePortService() { - err := config.getServiceClient().Delete(context.TODO(), config.NodePortService.Name, nil) + err := config.getServiceClient().Delete(context.TODO(), config.NodePortService.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "error while deleting NodePortService. err:%v)", err) time.Sleep(15 * time.Second) // wait for kube-proxy to catch up with the service being deleted. } @@ -678,7 +678,7 @@ func (config *NetworkingTestConfig) createNetProxyPods(podName string, selector // DeleteNetProxyPod deletes the first endpoint pod and waits for it being removed. func (config *NetworkingTestConfig) DeleteNetProxyPod() { pod := config.EndpointPods[0] - config.getPodClient().Delete(context.TODO(), pod.Name, metav1.NewDeleteOptions(0)) + config.getPodClient().Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(0)) config.EndpointPods = config.EndpointPods[1:] // wait for pod being deleted. err := e2epod.WaitForPodToDisappear(config.f.ClientSet, config.Namespace, pod.Name, labels.Everything(), time.Second, wait.ForeverTestTimeout) diff --git a/test/e2e/framework/pod/delete.go b/test/e2e/framework/pod/delete.go index 6a292457916..2da92d4d8e0 100644 --- a/test/e2e/framework/pod/delete.go +++ b/test/e2e/framework/pod/delete.go @@ -25,6 +25,7 @@ import ( v1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" clientset "k8s.io/client-go/kubernetes" e2elog "k8s.io/kubernetes/test/e2e/framework/log" ) @@ -37,7 +38,7 @@ const ( // DeletePodOrFail deletes the pod of the specified namespace and name. func DeletePodOrFail(c clientset.Interface, ns, name string) { ginkgo.By(fmt.Sprintf("Deleting pod %s in namespace %s", name, ns)) - err := c.CoreV1().Pods(ns).Delete(context.TODO(), name, nil) + err := c.CoreV1().Pods(ns).Delete(context.TODO(), name, metav1.DeleteOptions{}) expectNoError(err, "failed to delete pod %s in namespace %s", name, ns) } @@ -54,7 +55,7 @@ func DeletePodWithWait(c clientset.Interface, pod *v1.Pod) error { // not existing. func DeletePodWithWaitByName(c clientset.Interface, podName, podNamespace string) error { e2elog.Logf("Deleting pod %q in namespace %q", podName, podNamespace) - err := c.CoreV1().Pods(podNamespace).Delete(context.TODO(), podName, nil) + err := c.CoreV1().Pods(podNamespace).Delete(context.TODO(), podName, metav1.DeleteOptions{}) if err != nil { if apierrors.IsNotFound(err) { return nil // assume pod was already deleted diff --git a/test/e2e/framework/pods.go b/test/e2e/framework/pods.go index f3b4c2e37c2..2a25bc70212 100644 --- a/test/e2e/framework/pods.go +++ b/test/e2e/framework/pods.go @@ -136,7 +136,7 @@ func (c *PodClient) Update(name string, updateFn func(pod *v1.Pod)) { // DeleteSync deletes the pod and wait for the pod to disappear for `timeout`. If the pod doesn't // disappear before the timeout, it will fail the test. -func (c *PodClient) DeleteSync(name string, options *metav1.DeleteOptions, timeout time.Duration) { +func (c *PodClient) DeleteSync(name string, options metav1.DeleteOptions, timeout time.Duration) { namespace := c.f.Namespace.Name err := c.Delete(context.TODO(), name, options) if err != nil && !apierrors.IsNotFound(err) { diff --git a/test/e2e/framework/pv/pv.go b/test/e2e/framework/pv/pv.go index 7fa5f4a24e3..7741db13136 100644 --- a/test/e2e/framework/pv/pv.go +++ b/test/e2e/framework/pv/pv.go @@ -186,7 +186,7 @@ func PVPVCMapCleanup(c clientset.Interface, ns string, pvols PVMap, claims PVCMa func DeletePersistentVolume(c clientset.Interface, pvName string) error { if c != nil && len(pvName) > 0 { framework.Logf("Deleting PersistentVolume %q", pvName) - err := c.CoreV1().PersistentVolumes().Delete(context.TODO(), pvName, nil) + err := c.CoreV1().PersistentVolumes().Delete(context.TODO(), pvName, metav1.DeleteOptions{}) if err != nil && !apierrors.IsNotFound(err) { return fmt.Errorf("PV Delete API error: %v", err) } @@ -198,7 +198,7 @@ func DeletePersistentVolume(c clientset.Interface, pvName string) error { func DeletePersistentVolumeClaim(c clientset.Interface, pvcName string, ns string) error { if c != nil && len(pvcName) > 0 { framework.Logf("Deleting PersistentVolumeClaim %q", pvcName) - err := c.CoreV1().PersistentVolumeClaims(ns).Delete(context.TODO(), pvcName, nil) + err := c.CoreV1().PersistentVolumeClaims(ns).Delete(context.TODO(), pvcName, metav1.DeleteOptions{}) if err != nil && !apierrors.IsNotFound(err) { return fmt.Errorf("PVC Delete API error: %v", err) } diff --git a/test/e2e/framework/service/wait.go b/test/e2e/framework/service/wait.go index 627a8d21273..747d01ab7eb 100644 --- a/test/e2e/framework/service/wait.go +++ b/test/e2e/framework/service/wait.go @@ -33,7 +33,7 @@ import ( // WaitForServiceDeletedWithFinalizer waits for the service with finalizer to be deleted. func WaitForServiceDeletedWithFinalizer(cs clientset.Interface, namespace, name string) { ginkgo.By("Delete service with finalizer") - if err := cs.CoreV1().Services(namespace).Delete(context.TODO(), name, nil); err != nil { + if err := cs.CoreV1().Services(namespace).Delete(context.TODO(), name, metav1.DeleteOptions{}); err != nil { framework.Failf("Failed to delete service %s/%s", namespace, name) } diff --git a/test/e2e/framework/statefulset/rest.go b/test/e2e/framework/statefulset/rest.go index d93fa565967..d9376b177eb 100644 --- a/test/e2e/framework/statefulset/rest.go +++ b/test/e2e/framework/statefulset/rest.go @@ -87,7 +87,7 @@ func DeleteAllStatefulSets(c clientset.Interface, ns string) { framework.Logf("Deleting statefulset %v", ss.Name) // Use OrphanDependents=false so it's deleted synchronously. // We already made sure the Pods are gone inside Scale(). - if err := c.AppsV1().StatefulSets(ss.Namespace).Delete(context.TODO(), ss.Name, &metav1.DeleteOptions{OrphanDependents: new(bool)}); err != nil { + if err := c.AppsV1().StatefulSets(ss.Namespace).Delete(context.TODO(), ss.Name, metav1.DeleteOptions{OrphanDependents: new(bool)}); err != nil { errList = append(errList, fmt.Sprintf("%v", err)) } } @@ -105,7 +105,7 @@ func DeleteAllStatefulSets(c clientset.Interface, ns string) { pvNames.Insert(pvc.Spec.VolumeName) // TODO: Double check that there are no pods referencing the pvc framework.Logf("Deleting pvc: %v with volume %v", pvc.Name, pvc.Spec.VolumeName) - if err := c.CoreV1().PersistentVolumeClaims(ns).Delete(context.TODO(), pvc.Name, nil); err != nil { + if err := c.CoreV1().PersistentVolumeClaims(ns).Delete(context.TODO(), pvc.Name, metav1.DeleteOptions{}); err != nil { return false, nil } } diff --git a/test/e2e/framework/util.go b/test/e2e/framework/util.go index 8c836c1c452..2ba9a595269 100644 --- a/test/e2e/framework/util.go +++ b/test/e2e/framework/util.go @@ -253,7 +253,7 @@ OUTER: go func(nsName string) { defer wg.Done() defer ginkgo.GinkgoRecover() - gomega.Expect(c.CoreV1().Namespaces().Delete(context.TODO(), nsName, nil)).To(gomega.Succeed()) + gomega.Expect(c.CoreV1().Namespaces().Delete(context.TODO(), nsName, metav1.DeleteOptions{})).To(gomega.Succeed()) Logf("namespace : %v api call to delete is complete ", nsName) }(item.Name) } @@ -814,7 +814,7 @@ func (f *Framework) MatchContainerOutput( createdPod := podClient.Create(pod) defer func() { ginkgo.By("delete the pod") - podClient.DeleteSync(createdPod.Name, &metav1.DeleteOptions{}, DefaultPodDeletionTimeout) + podClient.DeleteSync(createdPod.Name, metav1.DeleteOptions{}, DefaultPodDeletionTimeout) }() // Wait for client pod to complete. @@ -1181,7 +1181,7 @@ func DeleteResourceAndWaitForGC(c clientset.Interface, kind schema.GroupKind, ns defer ps.Stop() falseVar := false - deleteOption := &metav1.DeleteOptions{OrphanDependents: &falseVar} + deleteOption := metav1.DeleteOptions{OrphanDependents: &falseVar} startTime := time.Now() if err := testutils.DeleteResourceWithRetries(c, kind, ns, name, deleteOption); err != nil { return err diff --git a/test/e2e/framework/volume/fixtures.go b/test/e2e/framework/volume/fixtures.go index d48899ab62a..996110dffaf 100644 --- a/test/e2e/framework/volume/fixtures.go +++ b/test/e2e/framework/volume/fixtures.go @@ -312,7 +312,7 @@ func startVolumeServer(client clientset.Interface, config TestConfig) *v1.Pod { } if config.WaitForCompletion { framework.ExpectNoError(e2epod.WaitForPodSuccessInNamespace(client, serverPod.Name, serverPod.Namespace)) - framework.ExpectNoError(podClient.Delete(context.TODO(), serverPod.Name, nil)) + framework.ExpectNoError(podClient.Delete(context.TODO(), serverPod.Name, metav1.DeleteOptions{})) } else { framework.ExpectNoError(e2epod.WaitForPodRunningInNamespace(client, serverPod)) if pod == nil { diff --git a/test/e2e/instrumentation/monitoring/custom_metrics_stackdriver.go b/test/e2e/instrumentation/monitoring/custom_metrics_stackdriver.go index 553ba62e215..277b5a0ab24 100644 --- a/test/e2e/instrumentation/monitoring/custom_metrics_stackdriver.go +++ b/test/e2e/instrumentation/monitoring/custom_metrics_stackdriver.go @@ -124,7 +124,7 @@ func testCustomMetrics(f *framework.Framework, kubeClient clientset.Interface, c if err != nil { framework.Failf("Failed to create ClusterRoleBindings: %v", err) } - defer kubeClient.RbacV1().ClusterRoleBindings().Delete(context.TODO(), HPAPermissions.Name, &metav1.DeleteOptions{}) + defer kubeClient.RbacV1().ClusterRoleBindings().Delete(context.TODO(), HPAPermissions.Name, metav1.DeleteOptions{}) // Run application that exports the metric _, err = createSDExporterPods(f, kubeClient) @@ -172,7 +172,7 @@ func testExternalMetrics(f *framework.Framework, kubeClient clientset.Interface, if err != nil { framework.Failf("Failed to create ClusterRoleBindings: %v", err) } - defer kubeClient.RbacV1().ClusterRoleBindings().Delete(context.TODO(), HPAPermissions.Name, &metav1.DeleteOptions{}) + defer kubeClient.RbacV1().ClusterRoleBindings().Delete(context.TODO(), HPAPermissions.Name, metav1.DeleteOptions{}) // Run application that exports the metric pod, err := createSDExporterPods(f, kubeClient) @@ -258,11 +258,11 @@ func verifyResponseFromExternalMetricsAPI(f *framework.Framework, externalMetric } func cleanupSDExporterPod(f *framework.Framework, cs clientset.Interface) { - err := cs.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), stackdriverExporterPod1, &metav1.DeleteOptions{}) + err := cs.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), stackdriverExporterPod1, metav1.DeleteOptions{}) if err != nil { framework.Logf("Failed to delete %s pod: %v", stackdriverExporterPod1, err) } - err = cs.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), stackdriverExporterPod2, &metav1.DeleteOptions{}) + err = cs.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), stackdriverExporterPod2, metav1.DeleteOptions{}) if err != nil { framework.Logf("Failed to delete %s pod: %v", stackdriverExporterPod2, err) } diff --git a/test/e2e/instrumentation/monitoring/stackdriver_metadata_agent.go b/test/e2e/instrumentation/monitoring/stackdriver_metadata_agent.go index 9a9a22cbd47..321591344db 100644 --- a/test/e2e/instrumentation/monitoring/stackdriver_metadata_agent.go +++ b/test/e2e/instrumentation/monitoring/stackdriver_metadata_agent.go @@ -77,7 +77,7 @@ func testAgent(f *framework.Framework, kubeClient clientset.Interface) { _ = e2epod.CreateExecPodOrFail(kubeClient, f.Namespace.Name, uniqueContainerName, func(pod *v1.Pod) { pod.Spec.Containers[0].Name = uniqueContainerName }) - defer kubeClient.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), uniqueContainerName, &metav1.DeleteOptions{}) + defer kubeClient.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), uniqueContainerName, metav1.DeleteOptions{}) // Wait a short amount of time for Metadata Agent to be created and metadata to be exported time.Sleep(metadataWaitTime) diff --git a/test/e2e/kubectl/kubectl.go b/test/e2e/kubectl/kubectl.go index d9bff2464af..846b38c00a9 100644 --- a/test/e2e/kubectl/kubectl.go +++ b/test/e2e/kubectl/kubectl.go @@ -625,7 +625,7 @@ var _ = SIGDescribe("Kubectl client", func() { gomega.Expect(runOutput).To(gomega.ContainSubstring("abcd1234")) gomega.Expect(runOutput).To(gomega.ContainSubstring("stdin closed")) - gomega.Expect(c.CoreV1().Pods(ns).Delete(context.TODO(), "run-test", nil)).To(gomega.BeNil()) + gomega.Expect(c.CoreV1().Pods(ns).Delete(context.TODO(), "run-test", metav1.DeleteOptions{})).To(gomega.BeNil()) ginkgo.By("executing a command with run and attach without stdin") runOutput = framework.NewKubectlCommand(ns, fmt.Sprintf("--namespace=%v", ns), "run", "run-test-2", "--image="+busyboxImage, "--restart=OnFailure", "--attach=true", "--leave-stdin-open=true", "--", "sh", "-c", "cat && echo 'stdin closed'"). @@ -634,7 +634,7 @@ var _ = SIGDescribe("Kubectl client", func() { gomega.Expect(runOutput).ToNot(gomega.ContainSubstring("abcd1234")) gomega.Expect(runOutput).To(gomega.ContainSubstring("stdin closed")) - gomega.Expect(c.CoreV1().Pods(ns).Delete(context.TODO(), "run-test-2", nil)).To(gomega.BeNil()) + gomega.Expect(c.CoreV1().Pods(ns).Delete(context.TODO(), "run-test-2", metav1.DeleteOptions{})).To(gomega.BeNil()) ginkgo.By("executing a command with run and attach with stdin with open stdin should remain running") runOutput = framework.NewKubectlCommand(ns, nsFlag, "run", "run-test-3", "--image="+busyboxImage, "--restart=OnFailure", "--attach=true", "--leave-stdin-open=true", "--stdin", "--", "sh", "-c", "cat && echo 'stdin closed'"). @@ -660,7 +660,7 @@ var _ = SIGDescribe("Kubectl client", func() { }) gomega.Expect(err).To(gomega.BeNil()) - gomega.Expect(c.CoreV1().Pods(ns).Delete(context.TODO(), "run-test-3", nil)).To(gomega.BeNil()) + gomega.Expect(c.CoreV1().Pods(ns).Delete(context.TODO(), "run-test-3", metav1.DeleteOptions{})).To(gomega.BeNil()) }) ginkgo.It("should contain last line of the log", func() { diff --git a/test/e2e/lifecycle/bootstrap/bootstrap_signer.go b/test/e2e/lifecycle/bootstrap/bootstrap_signer.go index d4d5ca27179..d44e6ca6425 100644 --- a/test/e2e/lifecycle/bootstrap/bootstrap_signer.go +++ b/test/e2e/lifecycle/bootstrap/bootstrap_signer.go @@ -43,7 +43,7 @@ var _ = lifecycle.SIGDescribe("[Feature:BootstrapTokens]", func() { ginkgo.AfterEach(func() { if len(secretNeedClean) > 0 { ginkgo.By("delete the bootstrap token secret") - err := c.CoreV1().Secrets(metav1.NamespaceSystem).Delete(context.TODO(), secretNeedClean, &metav1.DeleteOptions{}) + err := c.CoreV1().Secrets(metav1.NamespaceSystem).Delete(context.TODO(), secretNeedClean, metav1.DeleteOptions{}) framework.ExpectNoError(err) secretNeedClean = "" } @@ -118,7 +118,7 @@ var _ = lifecycle.SIGDescribe("[Feature:BootstrapTokens]", func() { framework.ExpectNoError(err) ginkgo.By("delete the bootstrap token secret") - err = c.CoreV1().Secrets(metav1.NamespaceSystem).Delete(context.TODO(), bootstrapapi.BootstrapTokenSecretPrefix+tokenID, &metav1.DeleteOptions{}) + err = c.CoreV1().Secrets(metav1.NamespaceSystem).Delete(context.TODO(), bootstrapapi.BootstrapTokenSecretPrefix+tokenID, metav1.DeleteOptions{}) framework.ExpectNoError(err) ginkgo.By("wait for the bootstrap token removed from cluster-info ConfigMap") diff --git a/test/e2e/lifecycle/bootstrap/bootstrap_token_cleaner.go b/test/e2e/lifecycle/bootstrap/bootstrap_token_cleaner.go index 7eaeeb3bb68..c0c136d7e77 100644 --- a/test/e2e/lifecycle/bootstrap/bootstrap_token_cleaner.go +++ b/test/e2e/lifecycle/bootstrap/bootstrap_token_cleaner.go @@ -43,7 +43,7 @@ var _ = lifecycle.SIGDescribe("[Feature:BootstrapTokens]", func() { ginkgo.AfterEach(func() { if len(secretNeedClean) > 0 { ginkgo.By("delete the bootstrap token secret") - err := c.CoreV1().Secrets(metav1.NamespaceSystem).Delete(context.TODO(), secretNeedClean, &metav1.DeleteOptions{}) + err := c.CoreV1().Secrets(metav1.NamespaceSystem).Delete(context.TODO(), secretNeedClean, metav1.DeleteOptions{}) secretNeedClean = "" framework.ExpectNoError(err) } diff --git a/test/e2e/network/dns.go b/test/e2e/network/dns.go index 81df6aed721..3c9163fbaef 100644 --- a/test/e2e/network/dns.go +++ b/test/e2e/network/dns.go @@ -143,7 +143,7 @@ var _ = SIGDescribe("DNS", func() { defer func() { ginkgo.By("deleting the test headless service") defer ginkgo.GinkgoRecover() - f.ClientSet.CoreV1().Services(f.Namespace.Name).Delete(context.TODO(), headlessService.Name, nil) + f.ClientSet.CoreV1().Services(f.Namespace.Name).Delete(context.TODO(), headlessService.Name, metav1.DeleteOptions{}) }() regularServiceName := "test-service-2" @@ -154,7 +154,7 @@ var _ = SIGDescribe("DNS", func() { defer func() { ginkgo.By("deleting the test service") defer ginkgo.GinkgoRecover() - f.ClientSet.CoreV1().Services(f.Namespace.Name).Delete(context.TODO(), regularService.Name, nil) + f.ClientSet.CoreV1().Services(f.Namespace.Name).Delete(context.TODO(), regularService.Name, metav1.DeleteOptions{}) }() // All the names we need to be able to resolve. @@ -198,7 +198,7 @@ var _ = SIGDescribe("DNS", func() { defer func() { ginkgo.By("deleting the test headless service") defer ginkgo.GinkgoRecover() - f.ClientSet.CoreV1().Services(f.Namespace.Name).Delete(context.TODO(), headlessService.Name, nil) + f.ClientSet.CoreV1().Services(f.Namespace.Name).Delete(context.TODO(), headlessService.Name, metav1.DeleteOptions{}) }() regularServiceName := "test-service-2" @@ -208,7 +208,7 @@ var _ = SIGDescribe("DNS", func() { defer func() { ginkgo.By("deleting the test service") defer ginkgo.GinkgoRecover() - f.ClientSet.CoreV1().Services(f.Namespace.Name).Delete(context.TODO(), regularService.Name, nil) + f.ClientSet.CoreV1().Services(f.Namespace.Name).Delete(context.TODO(), regularService.Name, metav1.DeleteOptions{}) }() // All the names we need to be able to resolve. @@ -256,7 +256,7 @@ var _ = SIGDescribe("DNS", func() { defer func() { ginkgo.By("deleting the test headless service") defer ginkgo.GinkgoRecover() - f.ClientSet.CoreV1().Services(f.Namespace.Name).Delete(context.TODO(), headlessService.Name, nil) + f.ClientSet.CoreV1().Services(f.Namespace.Name).Delete(context.TODO(), headlessService.Name, metav1.DeleteOptions{}) }() hostFQDN := fmt.Sprintf("%s.%s.%s.svc.%s", podHostname, serviceName, f.Namespace.Name, framework.TestContext.ClusterDNSDomain) @@ -298,7 +298,7 @@ var _ = SIGDescribe("DNS", func() { defer func() { ginkgo.By("deleting the test headless service") defer ginkgo.GinkgoRecover() - f.ClientSet.CoreV1().Services(f.Namespace.Name).Delete(context.TODO(), headlessService.Name, nil) + f.ClientSet.CoreV1().Services(f.Namespace.Name).Delete(context.TODO(), headlessService.Name, metav1.DeleteOptions{}) }() hostFQDN := fmt.Sprintf("%s.%s.%s.svc.%s", podHostname, serviceName, f.Namespace.Name, framework.TestContext.ClusterDNSDomain) @@ -337,7 +337,7 @@ var _ = SIGDescribe("DNS", func() { defer func() { ginkgo.By("deleting the test externalName service") defer ginkgo.GinkgoRecover() - f.ClientSet.CoreV1().Services(f.Namespace.Name).Delete(context.TODO(), externalNameService.Name, nil) + f.ClientSet.CoreV1().Services(f.Namespace.Name).Delete(context.TODO(), externalNameService.Name, metav1.DeleteOptions{}) }() hostFQDN := fmt.Sprintf("%s.%s.svc.%s", serviceName, f.Namespace.Name, framework.TestContext.ClusterDNSDomain) wheezyProbeCmd, wheezyFileName := createTargetedProbeCommand(hostFQDN, "CNAME", "wheezy") @@ -419,7 +419,7 @@ var _ = SIGDescribe("DNS", func() { framework.Logf("Created pod %v", testAgnhostPod) defer func() { framework.Logf("Deleting pod %s...", testAgnhostPod.Name) - if err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), testAgnhostPod.Name, metav1.NewDeleteOptions(0)); err != nil { + if err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), testAgnhostPod.Name, *metav1.NewDeleteOptions(0)); err != nil { framework.Failf("ginkgo.Failed to delete pod %s: %v", testAgnhostPod.Name, err) } }() @@ -468,7 +468,7 @@ var _ = SIGDescribe("DNS", func() { defer func() { framework.Logf("Deleting configmap %s...", corednsConfig.Name) - err := f.ClientSet.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), corednsConfig.Name, nil) + err := f.ClientSet.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), corednsConfig.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "Failed to delete configmap %s: %v", corednsConfig.Name) }() @@ -478,7 +478,7 @@ var _ = SIGDescribe("DNS", func() { framework.Logf("Created pod %v", testServerPod) defer func() { framework.Logf("Deleting pod %s...", testServerPod.Name) - if err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), testServerPod.Name, metav1.NewDeleteOptions(0)); err != nil { + if err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), testServerPod.Name, *metav1.NewDeleteOptions(0)); err != nil { framework.Failf("ginkgo.Failed to delete pod %s: %v", testServerPod.Name, err) } }() @@ -510,7 +510,7 @@ var _ = SIGDescribe("DNS", func() { framework.Logf("Created pod %v", testUtilsPod) defer func() { framework.Logf("Deleting pod %s...", testUtilsPod.Name) - if err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), testUtilsPod.Name, metav1.NewDeleteOptions(0)); err != nil { + if err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), testUtilsPod.Name, *metav1.NewDeleteOptions(0)); err != nil { framework.Failf("ginkgo.Failed to delete pod %s: %v", testUtilsPod.Name, err) } }() diff --git a/test/e2e/network/dns_common.go b/test/e2e/network/dns_common.go index 82204067bb8..70e78610cbd 100644 --- a/test/e2e/network/dns_common.go +++ b/test/e2e/network/dns_common.go @@ -184,14 +184,14 @@ func (t *dnsTestCommon) restoreDNSConfigMap(configMapData map[string]string) { t.setConfigMap(&v1.ConfigMap{Data: configMapData}) t.deleteCoreDNSPods() } else { - t.c.CoreV1().ConfigMaps(t.ns).Delete(context.TODO(), t.name, nil) + t.c.CoreV1().ConfigMaps(t.ns).Delete(context.TODO(), t.name, metav1.DeleteOptions{}) } } func (t *dnsTestCommon) deleteConfigMap() { ginkgo.By(fmt.Sprintf("Deleting the ConfigMap (%s:%s)", t.ns, t.name)) t.cm = nil - err := t.c.CoreV1().ConfigMaps(t.ns).Delete(context.TODO(), t.name, nil) + err := t.c.CoreV1().ConfigMaps(t.ns).Delete(context.TODO(), t.name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete config map: %s", t.name) } @@ -256,7 +256,7 @@ func (t *dnsTestCommon) createUtilPodLabel(baseName string) { func (t *dnsTestCommon) deleteUtilPod() { podClient := t.c.CoreV1().Pods(t.f.Namespace.Name) - if err := podClient.Delete(context.TODO(), t.utilPod.Name, metav1.NewDeleteOptions(0)); err != nil { + if err := podClient.Delete(context.TODO(), t.utilPod.Name, *metav1.NewDeleteOptions(0)); err != nil { framework.Logf("Delete of pod %v/%v failed: %v", t.utilPod.Namespace, t.utilPod.Name, err) } @@ -273,7 +273,7 @@ func (t *dnsTestCommon) deleteCoreDNSPods() { podClient := t.c.CoreV1().Pods(metav1.NamespaceSystem) for _, pod := range pods.Items { - err = podClient.Delete(context.TODO(), pod.Name, metav1.NewDeleteOptions(0)) + err = podClient.Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err, "failed to delete pod: %s", pod.Name) } } @@ -382,7 +382,7 @@ func (t *dnsTestCommon) createDNSServerWithPtrRecord(namespace string, isIPv6 bo func (t *dnsTestCommon) deleteDNSServerPod() { podClient := t.c.CoreV1().Pods(t.f.Namespace.Name) - if err := podClient.Delete(context.TODO(), t.dnsServerPod.Name, metav1.NewDeleteOptions(0)); err != nil { + if err := podClient.Delete(context.TODO(), t.dnsServerPod.Name, *metav1.NewDeleteOptions(0)); err != nil { framework.Logf("Delete of pod %v/%v failed: %v", t.utilPod.Namespace, t.dnsServerPod.Name, err) } @@ -577,7 +577,7 @@ func validateDNSResults(f *framework.Framework, pod *v1.Pod, fileNames []string) defer func() { ginkgo.By("deleting the pod") defer ginkgo.GinkgoRecover() - podClient.Delete(context.TODO(), pod.Name, metav1.NewDeleteOptions(0)) + podClient.Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(0)) }() if _, err := podClient.Create(context.TODO(), pod, metav1.CreateOptions{}); err != nil { framework.Failf("ginkgo.Failed to create pod %s/%s: %v", pod.Namespace, pod.Name, err) @@ -605,7 +605,7 @@ func validateTargetedProbeOutput(f *framework.Framework, pod *v1.Pod, fileNames defer func() { ginkgo.By("deleting the pod") defer ginkgo.GinkgoRecover() - podClient.Delete(context.TODO(), pod.Name, metav1.NewDeleteOptions(0)) + podClient.Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(0)) }() if _, err := podClient.Create(context.TODO(), pod, metav1.CreateOptions{}); err != nil { framework.Failf("ginkgo.Failed to create pod %s/%s: %v", pod.Namespace, pod.Name, err) diff --git a/test/e2e/network/dns_configmap.go b/test/e2e/network/dns_configmap.go index ed8593a5026..9bf545000f5 100644 --- a/test/e2e/network/dns_configmap.go +++ b/test/e2e/network/dns_configmap.go @@ -58,7 +58,7 @@ var _ = SIGDescribe("DNS configMap federations [Feature:Federation]", func() { func (t *dnsFederationsConfigMapTest) run() { t.init() - defer t.c.CoreV1().ConfigMaps(t.ns).Delete(context.TODO(), t.name, nil) + defer t.c.CoreV1().ConfigMaps(t.ns).Delete(context.TODO(), t.name, metav1.DeleteOptions{}) t.createUtilPodLabel("e2e-dns-configmap") defer t.deleteUtilPod() originalConfigMapData := t.fetchDNSConfigMapData() @@ -425,8 +425,8 @@ func (t *dnsExternalNameTest) run(isIPv6 bool) { defer func() { ginkgo.By("deleting the test externalName service") defer ginkgo.GinkgoRecover() - f.ClientSet.CoreV1().Services(f.Namespace.Name).Delete(context.TODO(), externalNameService.Name, nil) - f.ClientSet.CoreV1().Services(f.Namespace.Name).Delete(context.TODO(), externalNameServiceLocal.Name, nil) + f.ClientSet.CoreV1().Services(f.Namespace.Name).Delete(context.TODO(), externalNameService.Name, metav1.DeleteOptions{}) + f.ClientSet.CoreV1().Services(f.Namespace.Name).Delete(context.TODO(), externalNameServiceLocal.Name, metav1.DeleteOptions{}) }() if isIPv6 { diff --git a/test/e2e/network/dual_stack.go b/test/e2e/network/dual_stack.go index 59c3c8c7e83..5bf70d13268 100644 --- a/test/e2e/network/dual_stack.go +++ b/test/e2e/network/dual_stack.go @@ -115,7 +115,7 @@ var _ = SIGDescribe("[Feature:IPv6DualStackAlphaFeature] [LinuxOnly]", func() { framework.ExpectEqual(isIPv4(p.Status.PodIPs[0].IP) != isIPv4(p.Status.PodIPs[1].IP), true) ginkgo.By("deleting the pod") - err = podClient.Delete(context.TODO(), pod.Name, metav1.NewDeleteOptions(30)) + err = podClient.Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(30)) framework.ExpectNoError(err, "failed to delete pod") }) diff --git a/test/e2e/network/firewall.go b/test/e2e/network/firewall.go index 426fa5527ca..8efe59bd347 100644 --- a/test/e2e/network/firewall.go +++ b/test/e2e/network/firewall.go @@ -99,7 +99,7 @@ var _ = SIGDescribe("Firewall rule", func() { svc.Spec.LoadBalancerSourceRanges = nil }) framework.ExpectNoError(err) - err = cs.CoreV1().Services(svc.Namespace).Delete(context.TODO(), svc.Name, nil) + err = cs.CoreV1().Services(svc.Namespace).Delete(context.TODO(), svc.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err) ginkgo.By("Waiting for the local traffic health check firewall rule to be deleted") localHCFwName := gce.MakeHealthCheckFirewallNameForLBService(clusterID, cloudprovider.DefaultLoadBalancerName(svc), false) @@ -159,7 +159,7 @@ var _ = SIGDescribe("Firewall rule", func() { defer func() { framework.Logf("Cleaning up the netexec pod: %v", podName) - err = cs.CoreV1().Pods(ns).Delete(context.TODO(), podName, nil) + err = cs.CoreV1().Pods(ns).Delete(context.TODO(), podName, metav1.DeleteOptions{}) framework.ExpectNoError(err) }() } diff --git a/test/e2e/network/fixture.go b/test/e2e/network/fixture.go index bfe07231415..269d80a0b91 100644 --- a/test/e2e/network/fixture.go +++ b/test/e2e/network/fixture.go @@ -103,7 +103,7 @@ func (t *TestFixture) CreateService(service *v1.Service) (*v1.Service, error) { // DeleteService deletes a service, and remove it from the cleanup list func (t *TestFixture) DeleteService(serviceName string) error { - err := t.Client.CoreV1().Services(t.Namespace).Delete(context.TODO(), serviceName, nil) + err := t.Client.CoreV1().Services(t.Namespace).Delete(context.TODO(), serviceName, metav1.DeleteOptions{}) if err == nil { delete(t.services, serviceName) } @@ -139,7 +139,7 @@ func (t *TestFixture) Cleanup() []error { } // TODO(mikedanese): Wait. // Then, delete the RC altogether. - if err := t.Client.CoreV1().ReplicationControllers(t.Namespace).Delete(context.TODO(), rcName, nil); err != nil { + if err := t.Client.CoreV1().ReplicationControllers(t.Namespace).Delete(context.TODO(), rcName, metav1.DeleteOptions{}); err != nil { if !apierrors.IsNotFound(err) { errs = append(errs, err) } @@ -148,7 +148,7 @@ func (t *TestFixture) Cleanup() []error { for serviceName := range t.services { ginkgo.By("deleting service " + serviceName + " in namespace " + t.Namespace) - err := t.Client.CoreV1().Services(t.Namespace).Delete(context.TODO(), serviceName, nil) + err := t.Client.CoreV1().Services(t.Namespace).Delete(context.TODO(), serviceName, metav1.DeleteOptions{}) if err != nil { if !apierrors.IsNotFound(err) { errs = append(errs, err) diff --git a/test/e2e/network/ingressclass.go b/test/e2e/network/ingressclass.go index e2e4e51ed88..8df59460814 100644 --- a/test/e2e/network/ingressclass.go +++ b/test/e2e/network/ingressclass.go @@ -118,6 +118,6 @@ func createBasicIngress(cs clientset.Interface, namespace string) (*networkingv1 } func deleteIngressClass(cs clientset.Interface, name string) { - err := cs.NetworkingV1beta1().IngressClasses().Delete(context.TODO(), name, &metav1.DeleteOptions{}) + err := cs.NetworkingV1beta1().IngressClasses().Delete(context.TODO(), name, metav1.DeleteOptions{}) framework.ExpectNoError(err) } diff --git a/test/e2e/network/network_policy.go b/test/e2e/network/network_policy.go index c8dbab391b0..f0d5ac74362 100644 --- a/test/e2e/network/network_policy.go +++ b/test/e2e/network/network_policy.go @@ -858,7 +858,7 @@ var _ = SIGDescribe("NetworkPolicy [LinuxOnly]", func() { podClient := createNetworkClientPodWithRestartPolicy(f, f.Namespace, "client-a", service, allowedPort, v1.RestartPolicyOnFailure) defer func() { ginkgo.By(fmt.Sprintf("Cleaning up the pod %s", podClient.Name)) - if err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), podClient.Name, nil); err != nil { + if err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), podClient.Name, metav1.DeleteOptions{}); err != nil { framework.Failf("unable to cleanup pod %v: %v", podClient.Name, err) } }() @@ -1491,7 +1491,7 @@ func testCanConnect(f *framework.Framework, ns *v1.Namespace, podName string, se podClient := createNetworkClientPod(f, ns, podName, service, targetPort) defer func() { ginkgo.By(fmt.Sprintf("Cleaning up the pod %s", podClient.Name)) - if err := f.ClientSet.CoreV1().Pods(ns.Name).Delete(context.TODO(), podClient.Name, nil); err != nil { + if err := f.ClientSet.CoreV1().Pods(ns.Name).Delete(context.TODO(), podClient.Name, metav1.DeleteOptions{}); err != nil { framework.Failf("unable to cleanup pod %v: %v", podClient.Name, err) } }() @@ -1503,7 +1503,7 @@ func testCannotConnect(f *framework.Framework, ns *v1.Namespace, podName string, podClient := createNetworkClientPod(f, ns, podName, service, targetPort) defer func() { ginkgo.By(fmt.Sprintf("Cleaning up the pod %s", podClient.Name)) - if err := f.ClientSet.CoreV1().Pods(ns.Name).Delete(context.TODO(), podClient.Name, nil); err != nil { + if err := f.ClientSet.CoreV1().Pods(ns.Name).Delete(context.TODO(), podClient.Name, metav1.DeleteOptions{}); err != nil { framework.Failf("unable to cleanup pod %v: %v", podClient.Name, err) } }() @@ -1670,11 +1670,11 @@ func createServerPodAndService(f *framework.Framework, namespace *v1.Namespace, func cleanupServerPodAndService(f *framework.Framework, pod *v1.Pod, service *v1.Service) { ginkgo.By("Cleaning up the server.") - if err := f.ClientSet.CoreV1().Pods(pod.Namespace).Delete(context.TODO(), pod.Name, nil); err != nil { + if err := f.ClientSet.CoreV1().Pods(pod.Namespace).Delete(context.TODO(), pod.Name, metav1.DeleteOptions{}); err != nil { framework.Failf("unable to cleanup pod %v: %v", pod.Name, err) } ginkgo.By("Cleaning up the server's service.") - if err := f.ClientSet.CoreV1().Services(service.Namespace).Delete(context.TODO(), service.Name, nil); err != nil { + if err := f.ClientSet.CoreV1().Services(service.Namespace).Delete(context.TODO(), service.Name, metav1.DeleteOptions{}); err != nil { framework.Failf("unable to cleanup svc %v: %v", service.Name, err) } } @@ -1740,7 +1740,7 @@ func updatePodLabel(f *framework.Framework, namespace *v1.Namespace, podName str func cleanupNetworkPolicy(f *framework.Framework, policy *networkingv1.NetworkPolicy) { ginkgo.By("Cleaning up the policy.") - if err := f.ClientSet.NetworkingV1().NetworkPolicies(policy.Namespace).Delete(context.TODO(), policy.Name, nil); err != nil { + if err := f.ClientSet.NetworkingV1().NetworkPolicies(policy.Namespace).Delete(context.TODO(), policy.Name, metav1.DeleteOptions{}); err != nil { framework.Failf("unable to cleanup policy %v: %v", policy.Name, err) } } diff --git a/test/e2e/network/scale/ingress.go b/test/e2e/network/scale/ingress.go index 27f716facc7..8c786407755 100644 --- a/test/e2e/network/scale/ingress.go +++ b/test/e2e/network/scale/ingress.go @@ -135,7 +135,7 @@ func (f *IngressScaleFramework) CleanupScaleTest() []error { f.Logger.Infof("Cleaning up ingresses...") for _, ing := range f.ScaleTestIngs { if ing != nil { - if err := f.Clientset.NetworkingV1beta1().Ingresses(ing.Namespace).Delete(context.TODO(), ing.Name, nil); err != nil { + if err := f.Clientset.NetworkingV1beta1().Ingresses(ing.Namespace).Delete(context.TODO(), ing.Name, metav1.DeleteOptions{}); err != nil { errs = append(errs, fmt.Errorf("error while deleting ingress %s/%s: %v", ing.Namespace, ing.Name, err)) } } @@ -143,14 +143,14 @@ func (f *IngressScaleFramework) CleanupScaleTest() []error { f.Logger.Infof("Cleaning up services...") for _, svc := range f.ScaleTestSvcs { if svc != nil { - if err := f.Clientset.CoreV1().Services(svc.Namespace).Delete(context.TODO(), svc.Name, nil); err != nil { + if err := f.Clientset.CoreV1().Services(svc.Namespace).Delete(context.TODO(), svc.Name, metav1.DeleteOptions{}); err != nil { errs = append(errs, fmt.Errorf("error while deleting service %s/%s: %v", svc.Namespace, svc.Name, err)) } } } if f.ScaleTestDeploy != nil { f.Logger.Infof("Cleaning up deployment %s...", f.ScaleTestDeploy.Name) - if err := f.Clientset.AppsV1().Deployments(f.ScaleTestDeploy.Namespace).Delete(context.TODO(), f.ScaleTestDeploy.Name, nil); err != nil { + if err := f.Clientset.AppsV1().Deployments(f.ScaleTestDeploy.Namespace).Delete(context.TODO(), f.ScaleTestDeploy.Name, metav1.DeleteOptions{}); err != nil { errs = append(errs, fmt.Errorf("error while delting deployment %s/%s: %v", f.ScaleTestDeploy.Namespace, f.ScaleTestDeploy.Name, err)) } } diff --git a/test/e2e/network/scale/localrun/ingress_scale.go b/test/e2e/network/scale/localrun/ingress_scale.go index 0f229fc16fc..e4b54f0e974 100644 --- a/test/e2e/network/scale/localrun/ingress_scale.go +++ b/test/e2e/network/scale/localrun/ingress_scale.go @@ -144,7 +144,7 @@ func main() { if cleanup { defer func() { klog.Infof("Deleting namespace %s...", ns.Name) - if err := cs.CoreV1().Namespaces().Delete(context.TODO(), ns.Name, nil); err != nil { + if err := cs.CoreV1().Namespaces().Delete(context.TODO(), ns.Name, metav1.DeleteOptions{}); err != nil { klog.Errorf("Failed to delete namespace %s: %v", ns.Name, err) testSuccessFlag = false } diff --git a/test/e2e/network/service.go b/test/e2e/network/service.go index 42db66cfe38..ff9fd5fc114 100644 --- a/test/e2e/network/service.go +++ b/test/e2e/network/service.go @@ -255,7 +255,7 @@ func StopServeHostnameService(clientset clientset.Interface, ns, name string) er if err := e2erc.DeleteRCAndWaitForGC(clientset, ns, name); err != nil { return err } - if err := clientset.CoreV1().Services(ns).Delete(context.TODO(), name, nil); err != nil { + if err := clientset.CoreV1().Services(ns).Delete(context.TODO(), name, metav1.DeleteOptions{}); err != nil { return err } return nil @@ -735,7 +735,7 @@ var _ = SIGDescribe("Services", func() { ginkgo.By("creating service " + serviceName + " in namespace " + ns) defer func() { - err := cs.CoreV1().Services(ns).Delete(context.TODO(), serviceName, nil) + err := cs.CoreV1().Services(ns).Delete(context.TODO(), serviceName, metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete service: %s in namespace: %s", serviceName, ns) }() _, err := jig.CreateTCPServiceWithPort(nil, 80) @@ -747,7 +747,7 @@ var _ = SIGDescribe("Services", func() { names := map[string]bool{} defer func() { for name := range names { - err := cs.CoreV1().Pods(ns).Delete(context.TODO(), name, nil) + err := cs.CoreV1().Pods(ns).Delete(context.TODO(), name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete pod: %s in namespace: %s", name, ns) } }() @@ -788,7 +788,7 @@ var _ = SIGDescribe("Services", func() { jig := e2eservice.NewTestJig(cs, ns, serviceName) defer func() { - err := cs.CoreV1().Services(ns).Delete(context.TODO(), serviceName, nil) + err := cs.CoreV1().Services(ns).Delete(context.TODO(), serviceName, metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete service: %s in namespace: %s", serviceName, ns) }() @@ -820,7 +820,7 @@ var _ = SIGDescribe("Services", func() { names := map[string]bool{} defer func() { for name := range names { - err := cs.CoreV1().Pods(ns).Delete(context.TODO(), name, nil) + err := cs.CoreV1().Pods(ns).Delete(context.TODO(), name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete pod: %s in namespace: %s", name, ns) } }() @@ -886,7 +886,7 @@ var _ = SIGDescribe("Services", func() { framework.ExpectNoError(err) defer func() { framework.Logf("Cleaning up the sourceip test service") - err := cs.CoreV1().Services(ns).Delete(context.TODO(), serviceName, nil) + err := cs.CoreV1().Services(ns).Delete(context.TODO(), serviceName, metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete service: %s in namespace: %s", serviceName, ns) }() serviceIP := tcpService.Spec.ClusterIP @@ -909,7 +909,7 @@ var _ = SIGDescribe("Services", func() { framework.ExpectNoError(f.WaitForPodReady(pod.Name)) defer func() { framework.Logf("Cleaning up the echo server pod") - err := cs.CoreV1().Pods(ns).Delete(context.TODO(), serverPodName, nil) + err := cs.CoreV1().Pods(ns).Delete(context.TODO(), serverPodName, metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete pod: %s on node", serverPodName) }() @@ -922,7 +922,7 @@ var _ = SIGDescribe("Services", func() { defer func() { framework.Logf("Deleting deployment") - err = cs.AppsV1().Deployments(ns).Delete(context.TODO(), deployment.Name, &metav1.DeleteOptions{}) + err = cs.AppsV1().Deployments(ns).Delete(context.TODO(), deployment.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "Failed to delete deployment %s", deployment.Name) }() @@ -1544,7 +1544,7 @@ var _ = SIGDescribe("Services", func() { framework.ExpectNoError(err) defer func() { framework.Logf("Cleaning up the updating NodePorts test service") - err := cs.CoreV1().Services(ns).Delete(context.TODO(), serviceName, nil) + err := cs.CoreV1().Services(ns).Delete(context.TODO(), serviceName, metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete service: %s in namespace: %s", serviceName, ns) }() framework.Logf("Service Port TCP: %v", tcpService.Spec.Ports[0].Port) @@ -1616,7 +1616,7 @@ var _ = SIGDescribe("Services", func() { framework.ExpectNoError(err) defer func() { framework.Logf("Cleaning up the ExternalName to ClusterIP test service") - err := cs.CoreV1().Services(ns).Delete(context.TODO(), serviceName, nil) + err := cs.CoreV1().Services(ns).Delete(context.TODO(), serviceName, metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete service %s in namespace %s", serviceName, ns) }() @@ -1655,7 +1655,7 @@ var _ = SIGDescribe("Services", func() { framework.ExpectNoError(err) defer func() { framework.Logf("Cleaning up the ExternalName to NodePort test service") - err := cs.CoreV1().Services(ns).Delete(context.TODO(), serviceName, nil) + err := cs.CoreV1().Services(ns).Delete(context.TODO(), serviceName, metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete service %s in namespace %s", serviceName, ns) }() @@ -1693,7 +1693,7 @@ var _ = SIGDescribe("Services", func() { framework.ExpectNoError(err) defer func() { framework.Logf("Cleaning up the ClusterIP to ExternalName test service") - err := cs.CoreV1().Services(ns).Delete(context.TODO(), serviceName, nil) + err := cs.CoreV1().Services(ns).Delete(context.TODO(), serviceName, metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete service %s in namespace %s", serviceName, ns) }() @@ -1735,7 +1735,7 @@ var _ = SIGDescribe("Services", func() { framework.ExpectNoError(err) defer func() { framework.Logf("Cleaning up the NodePort to ExternalName test service") - err := cs.CoreV1().Services(ns).Delete(context.TODO(), serviceName, nil) + err := cs.CoreV1().Services(ns).Delete(context.TODO(), serviceName, metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete service %s in namespace %s", serviceName, ns) }() @@ -2081,7 +2081,7 @@ var _ = SIGDescribe("Services", func() { } else { for _, pod := range pods.Items { var gracePeriodSeconds int64 = 0 - err := podClient.Delete(context.TODO(), pod.Name, &metav1.DeleteOptions{GracePeriodSeconds: &gracePeriodSeconds}) + err := podClient.Delete(context.TODO(), pod.Name, metav1.DeleteOptions{GracePeriodSeconds: &gracePeriodSeconds}) if err != nil { framework.Logf("warning: error force deleting pod '%s': %s", pod.Name, err) } @@ -2733,7 +2733,7 @@ var _ = SIGDescribe("ESIPP [Slow] [DisabledForLargeClusters]", func() { err := TestHTTPHealthCheckNodePort(ips[0], healthCheckNodePort, "/healthz", e2eservice.KubeProxyEndpointLagTimeout, false, threshold) framework.ExpectNoError(err) } - err = cs.CoreV1().Services(svc.Namespace).Delete(context.TODO(), svc.Name, nil) + err = cs.CoreV1().Services(svc.Namespace).Delete(context.TODO(), svc.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err) }() @@ -2759,7 +2759,7 @@ var _ = SIGDescribe("ESIPP [Slow] [DisabledForLargeClusters]", func() { svc, err := jig.CreateOnlyLocalNodePortService(true) framework.ExpectNoError(err) defer func() { - err := cs.CoreV1().Services(svc.Namespace).Delete(context.TODO(), svc.Name, nil) + err := cs.CoreV1().Services(svc.Namespace).Delete(context.TODO(), svc.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err) }() @@ -2802,7 +2802,7 @@ var _ = SIGDescribe("ESIPP [Slow] [DisabledForLargeClusters]", func() { defer func() { err = jig.ChangeServiceType(v1.ServiceTypeClusterIP, loadBalancerCreateTimeout) framework.ExpectNoError(err) - err := cs.CoreV1().Services(svc.Namespace).Delete(context.TODO(), svc.Name, nil) + err := cs.CoreV1().Services(svc.Namespace).Delete(context.TODO(), svc.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err) }() @@ -2863,7 +2863,7 @@ var _ = SIGDescribe("ESIPP [Slow] [DisabledForLargeClusters]", func() { defer func() { err = jig.ChangeServiceType(v1.ServiceTypeClusterIP, loadBalancerCreateTimeout) framework.ExpectNoError(err) - err := cs.CoreV1().Services(svc.Namespace).Delete(context.TODO(), svc.Name, nil) + err := cs.CoreV1().Services(svc.Namespace).Delete(context.TODO(), svc.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err) }() @@ -2878,7 +2878,7 @@ var _ = SIGDescribe("ESIPP [Slow] [DisabledForLargeClusters]", func() { defer func() { framework.Logf("Deleting deployment") - err = cs.AppsV1().Deployments(namespace).Delete(context.TODO(), deployment.Name, &metav1.DeleteOptions{}) + err = cs.AppsV1().Deployments(namespace).Delete(context.TODO(), deployment.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "Failed to delete deployment %s", deployment.Name) }() @@ -2926,7 +2926,7 @@ var _ = SIGDescribe("ESIPP [Slow] [DisabledForLargeClusters]", func() { defer func() { err = jig.ChangeServiceType(v1.ServiceTypeClusterIP, loadBalancerCreateTimeout) framework.ExpectNoError(err) - err := cs.CoreV1().Services(svc.Namespace).Delete(context.TODO(), svc.Name, nil) + err := cs.CoreV1().Services(svc.Namespace).Delete(context.TODO(), svc.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err) }() @@ -3094,7 +3094,7 @@ func execAffinityTestForSessionAffinityTimeout(f *framework.Framework, cs client execPod := e2epod.CreateExecPodOrFail(cs, ns, "execpod-affinity", nil) defer func() { framework.Logf("Cleaning up the exec pod") - err := cs.CoreV1().Pods(ns).Delete(context.TODO(), execPod.Name, nil) + err := cs.CoreV1().Pods(ns).Delete(context.TODO(), execPod.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete pod: %s in namespace: %s", execPod.Name, ns) }() err = jig.CheckServiceReachability(svc, execPod) @@ -3161,7 +3161,7 @@ func execAffinityTestForNonLBServiceWithOptionalTransition(f *framework.Framewor execPod := e2epod.CreateExecPodOrFail(cs, ns, "execpod-affinity", nil) defer func() { framework.Logf("Cleaning up the exec pod") - err := cs.CoreV1().Pods(ns).Delete(context.TODO(), execPod.Name, nil) + err := cs.CoreV1().Pods(ns).Delete(context.TODO(), execPod.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete pod: %s in namespace: %s", execPod.Name, ns) }() err = jig.CheckServiceReachability(svc, execPod) @@ -3341,7 +3341,7 @@ func proxyMode(f *framework.Framework) (string, error) { }, } f.PodClient().CreateSync(pod) - defer f.PodClient().DeleteSync(pod.Name, &metav1.DeleteOptions{}, framework.DefaultPodDeletionTimeout) + defer f.PodClient().DeleteSync(pod.Name, metav1.DeleteOptions{}, framework.DefaultPodDeletionTimeout) cmd := "curl -q -s --connect-timeout 1 http://localhost:10249/proxyMode" stdout, err := framework.RunHostCmd(pod.Namespace, pod.Name, cmd) diff --git a/test/e2e/node/events.go b/test/e2e/node/events.go index 6112aa98fbf..50729b4ad56 100644 --- a/test/e2e/node/events.go +++ b/test/e2e/node/events.go @@ -70,7 +70,7 @@ var _ = SIGDescribe("Events", func() { ginkgo.By("submitting the pod to kubernetes") defer func() { ginkgo.By("deleting the pod") - podClient.Delete(context.TODO(), pod.Name, nil) + podClient.Delete(context.TODO(), pod.Name, metav1.DeleteOptions{}) }() if _, err := podClient.Create(context.TODO(), pod, metav1.CreateOptions{}); err != nil { framework.Failf("Failed to create pod: %v", err) diff --git a/test/e2e/node/pods.go b/test/e2e/node/pods.go index 04e76695f96..657b1ec5f82 100644 --- a/test/e2e/node/pods.go +++ b/test/e2e/node/pods.go @@ -292,7 +292,7 @@ var _ = SIGDescribe("Pods Extended", func() { t := time.Duration(rand.Intn(delay)) * time.Millisecond time.Sleep(t) - err := podClient.Delete(context.TODO(), pod.Name, nil) + err := podClient.Delete(context.TODO(), pod.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete pod") events, ok := <-ch diff --git a/test/e2e/node/pre_stop.go b/test/e2e/node/pre_stop.go index c805c8e6b72..66f9b70740b 100644 --- a/test/e2e/node/pre_stop.go +++ b/test/e2e/node/pre_stop.go @@ -66,7 +66,7 @@ func testPreStop(c clientset.Interface, ns string) { // At the end of the test, clean up by removing the pod. defer func() { ginkgo.By("Deleting the server pod") - c.CoreV1().Pods(ns).Delete(context.TODO(), podDescr.Name, nil) + c.CoreV1().Pods(ns).Delete(context.TODO(), podDescr.Name, metav1.DeleteOptions{}) }() ginkgo.By("Waiting for pods to come up.") @@ -113,7 +113,7 @@ func testPreStop(c clientset.Interface, ns string) { defer func() { if deletePreStop { ginkgo.By("Deleting the tester pod") - c.CoreV1().Pods(ns).Delete(context.TODO(), preStopDescr.Name, nil) + c.CoreV1().Pods(ns).Delete(context.TODO(), preStopDescr.Name, metav1.DeleteOptions{}) } }() @@ -122,7 +122,7 @@ func testPreStop(c clientset.Interface, ns string) { // Delete the pod with the preStop handler. ginkgo.By("Deleting pre-stop pod") - if err := c.CoreV1().Pods(ns).Delete(context.TODO(), preStopDescr.Name, nil); err == nil { + if err := c.CoreV1().Pods(ns).Delete(context.TODO(), preStopDescr.Name, metav1.DeleteOptions{}); err == nil { deletePreStop = false } framework.ExpectNoError(err, fmt.Sprintf("deleting pod: %s", preStopDescr.Name)) @@ -198,7 +198,7 @@ var _ = SIGDescribe("PreStop", func() { framework.ExpectNoError(err, "failed to GET scheduled pod") ginkgo.By("deleting the pod gracefully") - err = podClient.Delete(context.TODO(), pod.Name, metav1.NewDeleteOptions(gracefulTerminationPeriodSeconds)) + err = podClient.Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(gracefulTerminationPeriodSeconds)) framework.ExpectNoError(err, "failed to delete pod") //wait up to graceful termination period seconds diff --git a/test/e2e/scheduling/limit_range.go b/test/e2e/scheduling/limit_range.go index 19c3991111a..975750b547d 100644 --- a/test/e2e/scheduling/limit_range.go +++ b/test/e2e/scheduling/limit_range.go @@ -201,7 +201,7 @@ var _ = SIGDescribe("LimitRange", func() { framework.ExpectError(err) ginkgo.By("Deleting a LimitRange") - err = f.ClientSet.CoreV1().LimitRanges(f.Namespace.Name).Delete(context.TODO(), limitRange.Name, metav1.NewDeleteOptions(30)) + err = f.ClientSet.CoreV1().LimitRanges(f.Namespace.Name).Delete(context.TODO(), limitRange.Name, *metav1.NewDeleteOptions(30)) framework.ExpectNoError(err) ginkgo.By("Verifying the LimitRange was deleted") diff --git a/test/e2e/scheduling/predicates.go b/test/e2e/scheduling/predicates.go index 32314e76eca..2e11e22fafa 100644 --- a/test/e2e/scheduling/predicates.go +++ b/test/e2e/scheduling/predicates.go @@ -267,7 +267,7 @@ var _ = SIGDescribe("SchedulerPredicates [Serial]", func() { } // remove RuntimeClass - cs.NodeV1beta1().RuntimeClasses().Delete(context.TODO(), e2enode.PreconfiguredRuntimeClassHandler(framework.TestContext.ContainerRuntime), nil) + cs.NodeV1beta1().RuntimeClasses().Delete(context.TODO(), e2enode.PreconfiguredRuntimeClassHandler(framework.TestContext.ContainerRuntime), metav1.DeleteOptions{}) }) ginkgo.It("verify pod overhead is accounted for", func() { @@ -879,7 +879,7 @@ func runPodAndGetNodeName(f *framework.Framework, conf pausePodConfig) string { pod := runPausePod(f, conf) ginkgo.By("Explicitly delete pod here to free the resource it takes.") - err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod.Name, metav1.NewDeleteOptions(0)) + err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err) return pod.Spec.NodeName diff --git a/test/e2e/scheduling/preemption.go b/test/e2e/scheduling/preemption.go index 9afcd8adde4..50f3a26f1b3 100644 --- a/test/e2e/scheduling/preemption.go +++ b/test/e2e/scheduling/preemption.go @@ -73,7 +73,7 @@ var _ = SIGDescribe("SchedulerPreemption [Serial]", func() { ginkgo.AfterEach(func() { for _, pair := range priorityPairs { - cs.SchedulingV1().PriorityClasses().Delete(context.TODO(), pair.name, metav1.NewDeleteOptions(0)) + cs.SchedulingV1().PriorityClasses().Delete(context.TODO(), pair.name, *metav1.NewDeleteOptions(0)) } }) @@ -239,7 +239,7 @@ var _ = SIGDescribe("SchedulerPreemption [Serial]", func() { defer func() { // Clean-up the critical pod // Always run cleanup to make sure the pod is properly cleaned up. - err := f.ClientSet.CoreV1().Pods(metav1.NamespaceSystem).Delete(context.TODO(), "critical-pod", metav1.NewDeleteOptions(0)) + err := f.ClientSet.CoreV1().Pods(metav1.NamespaceSystem).Delete(context.TODO(), "critical-pod", *metav1.NewDeleteOptions(0)) if err != nil && !apierrors.IsNotFound(err) { framework.Failf("Error cleanup pod `%s/%s`: %v", metav1.NamespaceSystem, "critical-pod", err) } @@ -256,7 +256,7 @@ var _ = SIGDescribe("SchedulerPreemption [Serial]", func() { defer func() { // Clean-up the critical pod - err := f.ClientSet.CoreV1().Pods(metav1.NamespaceSystem).Delete(context.TODO(), "critical-pod", metav1.NewDeleteOptions(0)) + err := f.ClientSet.CoreV1().Pods(metav1.NamespaceSystem).Delete(context.TODO(), "critical-pod", *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err) }() // Make sure that the lowest priority pod is deleted. @@ -460,7 +460,7 @@ var _ = SIGDescribe("SchedulerPreemption [Serial]", func() { framework.ExpectNoError(err) } for _, pair := range priorityPairs { - cs.SchedulingV1().PriorityClasses().Delete(context.TODO(), pair.name, metav1.NewDeleteOptions(0)) + cs.SchedulingV1().PriorityClasses().Delete(context.TODO(), pair.name, *metav1.NewDeleteOptions(0)) } }) diff --git a/test/e2e/scheduling/ubernetes_lite_volumes.go b/test/e2e/scheduling/ubernetes_lite_volumes.go index 462e4230229..956735bf649 100644 --- a/test/e2e/scheduling/ubernetes_lite_volumes.go +++ b/test/e2e/scheduling/ubernetes_lite_volumes.go @@ -144,7 +144,7 @@ func OnlyAllowNodeZones(f *framework.Framework, zoneCount int, image string) { // Defer the cleanup defer func() { framework.Logf("deleting claim %q/%q", pvc.Namespace, pvc.Name) - err = c.CoreV1().PersistentVolumeClaims(pvc.Namespace).Delete(context.TODO(), pvc.Name, nil) + err = c.CoreV1().PersistentVolumeClaims(pvc.Namespace).Delete(context.TODO(), pvc.Name, metav1.DeleteOptions{}) if err != nil { framework.Failf("Error deleting claim %q. Error: %v", pvc.Name, err) } diff --git a/test/e2e/storage/csi_mock_volume.go b/test/e2e/storage/csi_mock_volume.go index 8a050537a3c..53637bc2ab9 100644 --- a/test/e2e/storage/csi_mock_volume.go +++ b/test/e2e/storage/csi_mock_volume.go @@ -187,7 +187,7 @@ var _ = utils.SIGDescribe("CSI mock volume", func() { ginkgo.By(fmt.Sprintf("Deleting claim %s", claim.Name)) claim, err := cs.CoreV1().PersistentVolumeClaims(claim.Namespace).Get(context.TODO(), claim.Name, metav1.GetOptions{}) if err == nil { - cs.CoreV1().PersistentVolumeClaims(claim.Namespace).Delete(context.TODO(), claim.Name, nil) + cs.CoreV1().PersistentVolumeClaims(claim.Namespace).Delete(context.TODO(), claim.Name, metav1.DeleteOptions{}) framework.WaitForPersistentVolumeDeleted(cs, claim.Spec.VolumeName, framework.Poll, 2*time.Minute) } @@ -195,7 +195,7 @@ var _ = utils.SIGDescribe("CSI mock volume", func() { for _, sc := range m.sc { ginkgo.By(fmt.Sprintf("Deleting storageclass %s", sc.Name)) - cs.StorageV1().StorageClasses().Delete(context.TODO(), sc.Name, nil) + cs.StorageV1().StorageClasses().Delete(context.TODO(), sc.Name, metav1.DeleteOptions{}) } ginkgo.By("Cleaning up resources") @@ -787,7 +787,7 @@ func destroyCSIDriver(cs clientset.Interface, driverName string) { framework.Logf("deleting %s.%s: %s", driverGet.TypeMeta.APIVersion, driverGet.TypeMeta.Kind, driverGet.ObjectMeta.Name) // Uncomment the following line to get full dump of CSIDriver object // framework.Logf("%s", framework.PrettyPrint(driverGet)) - cs.StorageV1beta1().CSIDrivers().Delete(context.TODO(), driverName, nil) + cs.StorageV1beta1().CSIDrivers().Delete(context.TODO(), driverName, metav1.DeleteOptions{}) } } diff --git a/test/e2e/storage/drivers/in_tree.go b/test/e2e/storage/drivers/in_tree.go index 6999d5c5101..d66a20f8951 100644 --- a/test/e2e/storage/drivers/in_tree.go +++ b/test/e2e/storage/drivers/in_tree.go @@ -183,7 +183,7 @@ func (n *nfsDriver) PrepareTest(f *framework.Framework) (*testsuites.PerTestConf }, func() { framework.ExpectNoError(e2epod.DeletePodWithWait(cs, n.externalProvisionerPod)) clusterRoleBindingName := ns.Name + "--" + "cluster-admin" - cs.RbacV1().ClusterRoleBindings().Delete(context.TODO(), clusterRoleBindingName, metav1.NewDeleteOptions(0)) + cs.RbacV1().ClusterRoleBindings().Delete(context.TODO(), clusterRoleBindingName, *metav1.NewDeleteOptions(0)) } } @@ -325,7 +325,7 @@ func (v *glusterVolume) DeleteVolume() { name := v.prefix + "-server" framework.Logf("Deleting Gluster endpoints %q...", name) - err := cs.CoreV1().Endpoints(ns.Name).Delete(context.TODO(), name, nil) + err := cs.CoreV1().Endpoints(ns.Name).Delete(context.TODO(), name, metav1.DeleteOptions{}) if err != nil { if !apierrors.IsNotFound(err) { framework.Failf("Gluster delete endpoints failed: %v", err) @@ -1944,7 +1944,7 @@ func cleanUpVolumeServerWithSecret(f *framework.Framework, serverPod *v1.Pod, se if secret != nil { framework.Logf("Deleting server secret %q...", secret.Name) - err := cs.CoreV1().Secrets(ns.Name).Delete(context.TODO(), secret.Name, &metav1.DeleteOptions{}) + err := cs.CoreV1().Secrets(ns.Name).Delete(context.TODO(), secret.Name, metav1.DeleteOptions{}) if err != nil { framework.Logf("Delete secret failed: %v", err) } diff --git a/test/e2e/storage/empty_dir_wrapper.go b/test/e2e/storage/empty_dir_wrapper.go index 6fcadeebdd8..f8e4b58a538 100644 --- a/test/e2e/storage/empty_dir_wrapper.go +++ b/test/e2e/storage/empty_dir_wrapper.go @@ -148,15 +148,15 @@ var _ = utils.SIGDescribe("EmptyDir wrapper volumes", func() { defer func() { ginkgo.By("Cleaning up the secret") - if err := f.ClientSet.CoreV1().Secrets(f.Namespace.Name).Delete(context.TODO(), secret.Name, nil); err != nil { + if err := f.ClientSet.CoreV1().Secrets(f.Namespace.Name).Delete(context.TODO(), secret.Name, metav1.DeleteOptions{}); err != nil { framework.Failf("unable to delete secret %v: %v", secret.Name, err) } ginkgo.By("Cleaning up the configmap") - if err := f.ClientSet.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), configMap.Name, nil); err != nil { + if err := f.ClientSet.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), configMap.Name, metav1.DeleteOptions{}); err != nil { framework.Failf("unable to delete configmap %v: %v", configMap.Name, err) } ginkgo.By("Cleaning up the pod") - if err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod.Name, metav1.NewDeleteOptions(0)); err != nil { + if err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(0)); err != nil { framework.Failf("unable to delete pod %v: %v", pod.Name, err) } }() @@ -260,11 +260,11 @@ func createGitServer(f *framework.Framework) (gitURL string, gitRepo string, cle return "http://" + gitServerSvc.Spec.ClusterIP + ":" + strconv.Itoa(httpPort), "test", func() { ginkgo.By("Cleaning up the git server pod") - if err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), gitServerPod.Name, metav1.NewDeleteOptions(0)); err != nil { + if err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), gitServerPod.Name, *metav1.NewDeleteOptions(0)); err != nil { framework.Failf("unable to delete git server pod %v: %v", gitServerPod.Name, err) } ginkgo.By("Cleaning up the git server svc") - if err := f.ClientSet.CoreV1().Services(f.Namespace.Name).Delete(context.TODO(), gitServerSvc.Name, nil); err != nil { + if err := f.ClientSet.CoreV1().Services(f.Namespace.Name).Delete(context.TODO(), gitServerSvc.Name, metav1.DeleteOptions{}); err != nil { framework.Failf("unable to delete git server svc %v: %v", gitServerSvc.Name, err) } } @@ -313,7 +313,7 @@ func createConfigmapsForRace(f *framework.Framework) (configMapNames []string) { func deleteConfigMaps(f *framework.Framework, configMapNames []string) { ginkgo.By("Cleaning up the configMaps") for _, configMapName := range configMapNames { - err := f.ClientSet.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), configMapName, nil) + err := f.ClientSet.CoreV1().ConfigMaps(f.Namespace.Name).Delete(context.TODO(), configMapName, metav1.DeleteOptions{}) framework.ExpectNoError(err, "unable to delete configMap %v", configMapName) } } diff --git a/test/e2e/storage/flexvolume_mounted_volume_resize.go b/test/e2e/storage/flexvolume_mounted_volume_resize.go index 9b2d273771d..3246a83d9b3 100644 --- a/test/e2e/storage/flexvolume_mounted_volume_resize.go +++ b/test/e2e/storage/flexvolume_mounted_volume_resize.go @@ -155,7 +155,7 @@ var _ = utils.SIGDescribe("Mounted flexvolume expand[Slow]", func() { ginkgo.By("Creating a deployment with the provisioned volume") deployment, err := e2edeploy.CreateDeployment(c, int32(1), map[string]string{"test": "app"}, nodeKeyValueLabel, ns, pvcClaims, "") framework.ExpectNoError(err, "Failed creating deployment %v", err) - defer c.AppsV1().Deployments(ns).Delete(context.TODO(), deployment.Name, &metav1.DeleteOptions{}) + defer c.AppsV1().Deployments(ns).Delete(context.TODO(), deployment.Name, metav1.DeleteOptions{}) ginkgo.By("Expanding current pvc") newSize := resource.MustParse("6Gi") diff --git a/test/e2e/storage/mounted_volume_resize.go b/test/e2e/storage/mounted_volume_resize.go index c1e28cbe35e..763975208a6 100644 --- a/test/e2e/storage/mounted_volume_resize.go +++ b/test/e2e/storage/mounted_volume_resize.go @@ -122,7 +122,7 @@ var _ = utils.SIGDescribe("Mounted volume expand", func() { ginkgo.By("Creating a deployment with selected PVC") deployment, err := e2edeploy.CreateDeployment(c, int32(1), map[string]string{"test": "app"}, nodeKeyValueLabel, ns, pvcClaims, "") framework.ExpectNoError(err, "Failed creating deployment %v", err) - defer c.AppsV1().Deployments(ns).Delete(context.TODO(), deployment.Name, &metav1.DeleteOptions{}) + defer c.AppsV1().Deployments(ns).Delete(context.TODO(), deployment.Name, metav1.DeleteOptions{}) // PVC should be bound at this point ginkgo.By("Checking for bound PVC") diff --git a/test/e2e/storage/pd.go b/test/e2e/storage/pd.go index b3a04a297d6..b6638fd5808 100644 --- a/test/e2e/storage/pd.go +++ b/test/e2e/storage/pd.go @@ -99,30 +99,30 @@ var _ = utils.SIGDescribe("Pod Disks", func() { false: "RW", } type testT struct { - descr string // It description - readOnly bool // true means pd is read-only - deleteOpt *metav1.DeleteOptions // pod delete option + descr string // It description + readOnly bool // true means pd is read-only + deleteOpt metav1.DeleteOptions // pod delete option } tests := []testT{ { descr: podImmediateGrace, readOnly: false, - deleteOpt: metav1.NewDeleteOptions(0), + deleteOpt: *metav1.NewDeleteOptions(0), }, { descr: podDefaultGrace, readOnly: false, - deleteOpt: &metav1.DeleteOptions{}, + deleteOpt: metav1.DeleteOptions{}, }, { descr: podImmediateGrace, readOnly: true, - deleteOpt: metav1.NewDeleteOptions(0), + deleteOpt: *metav1.NewDeleteOptions(0), }, { descr: podDefaultGrace, readOnly: true, - deleteOpt: &metav1.DeleteOptions{}, + deleteOpt: metav1.DeleteOptions{}, }, } @@ -151,7 +151,7 @@ var _ = utils.SIGDescribe("Pod Disks", func() { framework.ExpectNoError(f.WaitForPodRunningSlow(fmtPod.Name)) ginkgo.By("deleting the fmtPod") - framework.ExpectNoError(podClient.Delete(context.TODO(), fmtPod.Name, metav1.NewDeleteOptions(0)), "Failed to delete fmtPod") + framework.ExpectNoError(podClient.Delete(context.TODO(), fmtPod.Name, *metav1.NewDeleteOptions(0)), "Failed to delete fmtPod") framework.Logf("deleted fmtPod %q", fmtPod.Name) ginkgo.By("waiting for PD to detach") framework.ExpectNoError(waitForPDDetach(diskName, host0Name)) @@ -269,7 +269,7 @@ var _ = utils.SIGDescribe("Pod Disks", func() { ginkgo.By("defer: cleaning up PD-RW test environment") framework.Logf("defer cleanup errors can usually be ignored") if host0Pod != nil { - podClient.Delete(context.TODO(), host0Pod.Name, metav1.NewDeleteOptions(0)) + podClient.Delete(context.TODO(), host0Pod.Name, *metav1.NewDeleteOptions(0)) } for _, diskName := range diskNames { detachAndDeletePDs(diskName, []types.NodeName{host0Name}) @@ -305,7 +305,7 @@ var _ = utils.SIGDescribe("Pod Disks", func() { verifyPDContentsViaContainer(ns, f, host0Pod.Name, containerName, fileAndContentToVerify) ginkgo.By("deleting host0Pod") - framework.ExpectNoError(podClient.Delete(context.TODO(), host0Pod.Name, metav1.NewDeleteOptions(0)), "Failed to delete host0Pod") + framework.ExpectNoError(podClient.Delete(context.TODO(), host0Pod.Name, *metav1.NewDeleteOptions(0)), "Failed to delete host0Pod") } ginkgo.By(fmt.Sprintf("Test completed successfully, waiting for %d PD(s) to detach from node0", numPDs)) for _, diskName := range diskNames { @@ -360,7 +360,7 @@ var _ = utils.SIGDescribe("Pod Disks", func() { ginkgo.By("defer: cleaning up PD-RW test env") framework.Logf("defer cleanup errors can usually be ignored") ginkgo.By("defer: delete host0Pod") - podClient.Delete(context.TODO(), host0Pod.Name, metav1.NewDeleteOptions(0)) + podClient.Delete(context.TODO(), host0Pod.Name, *metav1.NewDeleteOptions(0)) ginkgo.By("defer: detach and delete PDs") detachAndDeletePDs(diskName, []types.NodeName{host0Name}) if disruptOp == deleteNode || disruptOp == deleteNodeObj { @@ -417,9 +417,9 @@ var _ = utils.SIGDescribe("Pod Disks", func() { } else if disruptOp == deleteNodeObj { ginkgo.By("deleting host0's node api object") - framework.ExpectNoError(nodeClient.Delete(context.TODO(), string(host0Name), metav1.NewDeleteOptions(0)), "Unable to delete host0's node object") + framework.ExpectNoError(nodeClient.Delete(context.TODO(), string(host0Name), *metav1.NewDeleteOptions(0)), "Unable to delete host0's node object") ginkgo.By("deleting host0Pod") - framework.ExpectNoError(podClient.Delete(context.TODO(), host0Pod.Name, metav1.NewDeleteOptions(0)), "Unable to delete host0Pod") + framework.ExpectNoError(podClient.Delete(context.TODO(), host0Pod.Name, *metav1.NewDeleteOptions(0)), "Unable to delete host0Pod") } else if disruptOp == evictPod { evictTarget := &policyv1beta1.Eviction{ diff --git a/test/e2e/storage/persistent_volumes-gce.go b/test/e2e/storage/persistent_volumes-gce.go index df81345fabd..8b0343e4b58 100644 --- a/test/e2e/storage/persistent_volumes-gce.go +++ b/test/e2e/storage/persistent_volumes-gce.go @@ -154,7 +154,7 @@ var _ = utils.SIGDescribe("PersistentVolumes GCEPD", func() { ginkgo.It("should test that deleting the Namespace of a PVC and Pod causes the successful detach of Persistent Disk [Flaky]", func() { ginkgo.By("Deleting the Namespace") - err := c.CoreV1().Namespaces().Delete(context.TODO(), ns, nil) + err := c.CoreV1().Namespaces().Delete(context.TODO(), ns, metav1.DeleteOptions{}) framework.ExpectNoError(err) err = framework.WaitForNamespacesDeleted(c, []string{ns}, framework.DefaultNamespaceDeletionTimeout) diff --git a/test/e2e/storage/persistent_volumes-local.go b/test/e2e/storage/persistent_volumes-local.go index 470e6849185..ca2d06c5b49 100644 --- a/test/e2e/storage/persistent_volumes-local.go +++ b/test/e2e/storage/persistent_volumes-local.go @@ -487,7 +487,7 @@ var _ = utils.SIGDescribe("PersistentVolumes-local ", func() { if localVolume.pv.Name != pv.Name { continue } - err = config.client.CoreV1().PersistentVolumes().Delete(context.TODO(), pv.Name, &metav1.DeleteOptions{}) + err = config.client.CoreV1().PersistentVolumes().Delete(context.TODO(), pv.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err) pvConfig := makeLocalPVConfig(config, localVolume) localVolume.pv, err = e2epv.CreatePV(config.client, e2epv.MakePersistentVolume(pvConfig)) @@ -628,7 +628,7 @@ var _ = utils.SIGDescribe("PersistentVolumes-local ", func() { return } ginkgo.By(fmt.Sprintf("Clean PV %s", pv.Name)) - err := config.client.CoreV1().PersistentVolumes().Delete(context.TODO(), pv.Name, &metav1.DeleteOptions{}) + err := config.client.CoreV1().PersistentVolumes().Delete(context.TODO(), pv.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err) }) @@ -673,7 +673,7 @@ var _ = utils.SIGDescribe("PersistentVolumes-local ", func() { func deletePodAndPVCs(config *localTestConfig, pod *v1.Pod) error { framework.Logf("Deleting pod %v", pod.Name) - if err := config.client.CoreV1().Pods(config.ns).Delete(context.TODO(), pod.Name, nil); err != nil { + if err := config.client.CoreV1().Pods(config.ns).Delete(context.TODO(), pod.Name, metav1.DeleteOptions{}); err != nil { return err } @@ -796,7 +796,7 @@ func setupStorageClass(config *localTestConfig, mode *storagev1.VolumeBindingMod } func cleanupStorageClass(config *localTestConfig) { - framework.ExpectNoError(config.client.StorageV1().StorageClasses().Delete(context.TODO(), config.scName, nil)) + framework.ExpectNoError(config.client.StorageV1().StorageClasses().Delete(context.TODO(), config.scName, metav1.DeleteOptions{})) } // podNode wraps RunKubectl to get node where pod is running diff --git a/test/e2e/storage/persistent_volumes.go b/test/e2e/storage/persistent_volumes.go index 48068a88908..c63b49e5361 100644 --- a/test/e2e/storage/persistent_volumes.go +++ b/test/e2e/storage/persistent_volumes.go @@ -362,7 +362,7 @@ var _ = utils.SIGDescribe("PersistentVolumes", func() { ss, err = e2esset.Scale(c, ss, 0) framework.ExpectNoError(err) e2esset.WaitForStatusReplicas(c, ss, 0) - err = c.AppsV1().StatefulSets(ns).Delete(context.TODO(), ss.Name, &metav1.DeleteOptions{}) + err = c.AppsV1().StatefulSets(ns).Delete(context.TODO(), ss.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err) ginkgo.By("Creating a new Statefulset and validating the data") diff --git a/test/e2e/storage/pv_protection.go b/test/e2e/storage/pv_protection.go index f742c77d920..05f67513b72 100644 --- a/test/e2e/storage/pv_protection.go +++ b/test/e2e/storage/pv_protection.go @@ -98,7 +98,7 @@ var _ = utils.SIGDescribe("PV Protection", func() { ginkgo.It("Verify \"immediate\" deletion of a PV that is not bound to a PVC", func() { ginkgo.By("Deleting the PV") - err = client.CoreV1().PersistentVolumes().Delete(context.TODO(), pv.Name, metav1.NewDeleteOptions(0)) + err = client.CoreV1().PersistentVolumes().Delete(context.TODO(), pv.Name, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err, "Error deleting PV") framework.WaitForPersistentVolumeDeleted(client, pv.Name, framework.Poll, e2epv.PVDeletingTimeout) }) @@ -114,7 +114,7 @@ var _ = utils.SIGDescribe("PV Protection", func() { framework.ExpectNoError(err, "Failed waiting for PVC to be bound %v", err) ginkgo.By("Deleting the PV, however, the PV must not be removed from the system as it's bound to a PVC") - err = client.CoreV1().PersistentVolumes().Delete(context.TODO(), pv.Name, metav1.NewDeleteOptions(0)) + err = client.CoreV1().PersistentVolumes().Delete(context.TODO(), pv.Name, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err, "Error deleting PV") ginkgo.By("Checking that the PV status is Terminating") @@ -123,7 +123,7 @@ var _ = utils.SIGDescribe("PV Protection", func() { framework.ExpectNotEqual(pv.ObjectMeta.DeletionTimestamp, nil) ginkgo.By("Deleting the PVC that is bound to the PV") - err = client.CoreV1().PersistentVolumeClaims(pvc.Namespace).Delete(context.TODO(), pvc.Name, metav1.NewDeleteOptions(0)) + err = client.CoreV1().PersistentVolumeClaims(pvc.Namespace).Delete(context.TODO(), pvc.Name, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err, "Error deleting PVC") ginkgo.By("Checking that the PV is automatically removed from the system because it's no longer bound to a PVC") diff --git a/test/e2e/storage/pvc_protection.go b/test/e2e/storage/pvc_protection.go index 91d81a52b21..b2ab547bd05 100644 --- a/test/e2e/storage/pvc_protection.go +++ b/test/e2e/storage/pvc_protection.go @@ -115,7 +115,7 @@ var _ = utils.SIGDescribe("PVC Protection", func() { framework.ExpectNoError(err, "Error terminating and deleting pod") ginkgo.By("Deleting the PVC") - err = client.CoreV1().PersistentVolumeClaims(pvc.Namespace).Delete(context.TODO(), pvc.Name, metav1.NewDeleteOptions(0)) + err = client.CoreV1().PersistentVolumeClaims(pvc.Namespace).Delete(context.TODO(), pvc.Name, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err, "Error deleting PVC") waitForPersistentVolumeClaimDeleted(client, pvc.Namespace, pvc.Name, framework.Poll, claimDeletingTimeout) pvcCreatedAndNotDeleted = false @@ -123,7 +123,7 @@ var _ = utils.SIGDescribe("PVC Protection", func() { ginkgo.It("Verify that PVC in active use by a pod is not removed immediately", func() { ginkgo.By("Deleting the PVC, however, the PVC must not be removed from the system as it's in active use by a pod") - err = client.CoreV1().PersistentVolumeClaims(pvc.Namespace).Delete(context.TODO(), pvc.Name, metav1.NewDeleteOptions(0)) + err = client.CoreV1().PersistentVolumeClaims(pvc.Namespace).Delete(context.TODO(), pvc.Name, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err, "Error deleting PVC") ginkgo.By("Checking that the PVC status is Terminating") @@ -142,7 +142,7 @@ var _ = utils.SIGDescribe("PVC Protection", func() { ginkgo.It("Verify that scheduling of a pod that uses PVC that is being deleted fails and the pod becomes Unschedulable", func() { ginkgo.By("Deleting the PVC, however, the PVC must not be removed from the system as it's in active use by a pod") - err = client.CoreV1().PersistentVolumeClaims(pvc.Namespace).Delete(context.TODO(), pvc.Name, metav1.NewDeleteOptions(0)) + err = client.CoreV1().PersistentVolumeClaims(pvc.Namespace).Delete(context.TODO(), pvc.Name, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err, "Error deleting PVC") ginkgo.By("Checking that the PVC status is Terminating") diff --git a/test/e2e/storage/regional_pd.go b/test/e2e/storage/regional_pd.go index 3b87d27dc27..f1746a3143c 100644 --- a/test/e2e/storage/regional_pd.go +++ b/test/e2e/storage/regional_pd.go @@ -188,7 +188,7 @@ func testZonalFailover(c clientset.Interface, ns string) { framework.ExpectNoError(err) defer func() { framework.Logf("deleting storage class %s", class.Name) - framework.ExpectNoError(c.StorageV1().StorageClasses().Delete(context.TODO(), class.Name, nil), + framework.ExpectNoError(c.StorageV1().StorageClasses().Delete(context.TODO(), class.Name, metav1.DeleteOptions{}), "Error deleting StorageClass %s", class.Name) }() @@ -201,12 +201,12 @@ func testZonalFailover(c clientset.Interface, ns string) { defer func() { framework.Logf("deleting statefulset%q/%q", statefulSet.Namespace, statefulSet.Name) // typically this claim has already been deleted - framework.ExpectNoError(c.AppsV1().StatefulSets(ns).Delete(context.TODO(), statefulSet.Name, nil), + framework.ExpectNoError(c.AppsV1().StatefulSets(ns).Delete(context.TODO(), statefulSet.Name, metav1.DeleteOptions{}), "Error deleting StatefulSet %s", statefulSet.Name) framework.Logf("deleting claims in namespace %s", ns) pvc := getPVC(c, ns, regionalPDLabels) - framework.ExpectNoError(c.CoreV1().PersistentVolumeClaims(pvc.Namespace).Delete(context.TODO(), pvc.Name, nil), + framework.ExpectNoError(c.CoreV1().PersistentVolumeClaims(pvc.Namespace).Delete(context.TODO(), pvc.Name, metav1.DeleteOptions{}), "Error deleting claim %s.", pvc.Name) if pvc.Spec.VolumeName != "" { err = framework.WaitForPersistentVolumeDeleted(c, pvc.Spec.VolumeName, framework.Poll, pvDeletionTimeout) @@ -244,7 +244,7 @@ func testZonalFailover(c clientset.Interface, ns string) { }() ginkgo.By("deleting StatefulSet pod") - err = c.CoreV1().Pods(ns).Delete(context.TODO(), pod.Name, &metav1.DeleteOptions{}) + err = c.CoreV1().Pods(ns).Delete(context.TODO(), pod.Name, metav1.DeleteOptions{}) // Verify the pod is scheduled in the other zone. ginkgo.By("verifying the pod is scheduled in a different zone.") diff --git a/test/e2e/storage/testsuites/base.go b/test/e2e/storage/testsuites/base.go index 0ace7c28119..1f619102e2a 100644 --- a/test/e2e/storage/testsuites/base.go +++ b/test/e2e/storage/testsuites/base.go @@ -408,7 +408,7 @@ func isDelayedBinding(sc *storagev1.StorageClass) bool { // deleteStorageClass deletes the passed in StorageClass and catches errors other than "Not Found" func deleteStorageClass(cs clientset.Interface, className string) error { - err := cs.StorageV1().StorageClasses().Delete(context.TODO(), className, nil) + err := cs.StorageV1().StorageClasses().Delete(context.TODO(), className, metav1.DeleteOptions{}) if err != nil && !apierrors.IsNotFound(err) { return err } diff --git a/test/e2e/storage/testsuites/provisioning.go b/test/e2e/storage/testsuites/provisioning.go index 4dc4aeb6d8e..58cad0d3708 100644 --- a/test/e2e/storage/testsuites/provisioning.go +++ b/test/e2e/storage/testsuites/provisioning.go @@ -334,7 +334,7 @@ func (t StorageClassTest) TestDynamicProvisioning() *v1.PersistentVolume { framework.ExpectNoError(err) defer func() { framework.Logf("deleting storage class %s", class.Name) - framework.ExpectNoError(client.StorageV1().StorageClasses().Delete(context.TODO(), class.Name, nil)) + framework.ExpectNoError(client.StorageV1().StorageClasses().Delete(context.TODO(), class.Name, metav1.DeleteOptions{})) }() } @@ -344,7 +344,7 @@ func (t StorageClassTest) TestDynamicProvisioning() *v1.PersistentVolume { defer func() { framework.Logf("deleting claim %q/%q", claim.Namespace, claim.Name) // typically this claim has already been deleted - err = client.CoreV1().PersistentVolumeClaims(claim.Namespace).Delete(context.TODO(), claim.Name, nil) + err = client.CoreV1().PersistentVolumeClaims(claim.Namespace).Delete(context.TODO(), claim.Name, metav1.DeleteOptions{}) if err != nil && !apierrors.IsNotFound(err) { framework.Failf("Error deleting claim %q. Error: %v", claim.Name, err) } @@ -358,7 +358,7 @@ func (t StorageClassTest) TestDynamicProvisioning() *v1.PersistentVolume { pv := t.checkProvisioning(client, claim, class) ginkgo.By(fmt.Sprintf("deleting claim %q/%q", claim.Namespace, claim.Name)) - framework.ExpectNoError(client.CoreV1().PersistentVolumeClaims(claim.Namespace).Delete(context.TODO(), claim.Name, nil)) + framework.ExpectNoError(client.CoreV1().PersistentVolumeClaims(claim.Namespace).Delete(context.TODO(), claim.Name, metav1.DeleteOptions{})) // Wait for the PV to get deleted if reclaim policy is Delete. (If it's // Retain, there's no use waiting because the PV won't be auto-deleted and @@ -770,7 +770,7 @@ func prepareSnapshotDataSourceForProvisioning( } framework.Logf("deleting initClaim %q/%q", updatedClaim.Namespace, updatedClaim.Name) - err = client.CoreV1().PersistentVolumeClaims(updatedClaim.Namespace).Delete(context.TODO(), updatedClaim.Name, nil) + err = client.CoreV1().PersistentVolumeClaims(updatedClaim.Namespace).Delete(context.TODO(), updatedClaim.Name, metav1.DeleteOptions{}) if err != nil && !apierrors.IsNotFound(err) { framework.Failf("Error deleting initClaim %q. Error: %v", updatedClaim.Name, err) } @@ -819,13 +819,13 @@ func preparePVCDataSourceForProvisioning( cleanupFunc := func() { framework.Logf("deleting source PVC %q/%q", sourcePVC.Namespace, sourcePVC.Name) - err := client.CoreV1().PersistentVolumeClaims(sourcePVC.Namespace).Delete(context.TODO(), sourcePVC.Name, nil) + err := client.CoreV1().PersistentVolumeClaims(sourcePVC.Namespace).Delete(context.TODO(), sourcePVC.Name, metav1.DeleteOptions{}) if err != nil && !apierrors.IsNotFound(err) { framework.Failf("Error deleting source PVC %q. Error: %v", sourcePVC.Name, err) } if class != nil { framework.Logf("deleting class %q", class.Name) - err := client.StorageV1().StorageClasses().Delete(context.TODO(), class.Name, nil) + err := client.StorageV1().StorageClasses().Delete(context.TODO(), class.Name, metav1.DeleteOptions{}) if err != nil && !apierrors.IsNotFound(err) { framework.Failf("Error deleting storage class %q. Error: %v", class.Name, err) } diff --git a/test/e2e/storage/testsuites/snapshottable.go b/test/e2e/storage/testsuites/snapshottable.go index 4bb9f28f177..73702cd3e02 100644 --- a/test/e2e/storage/testsuites/snapshottable.go +++ b/test/e2e/storage/testsuites/snapshottable.go @@ -137,7 +137,7 @@ func (s *snapshottableTestSuite) DefineTests(driver TestDriver, pattern testpatt framework.ExpectNoError(err) defer func() { framework.Logf("deleting storage class %s", class.Name) - framework.ExpectNoError(cs.StorageV1().StorageClasses().Delete(context.TODO(), class.Name, nil)) + framework.ExpectNoError(cs.StorageV1().StorageClasses().Delete(context.TODO(), class.Name, metav1.DeleteOptions{})) }() ginkgo.By("creating a claim") @@ -146,7 +146,7 @@ func (s *snapshottableTestSuite) DefineTests(driver TestDriver, pattern testpatt defer func() { framework.Logf("deleting claim %q/%q", pvc.Namespace, pvc.Name) // typically this claim has already been deleted - err = cs.CoreV1().PersistentVolumeClaims(pvc.Namespace).Delete(context.TODO(), pvc.Name, nil) + err = cs.CoreV1().PersistentVolumeClaims(pvc.Namespace).Delete(context.TODO(), pvc.Name, metav1.DeleteOptions{}) if err != nil && !apierrors.IsNotFound(err) { framework.Failf("Error deleting claim %q. Error: %v", pvc.Name, err) } diff --git a/test/e2e/storage/testsuites/volumelimits.go b/test/e2e/storage/testsuites/volumelimits.go index dfd754eeeb8..438ce54d592 100644 --- a/test/e2e/storage/testsuites/volumelimits.go +++ b/test/e2e/storage/testsuites/volumelimits.go @@ -220,19 +220,19 @@ func (t *volumeLimitsTestSuite) DefineTests(driver TestDriver, pattern testpatte func cleanupTest(cs clientset.Interface, ns string, runningPodName, unschedulablePodName string, pvcs []*v1.PersistentVolumeClaim, pvNames sets.String) error { var cleanupErrors []string if runningPodName != "" { - err := cs.CoreV1().Pods(ns).Delete(context.TODO(), runningPodName, nil) + err := cs.CoreV1().Pods(ns).Delete(context.TODO(), runningPodName, metav1.DeleteOptions{}) if err != nil { cleanupErrors = append(cleanupErrors, fmt.Sprintf("failed to delete pod %s: %s", runningPodName, err)) } } if unschedulablePodName != "" { - err := cs.CoreV1().Pods(ns).Delete(context.TODO(), unschedulablePodName, nil) + err := cs.CoreV1().Pods(ns).Delete(context.TODO(), unschedulablePodName, metav1.DeleteOptions{}) if err != nil { cleanupErrors = append(cleanupErrors, fmt.Sprintf("failed to delete pod %s: %s", unschedulablePodName, err)) } } for _, pvc := range pvcs { - err := cs.CoreV1().PersistentVolumeClaims(ns).Delete(context.TODO(), pvc.Name, nil) + err := cs.CoreV1().PersistentVolumeClaims(ns).Delete(context.TODO(), pvc.Name, metav1.DeleteOptions{}) if err != nil { cleanupErrors = append(cleanupErrors, fmt.Sprintf("failed to delete PVC %s: %s", pvc.Name, err)) } diff --git a/test/e2e/storage/utils/create.go b/test/e2e/storage/utils/create.go index 3483559451b..e510e65dd90 100644 --- a/test/e2e/storage/utils/create.go +++ b/test/e2e/storage/utils/create.go @@ -402,7 +402,7 @@ func (*serviceAccountFactory) Create(f *framework.Framework, i interface{}) (fun return nil, errors.Wrap(err, "create ServiceAccount") } return func() error { - return client.Delete(context.TODO(), item.GetName(), &metav1.DeleteOptions{}) + return client.Delete(context.TODO(), item.GetName(), metav1.DeleteOptions{}) }, nil } @@ -424,7 +424,7 @@ func (*clusterRoleFactory) Create(f *framework.Framework, i interface{}) (func() return nil, errors.Wrap(err, "create ClusterRole") } return func() error { - return client.Delete(context.TODO(), item.GetName(), &metav1.DeleteOptions{}) + return client.Delete(context.TODO(), item.GetName(), metav1.DeleteOptions{}) }, nil } @@ -445,7 +445,7 @@ func (*clusterRoleBindingFactory) Create(f *framework.Framework, i interface{}) return nil, errors.Wrap(err, "create ClusterRoleBinding") } return func() error { - return client.Delete(context.TODO(), item.GetName(), &metav1.DeleteOptions{}) + return client.Delete(context.TODO(), item.GetName(), metav1.DeleteOptions{}) }, nil } @@ -466,7 +466,7 @@ func (*roleFactory) Create(f *framework.Framework, i interface{}) (func() error, return nil, errors.Wrap(err, "create Role") } return func() error { - return client.Delete(context.TODO(), item.GetName(), &metav1.DeleteOptions{}) + return client.Delete(context.TODO(), item.GetName(), metav1.DeleteOptions{}) }, nil } @@ -487,7 +487,7 @@ func (*roleBindingFactory) Create(f *framework.Framework, i interface{}) (func() return nil, errors.Wrap(err, "create RoleBinding") } return func() error { - return client.Delete(context.TODO(), item.GetName(), &metav1.DeleteOptions{}) + return client.Delete(context.TODO(), item.GetName(), metav1.DeleteOptions{}) }, nil } @@ -508,7 +508,7 @@ func (*serviceFactory) Create(f *framework.Framework, i interface{}) (func() err return nil, errors.Wrap(err, "create Service") } return func() error { - return client.Delete(context.TODO(), item.GetName(), &metav1.DeleteOptions{}) + return client.Delete(context.TODO(), item.GetName(), metav1.DeleteOptions{}) }, nil } @@ -529,7 +529,7 @@ func (*statefulSetFactory) Create(f *framework.Framework, i interface{}) (func() return nil, errors.Wrap(err, "create StatefulSet") } return func() error { - return client.Delete(context.TODO(), item.GetName(), &metav1.DeleteOptions{}) + return client.Delete(context.TODO(), item.GetName(), metav1.DeleteOptions{}) }, nil } @@ -550,7 +550,7 @@ func (*daemonSetFactory) Create(f *framework.Framework, i interface{}) (func() e return nil, errors.Wrap(err, "create DaemonSet") } return func() error { - return client.Delete(context.TODO(), item.GetName(), &metav1.DeleteOptions{}) + return client.Delete(context.TODO(), item.GetName(), metav1.DeleteOptions{}) }, nil } @@ -571,7 +571,7 @@ func (*storageClassFactory) Create(f *framework.Framework, i interface{}) (func( return nil, errors.Wrap(err, "create StorageClass") } return func() error { - return client.Delete(context.TODO(), item.GetName(), &metav1.DeleteOptions{}) + return client.Delete(context.TODO(), item.GetName(), metav1.DeleteOptions{}) }, nil } @@ -592,7 +592,7 @@ func (*csiDriverFactory) Create(f *framework.Framework, i interface{}) (func() e return nil, errors.Wrap(err, "create CSIDriver") } return func() error { - return client.Delete(context.TODO(), item.GetName(), &metav1.DeleteOptions{}) + return client.Delete(context.TODO(), item.GetName(), metav1.DeleteOptions{}) }, nil } @@ -613,7 +613,7 @@ func (*secretFactory) Create(f *framework.Framework, i interface{}) (func() erro return nil, errors.Wrap(err, "create Secret") } return func() error { - return client.Delete(context.TODO(), item.GetName(), &metav1.DeleteOptions{}) + return client.Delete(context.TODO(), item.GetName(), metav1.DeleteOptions{}) }, nil } diff --git a/test/e2e/storage/utils/utils.go b/test/e2e/storage/utils/utils.go index 8c4c4dd2858..b6e956e8347 100644 --- a/test/e2e/storage/utils/utils.go +++ b/test/e2e/storage/utils/utils.go @@ -299,9 +299,9 @@ func TestVolumeUnmountsFromDeletedPodWithForceOption(c clientset.Interface, f *f ginkgo.By(fmt.Sprintf("Deleting Pod %q", clientPod.Name)) if forceDelete { - err = c.CoreV1().Pods(clientPod.Namespace).Delete(context.TODO(), clientPod.Name, metav1.NewDeleteOptions(0)) + err = c.CoreV1().Pods(clientPod.Namespace).Delete(context.TODO(), clientPod.Name, *metav1.NewDeleteOptions(0)) } else { - err = c.CoreV1().Pods(clientPod.Namespace).Delete(context.TODO(), clientPod.Name, &metav1.DeleteOptions{}) + err = c.CoreV1().Pods(clientPod.Namespace).Delete(context.TODO(), clientPod.Name, metav1.DeleteOptions{}) } framework.ExpectNoError(err) @@ -385,9 +385,9 @@ func TestVolumeUnmapsFromDeletedPodWithForceOption(c clientset.Interface, f *fra ginkgo.By(fmt.Sprintf("Deleting Pod %q", clientPod.Name)) if forceDelete { - err = c.CoreV1().Pods(clientPod.Namespace).Delete(context.TODO(), clientPod.Name, metav1.NewDeleteOptions(0)) + err = c.CoreV1().Pods(clientPod.Namespace).Delete(context.TODO(), clientPod.Name, *metav1.NewDeleteOptions(0)) } else { - err = c.CoreV1().Pods(clientPod.Namespace).Delete(context.TODO(), clientPod.Name, &metav1.DeleteOptions{}) + err = c.CoreV1().Pods(clientPod.Namespace).Delete(context.TODO(), clientPod.Name, metav1.DeleteOptions{}) } framework.ExpectNoError(err, "Failed to delete pod.") @@ -579,7 +579,7 @@ func PrivilegedTestPSPClusterRoleBinding(client clientset.Interface, }, } - roleBindingClient.Delete(context.TODO(), binding.GetName(), &metav1.DeleteOptions{}) + roleBindingClient.Delete(context.TODO(), binding.GetName(), metav1.DeleteOptions{}) err := wait.Poll(2*time.Second, 2*time.Minute, func() (bool, error) { _, err := roleBindingClient.Get(context.TODO(), binding.GetName(), metav1.GetOptions{}) return apierrors.IsNotFound(err), nil diff --git a/test/e2e/storage/volume_metrics.go b/test/e2e/storage/volume_metrics.go index eaef9afb367..fa877ca8c57 100644 --- a/test/e2e/storage/volume_metrics.go +++ b/test/e2e/storage/volume_metrics.go @@ -92,7 +92,7 @@ var _ = utils.SIGDescribe("[Serial] Volume metrics", func() { } if invalidSc != nil { - err := c.StorageV1().StorageClasses().Delete(context.TODO(), invalidSc.Name, nil) + err := c.StorageV1().StorageClasses().Delete(context.TODO(), invalidSc.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "Error deleting storageclass %v: %v", invalidSc.Name, err) invalidSc = nil } diff --git a/test/e2e/storage/volume_provisioning.go b/test/e2e/storage/volume_provisioning.go index 2595de595c6..23662b60fa2 100644 --- a/test/e2e/storage/volume_provisioning.go +++ b/test/e2e/storage/volume_provisioning.go @@ -790,7 +790,7 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() { framework.ExpectNoError(err) defer func() { framework.Logf("deleting storage class %s", class.Name) - framework.ExpectNoError(c.StorageV1().StorageClasses().Delete(context.TODO(), class.Name, nil)) + framework.ExpectNoError(c.StorageV1().StorageClasses().Delete(context.TODO(), class.Name, metav1.DeleteOptions{})) }() ginkgo.By("creating a claim object with a suffix for gluster dynamic provisioner") @@ -803,7 +803,7 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() { framework.ExpectNoError(err) defer func() { framework.Logf("deleting claim %q/%q", claim.Namespace, claim.Name) - err = c.CoreV1().PersistentVolumeClaims(claim.Namespace).Delete(context.TODO(), claim.Name, nil) + err = c.CoreV1().PersistentVolumeClaims(claim.Namespace).Delete(context.TODO(), claim.Name, metav1.DeleteOptions{}) if err != nil && !apierrors.IsNotFound(err) { framework.Failf("Error deleting claim %q. Error: %v", claim.Name, err) } @@ -1037,7 +1037,7 @@ func waitForProvisionedVolumesDeleted(c clientset.Interface, scName string) ([]* // deleteStorageClass deletes the passed in StorageClass and catches errors other than "Not Found" func deleteStorageClass(c clientset.Interface, className string) { - err := c.StorageV1().StorageClasses().Delete(context.TODO(), className, nil) + err := c.StorageV1().StorageClasses().Delete(context.TODO(), className, metav1.DeleteOptions{}) if err != nil && !apierrors.IsNotFound(err) { framework.ExpectNoError(err) } diff --git a/test/e2e/storage/volumes.go b/test/e2e/storage/volumes.go index 001cc2ff5e7..7595514eabe 100644 --- a/test/e2e/storage/volumes.go +++ b/test/e2e/storage/volumes.go @@ -68,7 +68,7 @@ var _ = utils.SIGDescribe("Volumes", func() { framework.Failf("unable to create test configmap: %v", err) } defer func() { - _ = cs.CoreV1().ConfigMaps(namespace.Name).Delete(context.TODO(), configMap.Name, nil) + _ = cs.CoreV1().ConfigMaps(namespace.Name).Delete(context.TODO(), configMap.Name, metav1.DeleteOptions{}) }() // Test one ConfigMap mounted several times to test #28502 diff --git a/test/e2e/storage/vsphere/persistent_volumes-vsphere.go b/test/e2e/storage/vsphere/persistent_volumes-vsphere.go index 7ebd17001a4..550a8d0eded 100644 --- a/test/e2e/storage/vsphere/persistent_volumes-vsphere.go +++ b/test/e2e/storage/vsphere/persistent_volumes-vsphere.go @@ -207,7 +207,7 @@ var _ = utils.SIGDescribe("PersistentVolumes:vsphere [Feature:vsphere]", func() */ ginkgo.It("should test that deleting the Namespace of a PVC and Pod causes the successful detach of vsphere volume", func() { ginkgo.By("Deleting the Namespace") - err := c.CoreV1().Namespaces().Delete(context.TODO(), ns, nil) + err := c.CoreV1().Namespaces().Delete(context.TODO(), ns, metav1.DeleteOptions{}) framework.ExpectNoError(err) err = framework.WaitForNamespacesDeleted(c, []string{ns}, 3*time.Minute) diff --git a/test/e2e/storage/vsphere/vsphere_scale.go b/test/e2e/storage/vsphere/vsphere_scale.go index 3624487851b..9ea76b67328 100644 --- a/test/e2e/storage/vsphere/vsphere_scale.go +++ b/test/e2e/storage/vsphere/vsphere_scale.go @@ -139,7 +139,7 @@ var _ = utils.SIGDescribe("vcp at scale [Feature:vsphere] ", func() { sc, err = client.StorageV1().StorageClasses().Create(context.TODO(), getVSphereStorageClassSpec(scname, scParams, nil, ""), metav1.CreateOptions{}) gomega.Expect(sc).NotTo(gomega.BeNil(), "Storage class is empty") framework.ExpectNoError(err, "Failed to create storage class") - defer client.StorageV1().StorageClasses().Delete(context.TODO(), scname, nil) + defer client.StorageV1().StorageClasses().Delete(context.TODO(), scname, metav1.DeleteOptions{}) scArrays[index] = sc } diff --git a/test/e2e/storage/vsphere/vsphere_statefulsets.go b/test/e2e/storage/vsphere/vsphere_statefulsets.go index 2099324e457..d4b2ccd774e 100644 --- a/test/e2e/storage/vsphere/vsphere_statefulsets.go +++ b/test/e2e/storage/vsphere/vsphere_statefulsets.go @@ -78,7 +78,7 @@ var _ = utils.SIGDescribe("vsphere statefulset [Feature:vsphere]", func() { scSpec := getVSphereStorageClassSpec(storageclassname, scParameters, nil, "") sc, err := client.StorageV1().StorageClasses().Create(context.TODO(), scSpec, metav1.CreateOptions{}) framework.ExpectNoError(err) - defer client.StorageV1().StorageClasses().Delete(context.TODO(), sc.Name, nil) + defer client.StorageV1().StorageClasses().Delete(context.TODO(), sc.Name, metav1.DeleteOptions{}) ginkgo.By("Creating statefulset") diff --git a/test/e2e/storage/vsphere/vsphere_stress.go b/test/e2e/storage/vsphere/vsphere_stress.go index c7644112166..7312e0db2b5 100644 --- a/test/e2e/storage/vsphere/vsphere_stress.go +++ b/test/e2e/storage/vsphere/vsphere_stress.go @@ -109,7 +109,7 @@ var _ = utils.SIGDescribe("vsphere cloud provider stress [Feature:vsphere]", fun } gomega.Expect(sc).NotTo(gomega.BeNil()) framework.ExpectNoError(err) - defer client.StorageV1().StorageClasses().Delete(context.TODO(), scname, nil) + defer client.StorageV1().StorageClasses().Delete(context.TODO(), scname, metav1.DeleteOptions{}) scArrays[index] = sc } diff --git a/test/e2e/storage/vsphere/vsphere_volume_datastore.go b/test/e2e/storage/vsphere/vsphere_volume_datastore.go index 34f89f28bc2..55f6e724d7c 100644 --- a/test/e2e/storage/vsphere/vsphere_volume_datastore.go +++ b/test/e2e/storage/vsphere/vsphere_volume_datastore.go @@ -82,7 +82,7 @@ func invokeInvalidDatastoreTestNeg(client clientset.Interface, namespace string, ginkgo.By("Creating Storage Class With Invalid Datastore") storageclass, err := client.StorageV1().StorageClasses().Create(context.TODO(), getVSphereStorageClassSpec(datastoreSCName, scParameters, nil, ""), metav1.CreateOptions{}) framework.ExpectNoError(err, fmt.Sprintf("Failed to create storage class with err: %v", err)) - defer client.StorageV1().StorageClasses().Delete(context.TODO(), storageclass.Name, nil) + defer client.StorageV1().StorageClasses().Delete(context.TODO(), storageclass.Name, metav1.DeleteOptions{}) ginkgo.By("Creating PVC using the Storage Class") pvclaim, err := e2epv.CreatePVC(client, namespace, getVSphereClaimSpecWithStorageClass(namespace, "2Gi", storageclass)) diff --git a/test/e2e/storage/vsphere/vsphere_volume_diskformat.go b/test/e2e/storage/vsphere/vsphere_volume_diskformat.go index e23c3b57c1d..e5acb836b71 100644 --- a/test/e2e/storage/vsphere/vsphere_volume_diskformat.go +++ b/test/e2e/storage/vsphere/vsphere_volume_diskformat.go @@ -113,7 +113,7 @@ func invokeTest(f *framework.Framework, client clientset.Interface, namespace st storageclass, err := client.StorageV1().StorageClasses().Create(context.TODO(), storageClassSpec, metav1.CreateOptions{}) framework.ExpectNoError(err) - defer client.StorageV1().StorageClasses().Delete(context.TODO(), storageclass.Name, nil) + defer client.StorageV1().StorageClasses().Delete(context.TODO(), storageclass.Name, metav1.DeleteOptions{}) ginkgo.By("Creating PVC using the Storage Class") pvclaimSpec := getVSphereClaimSpecWithStorageClass(namespace, "2Gi", storageclass) @@ -121,7 +121,7 @@ func invokeTest(f *framework.Framework, client clientset.Interface, namespace st framework.ExpectNoError(err) defer func() { - client.CoreV1().PersistentVolumeClaims(namespace).Delete(context.TODO(), pvclaimSpec.Name, nil) + client.CoreV1().PersistentVolumeClaims(namespace).Delete(context.TODO(), pvclaimSpec.Name, metav1.DeleteOptions{}) }() ginkgo.By("Waiting for claim to be in bound phase") diff --git a/test/e2e/storage/vsphere/vsphere_volume_disksize.go b/test/e2e/storage/vsphere/vsphere_volume_disksize.go index ca0b1a19882..c74159e8805 100644 --- a/test/e2e/storage/vsphere/vsphere_volume_disksize.go +++ b/test/e2e/storage/vsphere/vsphere_volume_disksize.go @@ -71,7 +71,7 @@ var _ = utils.SIGDescribe("Volume Disk Size [Feature:vsphere]", func() { ginkgo.By("Creating Storage Class") storageclass, err := client.StorageV1().StorageClasses().Create(context.TODO(), getVSphereStorageClassSpec(diskSizeSCName, scParameters, nil, ""), metav1.CreateOptions{}) framework.ExpectNoError(err) - defer client.StorageV1().StorageClasses().Delete(context.TODO(), storageclass.Name, nil) + defer client.StorageV1().StorageClasses().Delete(context.TODO(), storageclass.Name, metav1.DeleteOptions{}) ginkgo.By("Creating PVC using the Storage Class") pvclaim, err := e2epv.CreatePVC(client, namespace, getVSphereClaimSpecWithStorageClass(namespace, diskSize, storageclass)) diff --git a/test/e2e/storage/vsphere/vsphere_volume_fstype.go b/test/e2e/storage/vsphere/vsphere_volume_fstype.go index c305046aff3..20da5cbed7a 100644 --- a/test/e2e/storage/vsphere/vsphere_volume_fstype.go +++ b/test/e2e/storage/vsphere/vsphere_volume_fstype.go @@ -153,7 +153,7 @@ func invokeTestForInvalidFstype(f *framework.Framework, client clientset.Interfa func createVolume(client clientset.Interface, namespace string, scParameters map[string]string) (*v1.PersistentVolumeClaim, []*v1.PersistentVolume) { storageclass, err := client.StorageV1().StorageClasses().Create(context.TODO(), getVSphereStorageClassSpec("fstype", scParameters, nil, ""), metav1.CreateOptions{}) framework.ExpectNoError(err) - defer client.StorageV1().StorageClasses().Delete(context.TODO(), storageclass.Name, nil) + defer client.StorageV1().StorageClasses().Delete(context.TODO(), storageclass.Name, metav1.DeleteOptions{}) ginkgo.By("Creating PVC using the Storage Class") pvclaim, err := client.CoreV1().PersistentVolumeClaims(namespace).Create(context.TODO(), getVSphereClaimSpecWithStorageClass(namespace, "2Gi", storageclass), metav1.CreateOptions{}) diff --git a/test/e2e/storage/vsphere/vsphere_volume_node_poweroff.go b/test/e2e/storage/vsphere/vsphere_volume_node_poweroff.go index 7f99f8d3ac9..b400a0d3d1d 100644 --- a/test/e2e/storage/vsphere/vsphere_volume_node_poweroff.go +++ b/test/e2e/storage/vsphere/vsphere_volume_node_poweroff.go @@ -82,7 +82,7 @@ var _ = utils.SIGDescribe("Node Poweroff [Feature:vsphere] [Slow] [Disruptive]", storageClassSpec := getVSphereStorageClassSpec("test-sc", nil, nil, "") storageclass, err := client.StorageV1().StorageClasses().Create(context.TODO(), storageClassSpec, metav1.CreateOptions{}) framework.ExpectNoError(err, fmt.Sprintf("Failed to create storage class with err: %v", err)) - defer client.StorageV1().StorageClasses().Delete(context.TODO(), storageclass.Name, nil) + defer client.StorageV1().StorageClasses().Delete(context.TODO(), storageclass.Name, metav1.DeleteOptions{}) ginkgo.By("Creating PVC using the Storage Class") pvclaimSpec := getVSphereClaimSpecWithStorageClass(namespace, "1Gi", storageclass) @@ -99,7 +99,7 @@ var _ = utils.SIGDescribe("Node Poweroff [Feature:vsphere] [Slow] [Disruptive]", ginkgo.By("Creating a Deployment") deployment, err := e2edeploy.CreateDeployment(client, int32(1), map[string]string{"test": "app"}, nil, namespace, pvclaims, "") framework.ExpectNoError(err, fmt.Sprintf("Failed to create Deployment with err: %v", err)) - defer client.AppsV1().Deployments(namespace).Delete(context.TODO(), deployment.Name, &metav1.DeleteOptions{}) + defer client.AppsV1().Deployments(namespace).Delete(context.TODO(), deployment.Name, metav1.DeleteOptions{}) ginkgo.By("Get pod from the deployment") podList, err := e2edeploy.GetPodsForDeployment(client, deployment) diff --git a/test/e2e/storage/vsphere/vsphere_volume_ops_storm.go b/test/e2e/storage/vsphere/vsphere_volume_ops_storm.go index e351ddcfdd8..c2396aa5fe3 100644 --- a/test/e2e/storage/vsphere/vsphere_volume_ops_storm.go +++ b/test/e2e/storage/vsphere/vsphere_volume_ops_storm.go @@ -83,7 +83,7 @@ var _ = utils.SIGDescribe("Volume Operations Storm [Feature:vsphere]", func() { e2epv.DeletePersistentVolumeClaim(client, claim.Name, namespace) } ginkgo.By("Deleting StorageClass") - err = client.StorageV1().StorageClasses().Delete(context.TODO(), storageclass.Name, nil) + err = client.StorageV1().StorageClasses().Delete(context.TODO(), storageclass.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err) }) diff --git a/test/e2e/storage/vsphere/vsphere_volume_perf.go b/test/e2e/storage/vsphere/vsphere_volume_perf.go index 37eecee6193..424a421ce95 100644 --- a/test/e2e/storage/vsphere/vsphere_volume_perf.go +++ b/test/e2e/storage/vsphere/vsphere_volume_perf.go @@ -97,7 +97,7 @@ var _ = utils.SIGDescribe("vcp-performance [Feature:vsphere]", func() { scList := getTestStorageClasses(client, policyName, datastoreName) defer func(scList []*storagev1.StorageClass) { for _, sc := range scList { - client.StorageV1().StorageClasses().Delete(context.TODO(), sc.Name, nil) + client.StorageV1().StorageClasses().Delete(context.TODO(), sc.Name, metav1.DeleteOptions{}) } }(scList) diff --git a/test/e2e/storage/vsphere/vsphere_volume_vsan_policy.go b/test/e2e/storage/vsphere/vsphere_volume_vsan_policy.go index 6570b90a8bc..3d714c615b2 100644 --- a/test/e2e/storage/vsphere/vsphere_volume_vsan_policy.go +++ b/test/e2e/storage/vsphere/vsphere_volume_vsan_policy.go @@ -261,7 +261,7 @@ func invokeValidPolicyTest(f *framework.Framework, client clientset.Interface, n ginkgo.By("Creating Storage Class With storage policy params") storageclass, err := client.StorageV1().StorageClasses().Create(context.TODO(), getVSphereStorageClassSpec("storagepolicysc", scParameters, nil, ""), metav1.CreateOptions{}) framework.ExpectNoError(err, fmt.Sprintf("Failed to create storage class with err: %v", err)) - defer client.StorageV1().StorageClasses().Delete(context.TODO(), storageclass.Name, nil) + defer client.StorageV1().StorageClasses().Delete(context.TODO(), storageclass.Name, metav1.DeleteOptions{}) ginkgo.By("Creating PVC using the Storage Class") pvclaim, err := e2epv.CreatePVC(client, namespace, getVSphereClaimSpecWithStorageClass(namespace, "2Gi", storageclass)) @@ -293,7 +293,7 @@ func invokeInvalidPolicyTestNeg(client clientset.Interface, namespace string, sc ginkgo.By("Creating Storage Class With storage policy params") storageclass, err := client.StorageV1().StorageClasses().Create(context.TODO(), getVSphereStorageClassSpec("storagepolicysc", scParameters, nil, ""), metav1.CreateOptions{}) framework.ExpectNoError(err, fmt.Sprintf("Failed to create storage class with err: %v", err)) - defer client.StorageV1().StorageClasses().Delete(context.TODO(), storageclass.Name, nil) + defer client.StorageV1().StorageClasses().Delete(context.TODO(), storageclass.Name, metav1.DeleteOptions{}) ginkgo.By("Creating PVC using the Storage Class") pvclaim, err := e2epv.CreatePVC(client, namespace, getVSphereClaimSpecWithStorageClass(namespace, "2Gi", storageclass)) @@ -313,7 +313,7 @@ func invokeStaleDummyVMTestWithStoragePolicy(client clientset.Interface, masterN ginkgo.By("Creating Storage Class With storage policy params") storageclass, err := client.StorageV1().StorageClasses().Create(context.TODO(), getVSphereStorageClassSpec("storagepolicysc", scParameters, nil, ""), metav1.CreateOptions{}) framework.ExpectNoError(err, fmt.Sprintf("Failed to create storage class with err: %v", err)) - defer client.StorageV1().StorageClasses().Delete(context.TODO(), storageclass.Name, nil) + defer client.StorageV1().StorageClasses().Delete(context.TODO(), storageclass.Name, metav1.DeleteOptions{}) ginkgo.By("Creating PVC using the Storage Class") pvclaim, err := e2epv.CreatePVC(client, namespace, getVSphereClaimSpecWithStorageClass(namespace, "2Gi", storageclass)) diff --git a/test/e2e/storage/vsphere/vsphere_zone_support.go b/test/e2e/storage/vsphere/vsphere_zone_support.go index f30a5b345ab..dd496511dc6 100644 --- a/test/e2e/storage/vsphere/vsphere_zone_support.go +++ b/test/e2e/storage/vsphere/vsphere_zone_support.go @@ -378,7 +378,7 @@ var _ = utils.SIGDescribe("Zone Support [Feature:vsphere]", func() { func verifyPVCAndPodCreationSucceeds(client clientset.Interface, namespace string, scParameters map[string]string, zones []string, volumeBindingMode storagev1.VolumeBindingMode) { storageclass, err := client.StorageV1().StorageClasses().Create(context.TODO(), getVSphereStorageClassSpec("zone-sc", scParameters, zones, volumeBindingMode), metav1.CreateOptions{}) framework.ExpectNoError(err, fmt.Sprintf("Failed to create storage class with err: %v", err)) - defer client.StorageV1().StorageClasses().Delete(context.TODO(), storageclass.Name, nil) + defer client.StorageV1().StorageClasses().Delete(context.TODO(), storageclass.Name, metav1.DeleteOptions{}) ginkgo.By("Creating PVC using the Storage Class") pvclaim, err := e2epv.CreatePVC(client, namespace, getVSphereClaimSpecWithStorageClass(namespace, "2Gi", storageclass)) @@ -420,7 +420,7 @@ func verifyPVCAndPodCreationSucceeds(client clientset.Interface, namespace strin func verifyPodAndPvcCreationFailureOnWaitForFirstConsumerMode(client clientset.Interface, namespace string, scParameters map[string]string, zones []string) error { storageclass, err := client.StorageV1().StorageClasses().Create(context.TODO(), getVSphereStorageClassSpec("zone-sc", scParameters, zones, storagev1.VolumeBindingWaitForFirstConsumer), metav1.CreateOptions{}) framework.ExpectNoError(err, fmt.Sprintf("Failed to create storage class with err: %v", err)) - defer client.StorageV1().StorageClasses().Delete(context.TODO(), storageclass.Name, nil) + defer client.StorageV1().StorageClasses().Delete(context.TODO(), storageclass.Name, metav1.DeleteOptions{}) ginkgo.By("Creating PVC using the Storage Class") pvclaim, err := e2epv.CreatePVC(client, namespace, getVSphereClaimSpecWithStorageClass(namespace, "2Gi", storageclass)) @@ -462,7 +462,7 @@ func waitForPVClaimBoundPhase(client clientset.Interface, pvclaims []*v1.Persist func verifyPodSchedulingFails(client clientset.Interface, namespace string, nodeSelector map[string]string, scParameters map[string]string, zones []string, volumeBindingMode storagev1.VolumeBindingMode) { storageclass, err := client.StorageV1().StorageClasses().Create(context.TODO(), getVSphereStorageClassSpec("zone-sc", scParameters, zones, volumeBindingMode), metav1.CreateOptions{}) framework.ExpectNoError(err, fmt.Sprintf("Failed to create storage class with err: %v", err)) - defer client.StorageV1().StorageClasses().Delete(context.TODO(), storageclass.Name, nil) + defer client.StorageV1().StorageClasses().Delete(context.TODO(), storageclass.Name, metav1.DeleteOptions{}) ginkgo.By("Creating PVC using the Storage Class") pvclaim, err := e2epv.CreatePVC(client, namespace, getVSphereClaimSpecWithStorageClass(namespace, "2Gi", storageclass)) @@ -481,7 +481,7 @@ func verifyPodSchedulingFails(client clientset.Interface, namespace string, node func verifyPVCCreationFails(client clientset.Interface, namespace string, scParameters map[string]string, zones []string, volumeBindingMode storagev1.VolumeBindingMode) error { storageclass, err := client.StorageV1().StorageClasses().Create(context.TODO(), getVSphereStorageClassSpec("zone-sc", scParameters, zones, volumeBindingMode), metav1.CreateOptions{}) framework.ExpectNoError(err, fmt.Sprintf("Failed to create storage class with err: %v", err)) - defer client.StorageV1().StorageClasses().Delete(context.TODO(), storageclass.Name, nil) + defer client.StorageV1().StorageClasses().Delete(context.TODO(), storageclass.Name, metav1.DeleteOptions{}) ginkgo.By("Creating PVC using the Storage Class") pvclaim, err := e2epv.CreatePVC(client, namespace, getVSphereClaimSpecWithStorageClass(namespace, "2Gi", storageclass)) @@ -502,7 +502,7 @@ func verifyPVCCreationFails(client clientset.Interface, namespace string, scPara func verifyPVZoneLabels(client clientset.Interface, namespace string, scParameters map[string]string, zones []string) { storageclass, err := client.StorageV1().StorageClasses().Create(context.TODO(), getVSphereStorageClassSpec("zone-sc", nil, zones, ""), metav1.CreateOptions{}) framework.ExpectNoError(err, fmt.Sprintf("Failed to create storage class with err: %v", err)) - defer client.StorageV1().StorageClasses().Delete(context.TODO(), storageclass.Name, nil) + defer client.StorageV1().StorageClasses().Delete(context.TODO(), storageclass.Name, metav1.DeleteOptions{}) ginkgo.By("Creating PVC using the storage class") pvclaim, err := e2epv.CreatePVC(client, namespace, getVSphereClaimSpecWithStorageClass(namespace, "2Gi", storageclass)) diff --git a/test/e2e/upgrades/storage/volume_mode.go b/test/e2e/upgrades/storage/volume_mode.go index 3a253492aa8..edf85e8e724 100644 --- a/test/e2e/upgrades/storage/volume_mode.go +++ b/test/e2e/upgrades/storage/volume_mode.go @@ -121,7 +121,7 @@ func (t *VolumeModeDowngradeTest) Teardown(f *framework.Framework) { framework.ExpectNoError(e2epod.DeletePodWithWait(f.ClientSet, t.pod)) ginkgo.By("Deleting the PVC") - framework.ExpectNoError(f.ClientSet.CoreV1().PersistentVolumeClaims(t.pvc.Namespace).Delete(context.TODO(), t.pvc.Name, nil)) + framework.ExpectNoError(f.ClientSet.CoreV1().PersistentVolumeClaims(t.pvc.Namespace).Delete(context.TODO(), t.pvc.Name, metav1.DeleteOptions{})) ginkgo.By("Waiting for the PV to be deleted") framework.ExpectNoError(framework.WaitForPersistentVolumeDeleted(f.ClientSet, t.pv.Name, 5*time.Second, 20*time.Minute)) diff --git a/test/e2e/windows/density.go b/test/e2e/windows/density.go index 47a0e7df008..11eb75d26b0 100644 --- a/test/e2e/windows/density.go +++ b/test/e2e/windows/density.go @@ -265,7 +265,7 @@ func deletePodsSync(f *framework.Framework, pods []*v1.Pod) { defer ginkgo.GinkgoRecover() defer wg.Done() - err := f.PodClient().Delete(context.TODO(), pod.ObjectMeta.Name, metav1.NewDeleteOptions(30)) + err := f.PodClient().Delete(context.TODO(), pod.ObjectMeta.Name, *metav1.NewDeleteOptions(30)) framework.ExpectNoError(err) err = e2epod.WaitForPodToDisappear(f.ClientSet, f.Namespace.Name, pod.ObjectMeta.Name, labels.Everything(), diff --git a/test/e2e/windows/dns.go b/test/e2e/windows/dns.go index a05309e32d6..e04cbf525f6 100644 --- a/test/e2e/windows/dns.go +++ b/test/e2e/windows/dns.go @@ -55,7 +55,7 @@ var _ = SIGDescribe("DNS", func() { framework.Logf("Created pod %v", testUtilsPod) defer func() { framework.Logf("Deleting pod %s...", testUtilsPod.Name) - if err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), testUtilsPod.Name, metav1.NewDeleteOptions(0)); err != nil { + if err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), testUtilsPod.Name, *metav1.NewDeleteOptions(0)); err != nil { framework.Failf("Failed to delete pod %s: %v", testUtilsPod.Name, err) } }() diff --git a/test/e2e/windows/gmsa_full.go b/test/e2e/windows/gmsa_full.go index 39ac26f3e1e..1cebe10d25a 100644 --- a/test/e2e/windows/gmsa_full.go +++ b/test/e2e/windows/gmsa_full.go @@ -313,7 +313,7 @@ func createRBACRoleForGmsa(f *framework.Framework) (string, func(), error) { } cleanUpFunc := func() { - f.ClientSet.RbacV1().ClusterRoles().Delete(context.TODO(), roleName, &metav1.DeleteOptions{}) + f.ClientSet.RbacV1().ClusterRoles().Delete(context.TODO(), roleName, metav1.DeleteOptions{}) } _, err := f.ClientSet.RbacV1().ClusterRoles().Create(context.TODO(), role, metav1.CreateOptions{}) diff --git a/test/e2e_node/cpu_manager_test.go b/test/e2e_node/cpu_manager_test.go index 9351de61b54..eec1c3a8983 100644 --- a/test/e2e_node/cpu_manager_test.go +++ b/test/e2e_node/cpu_manager_test.go @@ -87,7 +87,7 @@ func deletePods(f *framework.Framework, podNames []string) { delOpts := metav1.DeleteOptions{ GracePeriodSeconds: &gp, } - f.PodClient().DeleteSync(podName, &delOpts, framework.DefaultPodDeletionTimeout) + f.PodClient().DeleteSync(podName, delOpts, framework.DefaultPodDeletionTimeout) } } diff --git a/test/e2e_node/critical_pod_test.go b/test/e2e_node/critical_pod_test.go index 7f3500c8f57..c23708688e8 100644 --- a/test/e2e_node/critical_pod_test.go +++ b/test/e2e_node/critical_pod_test.go @@ -99,10 +99,10 @@ var _ = framework.KubeDescribe("CriticalPod [Serial] [Disruptive] [NodeFeature:C }) ginkgo.AfterEach(func() { // Delete Pods - f.PodClient().DeleteSync(guaranteedPodName, &metav1.DeleteOptions{}, framework.DefaultPodDeletionTimeout) - f.PodClient().DeleteSync(burstablePodName, &metav1.DeleteOptions{}, framework.DefaultPodDeletionTimeout) - f.PodClient().DeleteSync(bestEffortPodName, &metav1.DeleteOptions{}, framework.DefaultPodDeletionTimeout) - f.PodClientNS(kubeapi.NamespaceSystem).DeleteSync(criticalPodName, &metav1.DeleteOptions{}, framework.DefaultPodDeletionTimeout) + f.PodClient().DeleteSync(guaranteedPodName, metav1.DeleteOptions{}, framework.DefaultPodDeletionTimeout) + f.PodClient().DeleteSync(burstablePodName, metav1.DeleteOptions{}, framework.DefaultPodDeletionTimeout) + f.PodClient().DeleteSync(bestEffortPodName, metav1.DeleteOptions{}, framework.DefaultPodDeletionTimeout) + f.PodClientNS(kubeapi.NamespaceSystem).DeleteSync(criticalPodName, metav1.DeleteOptions{}, framework.DefaultPodDeletionTimeout) // Log Events logPodEvents(f) logNodeEvents(f) diff --git a/test/e2e_node/device_plugin_test.go b/test/e2e_node/device_plugin_test.go index 0553caa76e1..91e749f42c3 100644 --- a/test/e2e_node/device_plugin_test.go +++ b/test/e2e_node/device_plugin_test.go @@ -205,7 +205,7 @@ func testDevicePlugin(f *framework.Framework, pluginSockDir string) { deleteOptions := metav1.DeleteOptions{ GracePeriodSeconds: &gp, } - err = f.ClientSet.CoreV1().Pods(metav1.NamespaceSystem).Delete(context.TODO(), dp.Name, &deleteOptions) + err = f.ClientSet.CoreV1().Pods(metav1.NamespaceSystem).Delete(context.TODO(), dp.Name, deleteOptions) framework.ExpectNoError(err) waitForContainerRemoval(devicePluginPod.Spec.Containers[0].Name, devicePluginPod.Name, devicePluginPod.Namespace) _, err = f.ClientSet.CoreV1().Pods(metav1.NamespaceSystem).Get(context.TODO(), dp.Name, getOptions) @@ -237,7 +237,7 @@ func testDevicePlugin(f *framework.Framework, pluginSockDir string) { gomega.Expect(devID1).To(gomega.Not(gomega.Equal(devID2))) ginkgo.By("By deleting the pods and waiting for container removal") - err = f.ClientSet.CoreV1().Pods(metav1.NamespaceSystem).Delete(context.TODO(), dp.Name, &deleteOptions) + err = f.ClientSet.CoreV1().Pods(metav1.NamespaceSystem).Delete(context.TODO(), dp.Name, deleteOptions) framework.ExpectNoError(err) waitForContainerRemoval(devicePluginPod.Spec.Containers[0].Name, devicePluginPod.Name, devicePluginPod.Namespace) @@ -269,7 +269,7 @@ func testDevicePlugin(f *framework.Framework, pluginSockDir string) { }, 30*time.Second, framework.Poll).Should(gomega.Equal(devsLen)) ginkgo.By("by deleting the pods and waiting for container removal") - err = f.ClientSet.CoreV1().Pods(metav1.NamespaceSystem).Delete(context.TODO(), dp.Name, &deleteOptions) + err = f.ClientSet.CoreV1().Pods(metav1.NamespaceSystem).Delete(context.TODO(), dp.Name, deleteOptions) framework.ExpectNoError(err) waitForContainerRemoval(devicePluginPod.Spec.Containers[0].Name, devicePluginPod.Name, devicePluginPod.Namespace) @@ -281,8 +281,8 @@ func testDevicePlugin(f *framework.Framework, pluginSockDir string) { }, 10*time.Minute, framework.Poll).Should(gomega.BeTrue()) // Cleanup - f.PodClient().DeleteSync(pod1.Name, &metav1.DeleteOptions{}, framework.DefaultPodDeletionTimeout) - f.PodClient().DeleteSync(pod2.Name, &metav1.DeleteOptions{}, framework.DefaultPodDeletionTimeout) + f.PodClient().DeleteSync(pod1.Name, metav1.DeleteOptions{}, framework.DefaultPodDeletionTimeout) + f.PodClient().DeleteSync(pod2.Name, metav1.DeleteOptions{}, framework.DefaultPodDeletionTimeout) }) }) } diff --git a/test/e2e_node/dockershim_checkpoint_test.go b/test/e2e_node/dockershim_checkpoint_test.go index e8046fd93d0..559ac5d98c9 100644 --- a/test/e2e_node/dockershim_checkpoint_test.go +++ b/test/e2e_node/dockershim_checkpoint_test.go @@ -169,7 +169,7 @@ func runPodCheckpointTest(f *framework.Framework, podName string, twist func()) twist() ginkgo.By("Remove test pod") - f.PodClient().DeleteSync(podName, &metav1.DeleteOptions{}, framework.DefaultPodDeletionTimeout) + f.PodClient().DeleteSync(podName, metav1.DeleteOptions{}, framework.DefaultPodDeletionTimeout) ginkgo.By("Waiting for checkpoint to be removed") if err := wait.PollImmediate(10*time.Second, gcTimeout, func() (bool, error) { diff --git a/test/e2e_node/dynamic_kubelet_config_test.go b/test/e2e_node/dynamic_kubelet_config_test.go index ea089db565b..3dbaa53d8df 100644 --- a/test/e2e_node/dynamic_kubelet_config_test.go +++ b/test/e2e_node/dynamic_kubelet_config_test.go @@ -929,7 +929,7 @@ func recreateConfigMapFunc(f *framework.Framework, tc *nodeConfigTestCase) error // deleteConfigMapFunc simply deletes tc.configMap func deleteConfigMapFunc(f *framework.Framework, tc *nodeConfigTestCase) error { - return f.ClientSet.CoreV1().ConfigMaps(tc.configMap.Namespace).Delete(context.TODO(), tc.configMap.Name, &metav1.DeleteOptions{}) + return f.ClientSet.CoreV1().ConfigMaps(tc.configMap.Namespace).Delete(context.TODO(), tc.configMap.Name, metav1.DeleteOptions{}) } // createConfigMapFunc creates tc.configMap and updates the UID and ResourceVersion on tc.configMap diff --git a/test/e2e_node/eviction_test.go b/test/e2e_node/eviction_test.go index 022379bea85..9b54e50c4a2 100644 --- a/test/e2e_node/eviction_test.go +++ b/test/e2e_node/eviction_test.go @@ -307,7 +307,7 @@ var _ = framework.KubeDescribe("PriorityMemoryEvictionOrdering [Slow] [Serial] [ framework.ExpectEqual(err == nil || apierrors.IsAlreadyExists(err), true) }) ginkgo.AfterEach(func() { - err := f.ClientSet.SchedulingV1().PriorityClasses().Delete(context.TODO(), highPriorityClassName, &metav1.DeleteOptions{}) + err := f.ClientSet.SchedulingV1().PriorityClasses().Delete(context.TODO(), highPriorityClassName, metav1.DeleteOptions{}) framework.ExpectNoError(err) }) specs := []podEvictSpec{ @@ -364,7 +364,7 @@ var _ = framework.KubeDescribe("PriorityLocalStorageEvictionOrdering [Slow] [Ser framework.ExpectEqual(err == nil || apierrors.IsAlreadyExists(err), true) }) ginkgo.AfterEach(func() { - err := f.ClientSet.SchedulingV1().PriorityClasses().Delete(context.TODO(), highPriorityClassName, &metav1.DeleteOptions{}) + err := f.ClientSet.SchedulingV1().PriorityClasses().Delete(context.TODO(), highPriorityClassName, metav1.DeleteOptions{}) framework.ExpectNoError(err) }) specs := []podEvictSpec{ @@ -417,7 +417,7 @@ var _ = framework.KubeDescribe("PriorityPidEvictionOrdering [Slow] [Serial] [Dis framework.ExpectEqual(err == nil || apierrors.IsAlreadyExists(err), true) }) ginkgo.AfterEach(func() { - err := f.ClientSet.SchedulingV1().PriorityClasses().Delete(context.TODO(), highPriorityClassName, &metav1.DeleteOptions{}) + err := f.ClientSet.SchedulingV1().PriorityClasses().Delete(context.TODO(), highPriorityClassName, metav1.DeleteOptions{}) framework.ExpectNoError(err) }) specs := []podEvictSpec{ @@ -535,7 +535,7 @@ func runEvictionTest(f *framework.Framework, pressureTimeout time.Duration, expe ginkgo.By("deleting pods") for _, spec := range testSpecs { ginkgo.By(fmt.Sprintf("deleting pod: %s", spec.pod.Name)) - f.PodClient().DeleteSync(spec.pod.Name, &metav1.DeleteOptions{}, 10*time.Minute) + f.PodClient().DeleteSync(spec.pod.Name, metav1.DeleteOptions{}, 10*time.Minute) } // In case a test fails before verifying that NodeCondition no longer exist on the node, diff --git a/test/e2e_node/garbage_collector_test.go b/test/e2e_node/garbage_collector_test.go index b9833500a5d..0bc8baab2e1 100644 --- a/test/e2e_node/garbage_collector_test.go +++ b/test/e2e_node/garbage_collector_test.go @@ -245,7 +245,7 @@ func containerGCTest(f *framework.Framework, test testRun) { ginkgo.AfterEach(func() { for _, pod := range test.testPods { ginkgo.By(fmt.Sprintf("Deleting Pod %v", pod.podName)) - f.PodClient().DeleteSync(pod.podName, &metav1.DeleteOptions{}, framework.DefaultPodDeletionTimeout) + f.PodClient().DeleteSync(pod.podName, metav1.DeleteOptions{}, framework.DefaultPodDeletionTimeout) } ginkgo.By("Making sure all containers get cleaned up") diff --git a/test/e2e_node/gpu_device_plugin_test.go b/test/e2e_node/gpu_device_plugin_test.go index d7dc0b072c4..64c6f985d63 100644 --- a/test/e2e_node/gpu_device_plugin_test.go +++ b/test/e2e_node/gpu_device_plugin_test.go @@ -99,7 +99,7 @@ var _ = framework.KubeDescribe("NVIDIA GPU Device Plugin [Feature:GPUDevicePlugi continue } - f.PodClient().Delete(context.TODO(), p.Name, &metav1.DeleteOptions{}) + f.PodClient().Delete(context.TODO(), p.Name, metav1.DeleteOptions{}) } }) @@ -135,7 +135,7 @@ var _ = framework.KubeDescribe("NVIDIA GPU Device Plugin [Feature:GPUDevicePlugi framework.ExpectEqual(devID1, devID2) ginkgo.By("Deleting device plugin.") - f.ClientSet.CoreV1().Pods(metav1.NamespaceSystem).Delete(context.TODO(), devicePluginPod.Name, &metav1.DeleteOptions{}) + f.ClientSet.CoreV1().Pods(metav1.NamespaceSystem).Delete(context.TODO(), devicePluginPod.Name, metav1.DeleteOptions{}) ginkgo.By("Waiting for GPUs to become unavailable on the local node") gomega.Eventually(func() bool { node, err := f.ClientSet.CoreV1().Nodes().Get(context.TODO(), framework.TestContext.NodeName, metav1.GetOptions{}) @@ -162,8 +162,8 @@ var _ = framework.KubeDescribe("NVIDIA GPU Device Plugin [Feature:GPUDevicePlugi logDevicePluginMetrics() // Cleanup - f.PodClient().DeleteSync(p1.Name, &metav1.DeleteOptions{}, framework.DefaultPodDeletionTimeout) - f.PodClient().DeleteSync(p2.Name, &metav1.DeleteOptions{}, framework.DefaultPodDeletionTimeout) + f.PodClient().DeleteSync(p1.Name, metav1.DeleteOptions{}, framework.DefaultPodDeletionTimeout) + f.PodClient().DeleteSync(p2.Name, metav1.DeleteOptions{}, framework.DefaultPodDeletionTimeout) }) }) }) diff --git a/test/e2e_node/mirror_pod_test.go b/test/e2e_node/mirror_pod_test.go index 52a261b0a4b..78eb02a1b46 100644 --- a/test/e2e_node/mirror_pod_test.go +++ b/test/e2e_node/mirror_pod_test.go @@ -100,7 +100,7 @@ var _ = framework.KubeDescribe("MirrorPod", func() { uid := pod.UID ginkgo.By("delete the mirror pod with grace period 30s") - err = f.ClientSet.CoreV1().Pods(ns).Delete(context.TODO(), mirrorPodName, metav1.NewDeleteOptions(30)) + err = f.ClientSet.CoreV1().Pods(ns).Delete(context.TODO(), mirrorPodName, *metav1.NewDeleteOptions(30)) framework.ExpectNoError(err) ginkgo.By("wait for the mirror pod to be recreated") @@ -120,7 +120,7 @@ var _ = framework.KubeDescribe("MirrorPod", func() { uid := pod.UID ginkgo.By("delete the mirror pod with grace period 0s") - err = f.ClientSet.CoreV1().Pods(ns).Delete(context.TODO(), mirrorPodName, metav1.NewDeleteOptions(0)) + err = f.ClientSet.CoreV1().Pods(ns).Delete(context.TODO(), mirrorPodName, *metav1.NewDeleteOptions(0)) framework.ExpectNoError(err) ginkgo.By("wait for the mirror pod to be recreated") diff --git a/test/e2e_node/node_perf_test.go b/test/e2e_node/node_perf_test.go index 9b7b48c8a48..e0b2089e795 100644 --- a/test/e2e_node/node_perf_test.go +++ b/test/e2e_node/node_perf_test.go @@ -80,7 +80,7 @@ var _ = SIGDescribe("Node Performance Testing [Serial] [Slow] [Flaky]", func() { delOpts := metav1.DeleteOptions{ GracePeriodSeconds: &gp, } - f.PodClient().DeleteSync(pod.Name, &delOpts, framework.DefaultPodDeletionTimeout) + f.PodClient().DeleteSync(pod.Name, delOpts, framework.DefaultPodDeletionTimeout) ginkgo.By("running the post test exec from the workload") err := wl.PostTestExec() framework.ExpectNoError(err) diff --git a/test/e2e_node/node_problem_detector_linux.go b/test/e2e_node/node_problem_detector_linux.go index 2c69fb8f117..1075529a97c 100644 --- a/test/e2e_node/node_problem_detector_linux.go +++ b/test/e2e_node/node_problem_detector_linux.go @@ -375,13 +375,13 @@ var _ = framework.KubeDescribe("NodeProblemDetector [NodeFeature:NodeProblemDete framework.Logf("Node Problem Detector logs:\n %s", log) } ginkgo.By("Delete the node problem detector") - f.PodClient().Delete(context.TODO(), name, metav1.NewDeleteOptions(0)) + f.PodClient().Delete(context.TODO(), name, *metav1.NewDeleteOptions(0)) ginkgo.By("Wait for the node problem detector to disappear") gomega.Expect(e2epod.WaitForPodToDisappear(c, ns, name, labels.Everything(), pollInterval, pollTimeout)).To(gomega.Succeed()) ginkgo.By("Delete the config map") - c.CoreV1().ConfigMaps(ns).Delete(context.TODO(), configName, nil) + c.CoreV1().ConfigMaps(ns).Delete(context.TODO(), configName, metav1.DeleteOptions{}) ginkgo.By("Clean up the events") - gomega.Expect(c.CoreV1().Events(eventNamespace).DeleteCollection(context.TODO(), metav1.NewDeleteOptions(0), eventListOptions)).To(gomega.Succeed()) + gomega.Expect(c.CoreV1().Events(eventNamespace).DeleteCollection(context.TODO(), *metav1.NewDeleteOptions(0), eventListOptions)).To(gomega.Succeed()) ginkgo.By("Clean up the node condition") patch := []byte(fmt.Sprintf(`{"status":{"conditions":[{"$patch":"delete","type":"%s"}]}}`, condition)) c.CoreV1().RESTClient().Patch(types.StrategicMergePatchType).Resource("nodes").Name(framework.TestContext.NodeName).SubResource("status").Body(patch).Do(context.TODO()) diff --git a/test/e2e_node/pods_container_manager_test.go b/test/e2e_node/pods_container_manager_test.go index 0595313ad82..4551c8a4cbe 100644 --- a/test/e2e_node/pods_container_manager_test.go +++ b/test/e2e_node/pods_container_manager_test.go @@ -203,7 +203,7 @@ var _ = framework.KubeDescribe("Kubelet Cgroup Manager", func() { }) ginkgo.By("Checking if the pod cgroup was deleted", func() { gp := int64(1) - err := f.PodClient().Delete(context.TODO(), guaranteedPod.Name, &metav1.DeleteOptions{GracePeriodSeconds: &gp}) + err := f.PodClient().Delete(context.TODO(), guaranteedPod.Name, metav1.DeleteOptions{GracePeriodSeconds: &gp}) framework.ExpectNoError(err) pod := makePodToVerifyCgroupRemoved("pod" + podUID) f.PodClient().Create(pod) @@ -248,7 +248,7 @@ var _ = framework.KubeDescribe("Kubelet Cgroup Manager", func() { }) ginkgo.By("Checking if the pod cgroup was deleted", func() { gp := int64(1) - err := f.PodClient().Delete(context.TODO(), bestEffortPod.Name, &metav1.DeleteOptions{GracePeriodSeconds: &gp}) + err := f.PodClient().Delete(context.TODO(), bestEffortPod.Name, metav1.DeleteOptions{GracePeriodSeconds: &gp}) framework.ExpectNoError(err) pod := makePodToVerifyCgroupRemoved("besteffort/pod" + podUID) f.PodClient().Create(pod) @@ -293,7 +293,7 @@ var _ = framework.KubeDescribe("Kubelet Cgroup Manager", func() { }) ginkgo.By("Checking if the pod cgroup was deleted", func() { gp := int64(1) - err := f.PodClient().Delete(context.TODO(), burstablePod.Name, &metav1.DeleteOptions{GracePeriodSeconds: &gp}) + err := f.PodClient().Delete(context.TODO(), burstablePod.Name, metav1.DeleteOptions{GracePeriodSeconds: &gp}) framework.ExpectNoError(err) pod := makePodToVerifyCgroupRemoved("burstable/pod" + podUID) f.PodClient().Create(pod) diff --git a/test/e2e_node/resource_collector.go b/test/e2e_node/resource_collector.go index 6ff1d4008de..6145ce6a7e4 100644 --- a/test/e2e_node/resource_collector.go +++ b/test/e2e_node/resource_collector.go @@ -376,7 +376,7 @@ func deletePodsSync(f *framework.Framework, pods []*v1.Pod) { defer ginkgo.GinkgoRecover() defer wg.Done() - err := f.PodClient().Delete(context.TODO(), pod.ObjectMeta.Name, metav1.NewDeleteOptions(30)) + err := f.PodClient().Delete(context.TODO(), pod.ObjectMeta.Name, *metav1.NewDeleteOptions(30)) framework.ExpectNoError(err) gomega.Expect(e2epod.WaitForPodToDisappear(f.ClientSet, f.Namespace.Name, pod.ObjectMeta.Name, labels.Everything(), diff --git a/test/e2e_node/resource_metrics_test.go b/test/e2e_node/resource_metrics_test.go index 40676a84419..5c65d3fc715 100644 --- a/test/e2e_node/resource_metrics_test.go +++ b/test/e2e_node/resource_metrics_test.go @@ -96,8 +96,8 @@ var _ = framework.KubeDescribe("ResourceMetricsAPI", func() { }) ginkgo.AfterEach(func() { ginkgo.By("Deleting test pods") - f.PodClient().DeleteSync(pod0, &metav1.DeleteOptions{}, 10*time.Minute) - f.PodClient().DeleteSync(pod1, &metav1.DeleteOptions{}, 10*time.Minute) + f.PodClient().DeleteSync(pod0, metav1.DeleteOptions{}, 10*time.Minute) + f.PodClient().DeleteSync(pod1, metav1.DeleteOptions{}, 10*time.Minute) if !ginkgo.CurrentGinkgoTestDescription().Failed { return } diff --git a/test/e2e_node/topology_manager_test.go b/test/e2e_node/topology_manager_test.go index d3a6490f976..f1732c3b384 100644 --- a/test/e2e_node/topology_manager_test.go +++ b/test/e2e_node/topology_manager_test.go @@ -496,16 +496,16 @@ func teardownSRIOVConfigOrFail(f *framework.Framework, sd *sriovData) { } ginkgo.By("Delete SRIOV device plugin pod %s/%s") - err = f.ClientSet.CoreV1().Pods(sd.pod.Namespace).Delete(context.TODO(), sd.pod.Name, &deleteOptions) + err = f.ClientSet.CoreV1().Pods(sd.pod.Namespace).Delete(context.TODO(), sd.pod.Name, deleteOptions) framework.ExpectNoError(err) waitForContainerRemoval(sd.pod.Spec.Containers[0].Name, sd.pod.Name, sd.pod.Namespace) ginkgo.By(fmt.Sprintf("Deleting configMap %v/%v", metav1.NamespaceSystem, sd.configMap.Name)) - err = f.ClientSet.CoreV1().ConfigMaps(metav1.NamespaceSystem).Delete(context.TODO(), sd.configMap.Name, &deleteOptions) + err = f.ClientSet.CoreV1().ConfigMaps(metav1.NamespaceSystem).Delete(context.TODO(), sd.configMap.Name, deleteOptions) framework.ExpectNoError(err) ginkgo.By(fmt.Sprintf("Deleting serviceAccount %v/%v", metav1.NamespaceSystem, sd.serviceAccount.Name)) - err = f.ClientSet.CoreV1().ServiceAccounts(metav1.NamespaceSystem).Delete(context.TODO(), sd.serviceAccount.Name, &deleteOptions) + err = f.ClientSet.CoreV1().ServiceAccounts(metav1.NamespaceSystem).Delete(context.TODO(), sd.serviceAccount.Name, deleteOptions) framework.ExpectNoError(err) } diff --git a/test/e2e_node/volume_manager_test.go b/test/e2e_node/volume_manager_test.go index fcaaffe3f53..b068d943d29 100644 --- a/test/e2e_node/volume_manager_test.go +++ b/test/e2e_node/volume_manager_test.go @@ -115,7 +115,7 @@ var _ = framework.KubeDescribe("Kubelet Volume Manager", func() { }) err = e2epod.WaitForPodSuccessInNamespace(f.ClientSet, pod.Name, f.Namespace.Name) gp := int64(1) - f.PodClient().Delete(context.TODO(), pod.Name, &metav1.DeleteOptions{GracePeriodSeconds: &gp}) + f.PodClient().Delete(context.TODO(), pod.Name, metav1.DeleteOptions{GracePeriodSeconds: &gp}) if err == nil { break } diff --git a/test/integration/apiserver/admissionwebhook/admission_test.go b/test/integration/apiserver/admissionwebhook/admission_test.go index a4afe1e4ef3..94071f8dfca 100644 --- a/test/integration/apiserver/admissionwebhook/admission_test.go +++ b/test/integration/apiserver/admissionwebhook/admission_test.go @@ -1046,7 +1046,7 @@ func testPodBindingEviction(c *testContext) { background := metav1.DeletePropagationBackground zero := int64(0) - forceDelete := &metav1.DeleteOptions{GracePeriodSeconds: &zero, PropagationPolicy: &background} + forceDelete := metav1.DeleteOptions{GracePeriodSeconds: &zero, PropagationPolicy: &background} defer func() { err := c.clientset.CoreV1().Pods(pod.GetNamespace()).Delete(context.TODO(), pod.GetName(), forceDelete) if err != nil && !apierrors.IsNotFound(err) { @@ -1073,7 +1073,7 @@ func testPodBindingEviction(c *testContext) { case gvr("", "v1", "pods/eviction"): err = c.clientset.CoreV1().RESTClient().Post().Namespace(pod.GetNamespace()).Resource("pods").Name(pod.GetName()).SubResource("eviction").Body(&policyv1beta1.Eviction{ ObjectMeta: metav1.ObjectMeta{Name: pod.GetName()}, - DeleteOptions: forceDelete, + DeleteOptions: &forceDelete, }).Do(context.TODO()).Error() default: diff --git a/test/integration/apiserver/admissionwebhook/broken_webhook_test.go b/test/integration/apiserver/admissionwebhook/broken_webhook_test.go index 43b83f39cb2..3546760e31f 100644 --- a/test/integration/apiserver/admissionwebhook/broken_webhook_test.go +++ b/test/integration/apiserver/admissionwebhook/broken_webhook_test.go @@ -96,7 +96,7 @@ func TestBrokenWebhook(t *testing.T) { } t.Logf("Deleting the broken webhook to fix the cluster") - err = client.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations().Delete(context.TODO(), brokenWebhookName, nil) + err = client.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations().Delete(context.TODO(), brokenWebhookName, metav1.DeleteOptions{}) if err != nil { t.Fatalf("Failed to delete broken webhook: %v", err) } diff --git a/test/integration/apiserver/admissionwebhook/client_auth_test.go b/test/integration/apiserver/admissionwebhook/client_auth_test.go index 030e6d63f28..87534edf14c 100644 --- a/test/integration/apiserver/admissionwebhook/client_auth_test.go +++ b/test/integration/apiserver/admissionwebhook/client_auth_test.go @@ -186,7 +186,7 @@ plugins: t.Fatal(err) } defer func() { - err := client.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().Delete(context.TODO(), mutatingCfg.GetName(), &metav1.DeleteOptions{}) + err := client.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().Delete(context.TODO(), mutatingCfg.GetName(), metav1.DeleteOptions{}) if err != nil { t.Fatal(err) } diff --git a/test/integration/apiserver/admissionwebhook/load_balance_test.go b/test/integration/apiserver/admissionwebhook/load_balance_test.go index 96d68131584..5e3a775ef25 100644 --- a/test/integration/apiserver/admissionwebhook/load_balance_test.go +++ b/test/integration/apiserver/admissionwebhook/load_balance_test.go @@ -135,7 +135,7 @@ func TestWebhookLoadBalance(t *testing.T) { t.Fatal(err) } defer func() { - err := client.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().Delete(context.TODO(), mutatingCfg.GetName(), &metav1.DeleteOptions{}) + err := client.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().Delete(context.TODO(), mutatingCfg.GetName(), metav1.DeleteOptions{}) if err != nil { t.Fatal(err) } diff --git a/test/integration/apiserver/admissionwebhook/reinvocation_test.go b/test/integration/apiserver/admissionwebhook/reinvocation_test.go index fa53c5cf0f6..8688cb67ac1 100644 --- a/test/integration/apiserver/admissionwebhook/reinvocation_test.go +++ b/test/integration/apiserver/admissionwebhook/reinvocation_test.go @@ -386,7 +386,7 @@ func testWebhookReinvocationPolicy(t *testing.T, watchCache bool) { t.Fatal(err) } defer func() { - err := client.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().Delete(context.TODO(), cfg.GetName(), &metav1.DeleteOptions{}) + err := client.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().Delete(context.TODO(), cfg.GetName(), metav1.DeleteOptions{}) if err != nil { t.Fatal(err) } diff --git a/test/integration/apiserver/admissionwebhook/timeout_test.go b/test/integration/apiserver/admissionwebhook/timeout_test.go index 255bded03a3..ac39901904f 100644 --- a/test/integration/apiserver/admissionwebhook/timeout_test.go +++ b/test/integration/apiserver/admissionwebhook/timeout_test.go @@ -217,7 +217,7 @@ func testWebhookTimeout(t *testing.T, watchCache bool) { t.Fatal(err) } defer func() { - err := client.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().Delete(context.TODO(), mutatingCfg.GetName(), &metav1.DeleteOptions{}) + err := client.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().Delete(context.TODO(), mutatingCfg.GetName(), metav1.DeleteOptions{}) if err != nil { t.Fatal(err) } @@ -251,7 +251,7 @@ func testWebhookTimeout(t *testing.T, watchCache bool) { t.Fatal(err) } defer func() { - err := client.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations().Delete(context.TODO(), validatingCfg.GetName(), &metav1.DeleteOptions{}) + err := client.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations().Delete(context.TODO(), validatingCfg.GetName(), metav1.DeleteOptions{}) if err != nil { t.Fatal(err) } diff --git a/test/integration/auth/dynamic_client_test.go b/test/integration/auth/dynamic_client_test.go index 4a5fc4dd6f5..6797260a26d 100644 --- a/test/integration/auth/dynamic_client_test.go +++ b/test/integration/auth/dynamic_client_test.go @@ -107,7 +107,7 @@ func TestDynamicClientBuilder(t *testing.T) { // We want to trigger token rotation here by deleting service account // the dynamic client was using. - if err = dymClient.CoreV1().ServiceAccounts(ns).Delete(context.TODO(), saName, nil); err != nil { + if err = dymClient.CoreV1().ServiceAccounts(ns).Delete(context.TODO(), saName, metav1.DeleteOptions{}); err != nil { t.Fatalf("delete service account %s failed: %v", saName, err) } time.Sleep(time.Second * 10) diff --git a/test/integration/auth/node_test.go b/test/integration/auth/node_test.go index 2d15af82d0b..834dbd676dc 100644 --- a/test/integration/auth/node_test.go +++ b/test/integration/auth/node_test.go @@ -218,7 +218,7 @@ func TestNodeAuthorizer(t *testing.T) { deleteNode2NormalPod := func(client clientset.Interface) func() error { return func() error { zero := int64(0) - return client.CoreV1().Pods("ns").Delete(context.TODO(), "node2normalpod", &metav1.DeleteOptions{GracePeriodSeconds: &zero}) + return client.CoreV1().Pods("ns").Delete(context.TODO(), "node2normalpod", metav1.DeleteOptions{GracePeriodSeconds: &zero}) } } @@ -240,7 +240,7 @@ func TestNodeAuthorizer(t *testing.T) { deleteNode2MirrorPod := func(client clientset.Interface) func() error { return func() error { zero := int64(0) - return client.CoreV1().Pods("ns").Delete(context.TODO(), "node2mirrorpod", &metav1.DeleteOptions{GracePeriodSeconds: &zero}) + return client.CoreV1().Pods("ns").Delete(context.TODO(), "node2mirrorpod", metav1.DeleteOptions{GracePeriodSeconds: &zero}) } } @@ -289,7 +289,7 @@ func TestNodeAuthorizer(t *testing.T) { } deleteNode2 := func(client clientset.Interface) func() error { return func() error { - return client.CoreV1().Nodes().Delete(context.TODO(), "node2", nil) + return client.CoreV1().Nodes().Delete(context.TODO(), "node2", metav1.DeleteOptions{}) } } createNode2NormalPodEviction := func(client clientset.Interface) func() error { @@ -388,7 +388,7 @@ func TestNodeAuthorizer(t *testing.T) { } deleteNode1Lease := func(client clientset.Interface) func() error { return func() error { - return client.CoordinationV1().Leases(corev1.NamespaceNodeLease).Delete(context.TODO(), "node1", &metav1.DeleteOptions{}) + return client.CoordinationV1().Leases(corev1.NamespaceNodeLease).Delete(context.TODO(), "node1", metav1.DeleteOptions{}) } } @@ -445,7 +445,7 @@ func TestNodeAuthorizer(t *testing.T) { } deleteNode1CSINode := func(client clientset.Interface) func() error { return func() error { - return client.StorageV1().CSINodes().Delete(context.TODO(), "node1", &metav1.DeleteOptions{}) + return client.StorageV1().CSINodes().Delete(context.TODO(), "node1", metav1.DeleteOptions{}) } } diff --git a/test/integration/auth/rbac_test.go b/test/integration/auth/rbac_test.go index e39bcb6e32a..5274b227cc0 100644 --- a/test/integration/auth/rbac_test.go +++ b/test/integration/auth/rbac_test.go @@ -742,7 +742,7 @@ func TestDiscoveryUpgradeBootstrapping(t *testing.T) { t.Fatalf("Failed to update `system:basic-user` ClusterRoleBinding: %v", err) } t.Logf("Deleting default `system:public-info-viewer` ClusterRoleBinding") - if err = client.RbacV1().ClusterRoleBindings().Delete(context.TODO(), "system:public-info-viewer", &metav1.DeleteOptions{}); err != nil { + if err = client.RbacV1().ClusterRoleBindings().Delete(context.TODO(), "system:public-info-viewer", metav1.DeleteOptions{}); err != nil { t.Fatalf("Failed to delete `system:public-info-viewer` ClusterRoleBinding: %v", err) } diff --git a/test/integration/auth/svcaccttoken_test.go b/test/integration/auth/svcaccttoken_test.go index 882d69b0023..a5099da7a5e 100644 --- a/test/integration/auth/svcaccttoken_test.go +++ b/test/integration/auth/svcaccttoken_test.go @@ -803,7 +803,7 @@ func createDeleteSvcAcct(t *testing.T, cs clientset.Interface, sa *v1.ServiceAcc return } done = true - if err := cs.CoreV1().ServiceAccounts(sa.Namespace).Delete(context.TODO(), sa.Name, nil); err != nil { + if err := cs.CoreV1().ServiceAccounts(sa.Namespace).Delete(context.TODO(), sa.Name, metav1.DeleteOptions{}); err != nil { t.Fatalf("err: %v", err) } } @@ -822,7 +822,7 @@ func createDeletePod(t *testing.T, cs clientset.Interface, pod *v1.Pod) (*v1.Pod return } done = true - if err := cs.CoreV1().Pods(pod.Namespace).Delete(context.TODO(), pod.Name, nil); err != nil { + if err := cs.CoreV1().Pods(pod.Namespace).Delete(context.TODO(), pod.Name, metav1.DeleteOptions{}); err != nil { t.Fatalf("err: %v", err) } } @@ -841,7 +841,7 @@ func createDeleteSecret(t *testing.T, cs clientset.Interface, sec *v1.Secret) (* return } done = true - if err := cs.CoreV1().Secrets(sec.Namespace).Delete(context.TODO(), sec.Name, nil); err != nil { + if err := cs.CoreV1().Secrets(sec.Namespace).Delete(context.TODO(), sec.Name, metav1.DeleteOptions{}); err != nil { t.Fatalf("err: %v", err) } } diff --git a/test/integration/configmap/configmap_test.go b/test/integration/configmap/configmap_test.go index a52ded4027a..6620db7e630 100644 --- a/test/integration/configmap/configmap_test.go +++ b/test/integration/configmap/configmap_test.go @@ -119,7 +119,7 @@ func DoTestConfigMap(t *testing.T, client clientset.Interface, ns *v1.Namespace) } func deleteConfigMapOrErrorf(t *testing.T, c clientset.Interface, ns, name string) { - if err := c.CoreV1().ConfigMaps(ns).Delete(context.TODO(), name, nil); err != nil { + if err := c.CoreV1().ConfigMaps(ns).Delete(context.TODO(), name, metav1.DeleteOptions{}); err != nil { t.Errorf("unable to delete ConfigMap %v: %v", name, err) } } diff --git a/test/integration/cronjob/cronjob_test.go b/test/integration/cronjob/cronjob_test.go index 8c47ba1ac34..6e98af0e49f 100644 --- a/test/integration/cronjob/cronjob_test.go +++ b/test/integration/cronjob/cronjob_test.go @@ -89,7 +89,7 @@ func newCronJob(name, namespace, schedule string) *batchv1beta1.CronJob { func cleanupCronJobs(t *testing.T, cjClient clientbatchv1beta1.CronJobInterface, name string) { deletePropagation := metav1.DeletePropagationForeground - err := cjClient.Delete(context.TODO(), name, &metav1.DeleteOptions{PropagationPolicy: &deletePropagation}) + err := cjClient.Delete(context.TODO(), name, metav1.DeleteOptions{PropagationPolicy: &deletePropagation}) if err != nil { t.Errorf("Failed to delete CronJob: %v", err) } diff --git a/test/integration/daemonset/daemonset_test.go b/test/integration/daemonset/daemonset_test.go index fd87bcbe2a7..3ea7c879648 100644 --- a/test/integration/daemonset/daemonset_test.go +++ b/test/integration/daemonset/daemonset_test.go @@ -174,7 +174,7 @@ func cleanupDaemonSets(t *testing.T, cs clientset.Interface, ds *apps.DaemonSet) } falseVar := false - deleteOptions := &metav1.DeleteOptions{OrphanDependents: &falseVar} + deleteOptions := metav1.DeleteOptions{OrphanDependents: &falseVar} if err := cs.AppsV1().DaemonSets(ds.Namespace).Delete(context.TODO(), ds.Name, deleteOptions); err != nil { t.Errorf("Failed to delete DaemonSet %s/%s: %v", ds.Namespace, ds.Name, err) } diff --git a/test/integration/etcd/crd_overlap_storage_test.go b/test/integration/etcd/crd_overlap_storage_test.go index 07397190d88..8a8a3b67600 100644 --- a/test/integration/etcd/crd_overlap_storage_test.go +++ b/test/integration/etcd/crd_overlap_storage_test.go @@ -174,7 +174,7 @@ func TestOverlappingCustomResourceAPIService(t *testing.T) { if err != nil { t.Fatal(err) } - err = apiServiceClient.APIServices().Delete(context.TODO(), testAPIService.Name, &metav1.DeleteOptions{}) + err = apiServiceClient.APIServices().Delete(context.TODO(), testAPIService.Name, metav1.DeleteOptions{}) if err != nil { t.Fatal(err) } @@ -197,7 +197,7 @@ func TestOverlappingCustomResourceAPIService(t *testing.T) { } // Delete the overlapping CRD - err = crdClient.CustomResourceDefinitions().Delete(context.TODO(), crdCRD.Name, &metav1.DeleteOptions{}) + err = crdClient.CustomResourceDefinitions().Delete(context.TODO(), crdCRD.Name, metav1.DeleteOptions{}) if err != nil { t.Fatal(err) } @@ -348,7 +348,7 @@ func TestOverlappingCustomResourceCustomResourceDefinition(t *testing.T) { } // Delete the overlapping CRD - err = crdClient.CustomResourceDefinitions().Delete(context.TODO(), crdCRD.Name, &metav1.DeleteOptions{}) + err = crdClient.CustomResourceDefinitions().Delete(context.TODO(), crdCRD.Name, metav1.DeleteOptions{}) if err != nil { t.Fatal(err) } diff --git a/test/integration/evictions/evictions_test.go b/test/integration/evictions/evictions_test.go index 42290d069d1..d3e631fe40f 100644 --- a/test/integration/evictions/evictions_test.go +++ b/test/integration/evictions/evictions_test.go @@ -73,7 +73,7 @@ func TestConcurrentEvictionRequests(t *testing.T) { } var gracePeriodSeconds int64 = 30 - deleteOption := &metav1.DeleteOptions{ + deleteOption := metav1.DeleteOptions{ GracePeriodSeconds: &gracePeriodSeconds, } @@ -192,7 +192,7 @@ func TestTerminalPodEviction(t *testing.T) { } var gracePeriodSeconds int64 = 30 - deleteOption := &metav1.DeleteOptions{ + deleteOption := metav1.DeleteOptions{ GracePeriodSeconds: &gracePeriodSeconds, } pod := newPod("test-terminal-pod1") @@ -309,7 +309,7 @@ func newPDB() *v1beta1.PodDisruptionBudget { } } -func newEviction(ns, evictionName string, deleteOption *metav1.DeleteOptions) *v1beta1.Eviction { +func newEviction(ns, evictionName string, deleteOption metav1.DeleteOptions) *v1beta1.Eviction { return &v1beta1.Eviction{ TypeMeta: metav1.TypeMeta{ APIVersion: "Policy/v1beta1", @@ -319,7 +319,7 @@ func newEviction(ns, evictionName string, deleteOption *metav1.DeleteOptions) *v Name: evictionName, Namespace: ns, }, - DeleteOptions: deleteOption, + DeleteOptions: &deleteOption, } } diff --git a/test/integration/framework/perf_utils.go b/test/integration/framework/perf_utils.go index 834b66c2fa5..9b2063e74f4 100644 --- a/test/integration/framework/perf_utils.go +++ b/test/integration/framework/perf_utils.go @@ -125,7 +125,7 @@ func (p *IntegrationTestNodePreparer) CleanupNodes() error { klog.Fatalf("Error listing nodes: %v", err) } for i := range nodes.Items { - if err := p.client.CoreV1().Nodes().Delete(context.TODO(), nodes.Items[i].Name, &metav1.DeleteOptions{}); err != nil { + if err := p.client.CoreV1().Nodes().Delete(context.TODO(), nodes.Items[i].Name, metav1.DeleteOptions{}); err != nil { klog.Errorf("Error while deleting Node: %v", err) } } diff --git a/test/integration/garbagecollector/garbage_collector_test.go b/test/integration/garbagecollector/garbage_collector_test.go index 3fdd25ca027..772b365a560 100644 --- a/test/integration/garbagecollector/garbage_collector_test.go +++ b/test/integration/garbagecollector/garbage_collector_test.go @@ -52,24 +52,24 @@ import ( "k8s.io/kubernetes/test/integration/framework" ) -func getForegroundOptions() *metav1.DeleteOptions { +func getForegroundOptions() metav1.DeleteOptions { policy := metav1.DeletePropagationForeground - return &metav1.DeleteOptions{PropagationPolicy: &policy} + return metav1.DeleteOptions{PropagationPolicy: &policy} } -func getOrphanOptions() *metav1.DeleteOptions { +func getOrphanOptions() metav1.DeleteOptions { var trueVar = true - return &metav1.DeleteOptions{OrphanDependents: &trueVar} + return metav1.DeleteOptions{OrphanDependents: &trueVar} } -func getPropagateOrphanOptions() *metav1.DeleteOptions { +func getPropagateOrphanOptions() metav1.DeleteOptions { policy := metav1.DeletePropagationOrphan - return &metav1.DeleteOptions{PropagationPolicy: &policy} + return metav1.DeleteOptions{PropagationPolicy: &policy} } -func getNonOrphanOptions() *metav1.DeleteOptions { +func getNonOrphanOptions() metav1.DeleteOptions { var falseVar = false - return &metav1.DeleteOptions{OrphanDependents: &falseVar} + return metav1.DeleteOptions{OrphanDependents: &falseVar} } const garbageCollectedPodName = "test.pod.1" @@ -310,7 +310,7 @@ func createNamespaceOrDie(name string, c clientset.Interface, t *testing.T) *v1. func deleteNamespaceOrDie(name string, c clientset.Interface, t *testing.T) { zero := int64(0) background := metav1.DeletePropagationBackground - err := c.CoreV1().Namespaces().Delete(context.TODO(), name, &metav1.DeleteOptions{GracePeriodSeconds: &zero, PropagationPolicy: &background}) + err := c.CoreV1().Namespaces().Delete(context.TODO(), name, metav1.DeleteOptions{GracePeriodSeconds: &zero, PropagationPolicy: &background}) if err != nil { t.Fatalf("failed to delete namespace %q: %v", name, err) } @@ -435,7 +435,7 @@ func TestCreateWithNonExistentOwner(t *testing.T) { } } -func setupRCsPods(t *testing.T, gc *garbagecollector.GarbageCollector, clientSet clientset.Interface, nameSuffix, namespace string, initialFinalizers []string, options *metav1.DeleteOptions, wg *sync.WaitGroup, rcUIDs chan types.UID) { +func setupRCsPods(t *testing.T, gc *garbagecollector.GarbageCollector, clientSet clientset.Interface, nameSuffix, namespace string, initialFinalizers []string, options metav1.DeleteOptions, wg *sync.WaitGroup, rcUIDs chan types.UID) { defer wg.Done() rcClient := clientSet.CoreV1().ReplicationControllers(namespace) podClient := clientSet.CoreV1().Pods(namespace) @@ -461,9 +461,6 @@ func setupRCsPods(t *testing.T, gc *garbagecollector.GarbageCollector, clientSet } orphan := false switch { - case options == nil: - // if there are no deletion options, the default policy for replication controllers is orphan - orphan = true case options.OrphanDependents != nil: // if the deletion options explicitly specify whether to orphan, that controls orphan = *options.OrphanDependents @@ -537,9 +534,9 @@ func TestStressingCascadingDeletion(t *testing.T) { rcUIDs := make(chan types.UID, collections*5) for i := 0; i < collections; i++ { // rc is created with empty finalizers, deleted with nil delete options, pods will remain. - go setupRCsPods(t, gc, clientSet, "collection1-"+strconv.Itoa(i), ns.Name, []string{}, nil, &wg, rcUIDs) + go setupRCsPods(t, gc, clientSet, "collection1-"+strconv.Itoa(i), ns.Name, []string{}, metav1.DeleteOptions{}, &wg, rcUIDs) // rc is created with the orphan finalizer, deleted with nil options, pods will remain. - go setupRCsPods(t, gc, clientSet, "collection2-"+strconv.Itoa(i), ns.Name, []string{metav1.FinalizerOrphanDependents}, nil, &wg, rcUIDs) + go setupRCsPods(t, gc, clientSet, "collection2-"+strconv.Itoa(i), ns.Name, []string{metav1.FinalizerOrphanDependents}, metav1.DeleteOptions{}, &wg, rcUIDs) // rc is created with the orphan finalizer, deleted with DeleteOptions.OrphanDependents=false, pods will be deleted. go setupRCsPods(t, gc, clientSet, "collection3-"+strconv.Itoa(i), ns.Name, []string{metav1.FinalizerOrphanDependents}, getNonOrphanOptions(), &wg, rcUIDs) // rc is created with empty finalizers, deleted with DeleteOptions.OrphanDependents=true, pods will remain. @@ -1045,7 +1042,7 @@ func TestMixedRelationships(t *testing.T) { } // Delete the core owner. - err = configMapClient.Delete(context.TODO(), coreOwner.GetName(), &metav1.DeleteOptions{PropagationPolicy: &foreground}) + err = configMapClient.Delete(context.TODO(), coreOwner.GetName(), metav1.DeleteOptions{PropagationPolicy: &foreground}) if err != nil { t.Fatalf("failed to delete owner resource %q: %v", coreOwner.GetName(), err) } diff --git a/test/integration/ipamperf/util.go b/test/integration/ipamperf/util.go index 3c64be20118..c6082218429 100644 --- a/test/integration/ipamperf/util.go +++ b/test/integration/ipamperf/util.go @@ -63,7 +63,7 @@ func deleteNodes(apiURL string, config *Config) { Burst: config.CreateQPS, }) noGrace := int64(0) - if err := clientSet.CoreV1().Nodes().DeleteCollection(context.TODO(), &metav1.DeleteOptions{GracePeriodSeconds: &noGrace}, metav1.ListOptions{}); err != nil { + if err := clientSet.CoreV1().Nodes().DeleteCollection(context.TODO(), metav1.DeleteOptions{GracePeriodSeconds: &noGrace}, metav1.ListOptions{}); err != nil { klog.Errorf("Error deleting node: %v", err) } } diff --git a/test/integration/master/audit_dynamic_test.go b/test/integration/master/audit_dynamic_test.go index 2f3410fb142..c1713035a1f 100644 --- a/test/integration/master/audit_dynamic_test.go +++ b/test/integration/master/audit_dynamic_test.go @@ -109,7 +109,7 @@ func TestDynamicAudit(t *testing.T) { // test deletes an audit sink, generates audit events, and ensures they don't arrive in the corresponding server success = t.Run("delete sink", func(t *testing.T) { - err := kubeclient.AuditregistrationV1alpha1().AuditSinks().Delete(context.TODO(), sinkConfig2.Name, &metav1.DeleteOptions{}) + err := kubeclient.AuditregistrationV1alpha1().AuditSinks().Delete(context.TODO(), sinkConfig2.Name, metav1.DeleteOptions{}) require.NoError(t, err, "failed to delete audit sink2") t.Log("deleted audit sink2") diff --git a/test/integration/master/audit_test.go b/test/integration/master/audit_test.go index 2b6769f7521..1dee7af9c45 100644 --- a/test/integration/master/audit_test.go +++ b/test/integration/master/audit_test.go @@ -384,7 +384,7 @@ func configMapOperations(t *testing.T, kubeclient kubernetes.Interface) { _, err = kubeclient.CoreV1().ConfigMaps(namespace).List(context.TODO(), metav1.ListOptions{}) expectNoError(t, err, "failed to list config maps") - err = kubeclient.CoreV1().ConfigMaps(namespace).Delete(context.TODO(), configMap.Name, &metav1.DeleteOptions{}) + err = kubeclient.CoreV1().ConfigMaps(namespace).Delete(context.TODO(), configMap.Name, metav1.DeleteOptions{}) expectNoError(t, err, "failed to delete audit-configmap") } diff --git a/test/integration/master/synthetic_master_test.go b/test/integration/master/synthetic_master_test.go index 5c415e5a9b3..2c29cfb59cd 100644 --- a/test/integration/master/synthetic_master_test.go +++ b/test/integration/master/synthetic_master_test.go @@ -702,7 +702,7 @@ func TestServiceAlloc(t *testing.T) { } // Delete the first service. - if err := client.CoreV1().Services(metav1.NamespaceDefault).Delete(context.TODO(), svc(1).ObjectMeta.Name, nil); err != nil { + if err := client.CoreV1().Services(metav1.NamespaceDefault).Delete(context.TODO(), svc(1).ObjectMeta.Name, metav1.DeleteOptions{}); err != nil { t.Fatalf("got unexpected error: %v", err) } @@ -736,7 +736,7 @@ func TestUpdateNodeObjects(t *testing.T) { iterations := 10000 for i := 0; i < nodes*6; i++ { - c.Nodes().Delete(context.TODO(), fmt.Sprintf("node-%d", i), nil) + c.Nodes().Delete(context.TODO(), fmt.Sprintf("node-%d", i), metav1.DeleteOptions{}) _, err := c.Nodes().Create(context.TODO(), &corev1.Node{ ObjectMeta: metav1.ObjectMeta{ Name: fmt.Sprintf("node-%d", i), diff --git a/test/integration/master/transformation_testcase.go b/test/integration/master/transformation_testcase.go index 9e3325307dd..29ee0f346ec 100644 --- a/test/integration/master/transformation_testcase.go +++ b/test/integration/master/transformation_testcase.go @@ -98,7 +98,7 @@ func newTransformTest(l kubeapiservertesting.Logger, transformerConfigYAML strin func (e *transformTest) cleanUp() { os.RemoveAll(e.configDir) - e.restClient.CoreV1().Namespaces().Delete(context.TODO(), e.ns.Name, metav1.NewDeleteOptions(0)) + e.restClient.CoreV1().Namespaces().Delete(context.TODO(), e.ns.Name, *metav1.NewDeleteOptions(0)) e.kubeAPIServer.TearDownFn() } diff --git a/test/integration/namespace/ns_conditions_test.go b/test/integration/namespace/ns_conditions_test.go index 2ca3fc8b170..6230b8efd3b 100644 --- a/test/integration/namespace/ns_conditions_test.go +++ b/test/integration/namespace/ns_conditions_test.go @@ -78,7 +78,7 @@ func TestNamespaceCondition(t *testing.T) { t.Fatal(err) } - if err = kubeClient.CoreV1().Namespaces().Delete(context.TODO(), nsName, nil); err != nil { + if err = kubeClient.CoreV1().Namespaces().Delete(context.TODO(), nsName, metav1.DeleteOptions{}); err != nil { t.Fatal(err) } diff --git a/test/integration/replicaset/replicaset_test.go b/test/integration/replicaset/replicaset_test.go index 89214688d43..0cfa9563e09 100644 --- a/test/integration/replicaset/replicaset_test.go +++ b/test/integration/replicaset/replicaset_test.go @@ -559,7 +559,7 @@ func TestDeletingAndFailedPods(t *testing.T) { updatePod(t, podClient, deletingPod.Name, func(pod *v1.Pod) { pod.Finalizers = []string{"fake.example.com/blockDeletion"} }) - if err := c.CoreV1().Pods(ns.Name).Delete(context.TODO(), deletingPod.Name, &metav1.DeleteOptions{}); err != nil { + if err := c.CoreV1().Pods(ns.Name).Delete(context.TODO(), deletingPod.Name, metav1.DeleteOptions{}); err != nil { t.Fatalf("Error deleting pod %s: %v", deletingPod.Name, err) } @@ -911,7 +911,7 @@ func TestReplicaSetsAppsV1DefaultGCPolicy(t *testing.T) { } rsClient := c.AppsV1().ReplicaSets(ns.Name) - err := rsClient.Delete(context.TODO(), rs.Name, nil) + err := rsClient.Delete(context.TODO(), rs.Name, metav1.DeleteOptions{}) if err != nil { t.Fatalf("Failed to delete rs: %v", err) } @@ -944,5 +944,5 @@ func TestReplicaSetsAppsV1DefaultGCPolicy(t *testing.T) { rs.Finalizers = finalizers }) - rsClient.Delete(context.TODO(), rs.Name, nil) + rsClient.Delete(context.TODO(), rs.Name, metav1.DeleteOptions{}) } diff --git a/test/integration/replicationcontroller/replicationcontroller_test.go b/test/integration/replicationcontroller/replicationcontroller_test.go index 93ef5787a74..d6a8d4b9be1 100644 --- a/test/integration/replicationcontroller/replicationcontroller_test.go +++ b/test/integration/replicationcontroller/replicationcontroller_test.go @@ -520,7 +520,7 @@ func TestDeletingAndFailedPods(t *testing.T) { updatePod(t, podClient, deletingPod.Name, func(pod *v1.Pod) { pod.Finalizers = []string{"fake.example.com/blockDeletion"} }) - if err := c.CoreV1().Pods(ns.Name).Delete(context.TODO(), deletingPod.Name, &metav1.DeleteOptions{}); err != nil { + if err := c.CoreV1().Pods(ns.Name).Delete(context.TODO(), deletingPod.Name, metav1.DeleteOptions{}); err != nil { t.Fatalf("Error deleting pod %s: %v", deletingPod.Name, err) } diff --git a/test/integration/scheduler/extender_test.go b/test/integration/scheduler/extender_test.go index 4b794622640..255d29c67e8 100644 --- a/test/integration/scheduler/extender_test.go +++ b/test/integration/scheduler/extender_test.go @@ -359,7 +359,7 @@ func TestSchedulerExtender(t *testing.T) { func DoTestPodScheduling(ns *v1.Namespace, t *testing.T, cs clientset.Interface) { // NOTE: This test cannot run in parallel, because it is creating and deleting // non-namespaced objects (Nodes). - defer cs.CoreV1().Nodes().DeleteCollection(context.TODO(), nil, metav1.ListOptions{}) + defer cs.CoreV1().Nodes().DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{}) goodCondition := v1.NodeCondition{ Type: v1.NodeReady, @@ -418,7 +418,7 @@ func DoTestPodScheduling(ns *v1.Namespace, t *testing.T, cs clientset.Interface) t.Fatalf("Failed to schedule using extender, expected machine2, got %v", myPod.Spec.NodeName) } var gracePeriod int64 - if err := cs.CoreV1().Pods(ns.Name).Delete(context.TODO(), myPod.Name, &metav1.DeleteOptions{GracePeriodSeconds: &gracePeriod}); err != nil { + if err := cs.CoreV1().Pods(ns.Name).Delete(context.TODO(), myPod.Name, metav1.DeleteOptions{GracePeriodSeconds: &gracePeriod}); err != nil { t.Fatalf("Failed to delete pod: %v", err) } _, err = cs.CoreV1().Pods(ns.Name).Get(context.TODO(), myPod.Name, metav1.GetOptions{}) diff --git a/test/integration/scheduler/predicates_test.go b/test/integration/scheduler/predicates_test.go index 50d29db7902..c52be01a733 100644 --- a/test/integration/scheduler/predicates_test.go +++ b/test/integration/scheduler/predicates_test.go @@ -850,7 +850,7 @@ func TestInterPodAffinity(t *testing.T) { t.Errorf("Test Failed: %v, err %v, test.fits %v", test.test, err, test.fits) } - err = cs.CoreV1().Pods(testCtx.NS.Name).Delete(context.TODO(), test.pod.Name, metav1.NewDeleteOptions(0)) + err = cs.CoreV1().Pods(testCtx.NS.Name).Delete(context.TODO(), test.pod.Name, *metav1.NewDeleteOptions(0)) if err != nil { t.Errorf("Test Failed: error, %v, while deleting pod during test: %v", err, test.test) } @@ -865,7 +865,7 @@ func TestInterPodAffinity(t *testing.T) { } else { nsName = testCtx.NS.Name } - err = cs.CoreV1().Pods(nsName).Delete(context.TODO(), pod.Name, metav1.NewDeleteOptions(0)) + err = cs.CoreV1().Pods(nsName).Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(0)) if err != nil { t.Errorf("Test Failed: error, %v, while deleting pod during test: %v", err, test.test) } diff --git a/test/integration/scheduler/preemption_test.go b/test/integration/scheduler/preemption_test.go index 7d6e5bf527d..781c9640214 100644 --- a/test/integration/scheduler/preemption_test.go +++ b/test/integration/scheduler/preemption_test.go @@ -1220,7 +1220,7 @@ func TestPDBInPreemption(t *testing.T) { // Cleanup pods = append(pods, preemptor) testutils.CleanupPods(cs, t, pods) - cs.PolicyV1beta1().PodDisruptionBudgets(testCtx.NS.Name).DeleteCollection(context.TODO(), nil, metav1.ListOptions{}) - cs.CoreV1().Nodes().DeleteCollection(context.TODO(), nil, metav1.ListOptions{}) + cs.PolicyV1beta1().PodDisruptionBudgets(testCtx.NS.Name).DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{}) + cs.CoreV1().Nodes().DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{}) } } diff --git a/test/integration/scheduler/scheduler_test.go b/test/integration/scheduler/scheduler_test.go index 1c52f5333e9..882f3b232dd 100644 --- a/test/integration/scheduler/scheduler_test.go +++ b/test/integration/scheduler/scheduler_test.go @@ -62,7 +62,7 @@ func TestSchedulerCreationFromConfigMap(t *testing.T) { defer framework.DeleteTestingNamespace(ns, s, t) clientSet := clientset.NewForConfigOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: &schema.GroupVersion{Group: "", Version: "v1"}}}) - defer clientSet.CoreV1().Nodes().DeleteCollection(context.TODO(), nil, metav1.ListOptions{}) + defer clientSet.CoreV1().Nodes().DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{}) informerFactory := informers.NewSharedInformerFactory(clientSet, 0) for i, test := range []struct { @@ -304,7 +304,7 @@ func TestSchedulerCreationFromNonExistentConfigMap(t *testing.T) { defer framework.DeleteTestingNamespace(ns, s, t) clientSet := clientset.NewForConfigOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: &schema.GroupVersion{Group: "", Version: "v1"}}}) - defer clientSet.CoreV1().Nodes().DeleteCollection(context.TODO(), nil, metav1.ListOptions{}) + defer clientSet.CoreV1().Nodes().DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{}) informerFactory := informers.NewSharedInformerFactory(clientSet, 0) @@ -341,7 +341,7 @@ func TestUnschedulableNodes(t *testing.T) { nodeLister := testCtx.InformerFactory.Core().V1().Nodes().Lister() // NOTE: This test cannot run in parallel, because it is creating and deleting // non-namespaced objects (Nodes). - defer testCtx.ClientSet.CoreV1().Nodes().DeleteCollection(context.TODO(), nil, metav1.ListOptions{}) + defer testCtx.ClientSet.CoreV1().Nodes().DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{}) goodCondition := v1.NodeCondition{ Type: v1.NodeReady, @@ -453,7 +453,7 @@ func TestUnschedulableNodes(t *testing.T) { if err := deletePod(testCtx.ClientSet, myPod.Name, myPod.Namespace); err != nil { t.Errorf("Failed to delete pod: %v", err) } - err = testCtx.ClientSet.CoreV1().Nodes().Delete(context.TODO(), schedNode.Name, nil) + err = testCtx.ClientSet.CoreV1().Nodes().Delete(context.TODO(), schedNode.Name, metav1.DeleteOptions{}) if err != nil { t.Errorf("Failed to delete node: %v", err) } @@ -826,7 +826,7 @@ func TestSchedulerInformers(t *testing.T) { // Cleanup pods = append(pods, unschedulable) testutils.CleanupPods(cs, t, pods) - cs.PolicyV1beta1().PodDisruptionBudgets(testCtx.NS.Name).DeleteCollection(context.TODO(), nil, metav1.ListOptions{}) - cs.CoreV1().Nodes().DeleteCollection(context.TODO(), nil, metav1.ListOptions{}) + cs.PolicyV1beta1().PodDisruptionBudgets(testCtx.NS.Name).DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{}) + cs.CoreV1().Nodes().DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{}) } } diff --git a/test/integration/scheduler/util.go b/test/integration/scheduler/util.go index 1b4447346f8..afcd019d6c6 100644 --- a/test/integration/scheduler/util.go +++ b/test/integration/scheduler/util.go @@ -447,7 +447,7 @@ func waitCachedPodsStable(testCtx *testutils.TestContext, pods []*v1.Pod) error // deletePod deletes the given pod in the given namespace. func deletePod(cs clientset.Interface, podName string, nsName string) error { - return cs.CoreV1().Pods(nsName).Delete(context.TODO(), podName, metav1.NewDeleteOptions(0)) + return cs.CoreV1().Pods(nsName).Delete(context.TODO(), podName, *metav1.NewDeleteOptions(0)) } func getPod(cs clientset.Interface, podName string, podNamespace string) (*v1.Pod, error) { @@ -469,7 +469,7 @@ func noPodsInNamespace(c clientset.Interface, podNamespace string) wait.Conditio // cleanupPodsInNamespace deletes the pods in the given namespace and waits for them to // be actually deleted. func cleanupPodsInNamespace(cs clientset.Interface, t *testing.T, ns string) { - if err := cs.CoreV1().Pods(ns).DeleteCollection(context.TODO(), nil, metav1.ListOptions{}); err != nil { + if err := cs.CoreV1().Pods(ns).DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{}); err != nil { t.Errorf("error while listing pod in namespace %v: %v", ns, err) return } diff --git a/test/integration/secrets/secrets_test.go b/test/integration/secrets/secrets_test.go index f626d9d4fd5..b10751b414d 100644 --- a/test/integration/secrets/secrets_test.go +++ b/test/integration/secrets/secrets_test.go @@ -32,7 +32,7 @@ import ( ) func deleteSecretOrErrorf(t *testing.T, c clientset.Interface, ns, name string) { - if err := c.CoreV1().Secrets(ns).Delete(context.TODO(), name, nil); err != nil { + if err := c.CoreV1().Secrets(ns).Delete(context.TODO(), name, metav1.DeleteOptions{}); err != nil { t.Errorf("unable to delete secret %v: %v", name, err) } } diff --git a/test/integration/serviceaccount/service_account_test.go b/test/integration/serviceaccount/service_account_test.go index ba7ee1f9408..30a6fc14a4f 100644 --- a/test/integration/serviceaccount/service_account_test.go +++ b/test/integration/serviceaccount/service_account_test.go @@ -83,7 +83,7 @@ func TestServiceAccountAutoCreate(t *testing.T) { } // Delete service account - err = c.CoreV1().ServiceAccounts(ns).Delete(context.TODO(), defaultUser.Name, nil) + err = c.CoreV1().ServiceAccounts(ns).Delete(context.TODO(), defaultUser.Name, metav1.DeleteOptions{}) if err != nil { t.Fatalf("Could not delete default serviceaccount: %v", err) } @@ -127,7 +127,7 @@ func TestServiceAccountTokenAutoCreate(t *testing.T) { } // Delete token - err = c.CoreV1().Secrets(ns).Delete(context.TODO(), token1Name, nil) + err = c.CoreV1().Secrets(ns).Delete(context.TODO(), token1Name, metav1.DeleteOptions{}) if err != nil { t.Fatalf("Could not delete token: %v", err) } @@ -168,7 +168,7 @@ func TestServiceAccountTokenAutoCreate(t *testing.T) { } // Delete service account - err = c.CoreV1().ServiceAccounts(ns).Delete(context.TODO(), name, nil) + err = c.CoreV1().ServiceAccounts(ns).Delete(context.TODO(), name, metav1.DeleteOptions{}) if err != nil { t.Fatal(err) } @@ -314,7 +314,7 @@ func TestServiceAccountTokenAuthentication(t *testing.T) { roClient := clientset.NewForConfigOrDie(&roClientConfig) doServiceAccountAPIRequests(t, roClient, myns, true, true, false) doServiceAccountAPIRequests(t, roClient, otherns, true, false, false) - err = c.CoreV1().Secrets(myns).Delete(context.TODO(), roTokenName, nil) + err = c.CoreV1().Secrets(myns).Delete(context.TODO(), roTokenName, metav1.DeleteOptions{}) if err != nil { t.Fatalf("could not delete token: %v", err) } @@ -584,7 +584,9 @@ func doServiceAccountAPIRequests(t *testing.T, c *clientset.Clientset, ns string _, err := c.CoreV1().Secrets(ns).Create(context.TODO(), testSecret, metav1.CreateOptions{}) return err }, - func() error { return c.CoreV1().Secrets(ns).Delete(context.TODO(), testSecret.Name, nil) }, + func() error { + return c.CoreV1().Secrets(ns).Delete(context.TODO(), testSecret.Name, metav1.DeleteOptions{}) + }, } for _, op := range readOps { diff --git a/test/integration/statefulset/statefulset_test.go b/test/integration/statefulset/statefulset_test.go index ddb0f733da5..7e1d92fd750 100644 --- a/test/integration/statefulset/statefulset_test.go +++ b/test/integration/statefulset/statefulset_test.go @@ -178,7 +178,7 @@ func TestDeletingAndFailedPods(t *testing.T) { updatePod(t, podClient, deletingPod.Name, func(pod *v1.Pod) { pod.Finalizers = []string{"fake.example.com/blockDeletion"} }) - if err := c.CoreV1().Pods(ns.Name).Delete(context.TODO(), deletingPod.Name, &metav1.DeleteOptions{}); err != nil { + if err := c.CoreV1().Pods(ns.Name).Delete(context.TODO(), deletingPod.Name, metav1.DeleteOptions{}); err != nil { t.Fatalf("error deleting pod %s: %v", deletingPod.Name, err) } diff --git a/test/integration/storageclasses/storage_classes_test.go b/test/integration/storageclasses/storage_classes_test.go index ae61dd8e8f3..c8ee33d452f 100644 --- a/test/integration/storageclasses/storage_classes_test.go +++ b/test/integration/storageclasses/storage_classes_test.go @@ -87,13 +87,13 @@ func DoTestStorageClasses(t *testing.T, client clientset.Interface, ns *v1.Names } func deleteStorageClassOrErrorf(t *testing.T, c clientset.Interface, ns, name string) { - if err := c.StorageV1().StorageClasses().Delete(context.TODO(), name, nil); err != nil { + if err := c.StorageV1().StorageClasses().Delete(context.TODO(), name, metav1.DeleteOptions{}); err != nil { t.Errorf("unable to delete storage class %v: %v", name, err) } } func deletePersistentVolumeClaimOrErrorf(t *testing.T, c clientset.Interface, ns, name string) { - if err := c.CoreV1().PersistentVolumeClaims(ns).Delete(context.TODO(), name, nil); err != nil { + if err := c.CoreV1().PersistentVolumeClaims(ns).Delete(context.TODO(), name, metav1.DeleteOptions{}); err != nil { t.Errorf("unable to delete persistent volume claim %v: %v", name, err) } } diff --git a/test/integration/ttlcontroller/ttlcontroller_test.go b/test/integration/ttlcontroller/ttlcontroller_test.go index e6cddac6164..1952a99c8c6 100644 --- a/test/integration/ttlcontroller/ttlcontroller_test.go +++ b/test/integration/ttlcontroller/ttlcontroller_test.go @@ -75,7 +75,7 @@ func deleteNodes(t *testing.T, client *clientset.Clientset, startIndex, endIndex go func(idx int) { defer wg.Done() name := fmt.Sprintf("node-%d", idx) - if err := client.CoreV1().Nodes().Delete(context.TODO(), name, &metav1.DeleteOptions{}); err != nil { + if err := client.CoreV1().Nodes().Delete(context.TODO(), name, metav1.DeleteOptions{}); err != nil { t.Fatalf("Failed to delete node: %v", err) } }(i) diff --git a/test/integration/util/util.go b/test/integration/util/util.go index c4fc6fff52f..4e740f9e40b 100644 --- a/test/integration/util/util.go +++ b/test/integration/util/util.go @@ -161,7 +161,7 @@ type TestContext struct { // CleanupNodes cleans all nodes which were created during integration test func CleanupNodes(cs clientset.Interface, t *testing.T) { - err := cs.CoreV1().Nodes().DeleteCollection(context.TODO(), metav1.NewDeleteOptions(0), metav1.ListOptions{}) + err := cs.CoreV1().Nodes().DeleteCollection(context.TODO(), *metav1.NewDeleteOptions(0), metav1.ListOptions{}) if err != nil { t.Errorf("error while deleting all nodes: %v", err) } @@ -186,7 +186,7 @@ func CleanupTest(t *testing.T, testCtx *TestContext) { // Kill the scheduler. testCtx.CancelFn() // Cleanup nodes. - testCtx.ClientSet.CoreV1().Nodes().DeleteCollection(context.TODO(), nil, metav1.ListOptions{}) + testCtx.ClientSet.CoreV1().Nodes().DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{}) framework.DeleteTestingNamespace(testCtx.NS, testCtx.HTTPServer, t) testCtx.CloseFn() } @@ -194,7 +194,7 @@ func CleanupTest(t *testing.T, testCtx *TestContext) { // CleanupPods deletes the given pods and waits for them to be actually deleted. func CleanupPods(cs clientset.Interface, t *testing.T, pods []*v1.Pod) { for _, p := range pods { - err := cs.CoreV1().Pods(p.Namespace).Delete(context.TODO(), p.Name, metav1.NewDeleteOptions(0)) + err := cs.CoreV1().Pods(p.Namespace).Delete(context.TODO(), p.Name, *metav1.NewDeleteOptions(0)) if err != nil && !apierrors.IsNotFound(err) { t.Errorf("error while deleting pod %v/%v: %v", p.Namespace, p.Name, err) } diff --git a/test/integration/utils.go b/test/integration/utils.go index e34d8687a61..d23eb8257c2 100644 --- a/test/integration/utils.go +++ b/test/integration/utils.go @@ -35,7 +35,7 @@ import ( // DeletePodOrErrorf deletes a pod or fails with a call to t.Errorf. func DeletePodOrErrorf(t *testing.T, c clientset.Interface, ns, name string) { - if err := c.CoreV1().Pods(ns).Delete(context.TODO(), name, nil); err != nil { + if err := c.CoreV1().Pods(ns).Delete(context.TODO(), name, metav1.DeleteOptions{}); err != nil { t.Errorf("unable to delete pod %v: %v", name, err) } } diff --git a/test/integration/volume/persistent_volumes_test.go b/test/integration/volume/persistent_volumes_test.go index c37f1712820..3c5f0e978f2 100644 --- a/test/integration/volume/persistent_volumes_test.go +++ b/test/integration/volume/persistent_volumes_test.go @@ -117,7 +117,7 @@ func TestPersistentVolumeRecycler(t *testing.T) { // NOTE: This test cannot run in parallel, because it is creating and deleting // non-namespaced objects (PersistenceVolumes). - defer testClient.CoreV1().PersistentVolumes().DeleteCollection(context.TODO(), nil, metav1.ListOptions{}) + defer testClient.CoreV1().PersistentVolumes().DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{}) stopCh := make(chan struct{}) informers.Start(stopCh) @@ -147,7 +147,7 @@ func TestPersistentVolumeRecycler(t *testing.T) { klog.V(2).Infof("TestPersistentVolumeRecycler pvc bound") // deleting a claim releases the volume, after which it can be recycled - if err := testClient.CoreV1().PersistentVolumeClaims(ns.Name).Delete(context.TODO(), pvc.Name, nil); err != nil { + if err := testClient.CoreV1().PersistentVolumeClaims(ns.Name).Delete(context.TODO(), pvc.Name, metav1.DeleteOptions{}); err != nil { t.Errorf("error deleting claim %s", pvc.Name) } klog.V(2).Infof("TestPersistentVolumeRecycler pvc deleted") @@ -172,7 +172,7 @@ func TestPersistentVolumeDeleter(t *testing.T) { // NOTE: This test cannot run in parallel, because it is creating and deleting // non-namespaced objects (PersistenceVolumes). - defer testClient.CoreV1().PersistentVolumes().DeleteCollection(context.TODO(), nil, metav1.ListOptions{}) + defer testClient.CoreV1().PersistentVolumes().DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{}) stopCh := make(chan struct{}) informers.Start(stopCh) @@ -199,7 +199,7 @@ func TestPersistentVolumeDeleter(t *testing.T) { klog.V(2).Infof("TestPersistentVolumeDeleter pvc bound") // deleting a claim releases the volume, after which it can be recycled - if err := testClient.CoreV1().PersistentVolumeClaims(ns.Name).Delete(context.TODO(), pvc.Name, nil); err != nil { + if err := testClient.CoreV1().PersistentVolumeClaims(ns.Name).Delete(context.TODO(), pvc.Name, metav1.DeleteOptions{}); err != nil { t.Errorf("error deleting claim %s", pvc.Name) } klog.V(2).Infof("TestPersistentVolumeDeleter pvc deleted") @@ -232,7 +232,7 @@ func TestPersistentVolumeBindRace(t *testing.T) { // NOTE: This test cannot run in parallel, because it is creating and deleting // non-namespaced objects (PersistenceVolumes). - defer testClient.CoreV1().PersistentVolumes().DeleteCollection(context.TODO(), nil, metav1.ListOptions{}) + defer testClient.CoreV1().PersistentVolumes().DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{}) stopCh := make(chan struct{}) informers.Start(stopCh) @@ -302,7 +302,7 @@ func TestPersistentVolumeClaimLabelSelector(t *testing.T) { // NOTE: This test cannot run in parallel, because it is creating and deleting // non-namespaced objects (PersistenceVolumes). - defer testClient.CoreV1().PersistentVolumes().DeleteCollection(context.TODO(), nil, metav1.ListOptions{}) + defer testClient.CoreV1().PersistentVolumes().DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{}) stopCh := make(chan struct{}) informers.Start(stopCh) @@ -383,7 +383,7 @@ func TestPersistentVolumeClaimLabelSelectorMatchExpressions(t *testing.T) { // NOTE: This test cannot run in parallel, because it is creating and deleting // non-namespaced objects (PersistenceVolumes). - defer testClient.CoreV1().PersistentVolumes().DeleteCollection(context.TODO(), nil, metav1.ListOptions{}) + defer testClient.CoreV1().PersistentVolumes().DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{}) stopCh := make(chan struct{}) informers.Start(stopCh) @@ -483,7 +483,7 @@ func TestPersistentVolumeMultiPVs(t *testing.T) { // NOTE: This test cannot run in parallel, because it is creating and deleting // non-namespaced objects (PersistenceVolumes). - defer testClient.CoreV1().PersistentVolumes().DeleteCollection(context.TODO(), nil, metav1.ListOptions{}) + defer testClient.CoreV1().PersistentVolumes().DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{}) stopCh := make(chan struct{}) informers.Start(stopCh) @@ -549,7 +549,7 @@ func TestPersistentVolumeMultiPVs(t *testing.T) { } // deleting a claim releases the volume - if err := testClient.CoreV1().PersistentVolumeClaims(ns.Name).Delete(context.TODO(), pvc.Name, nil); err != nil { + if err := testClient.CoreV1().PersistentVolumeClaims(ns.Name).Delete(context.TODO(), pvc.Name, metav1.DeleteOptions{}); err != nil { t.Errorf("error deleting claim %s", pvc.Name) } t.Log("claim deleted") @@ -573,7 +573,7 @@ func TestPersistentVolumeMultiPVsPVCs(t *testing.T) { // NOTE: This test cannot run in parallel, because it is creating and deleting // non-namespaced objects (PersistenceVolumes). - defer testClient.CoreV1().PersistentVolumes().DeleteCollection(context.TODO(), nil, metav1.ListOptions{}) + defer testClient.CoreV1().PersistentVolumes().DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{}) controllerStopCh := make(chan struct{}) informers.Start(controllerStopCh) @@ -862,8 +862,8 @@ func TestPersistentVolumeProvisionMultiPVCs(t *testing.T) { // NOTE: This test cannot run in parallel, because it is creating and deleting // non-namespaced objects (PersistenceVolumes and StorageClasses). - defer testClient.CoreV1().PersistentVolumes().DeleteCollection(context.TODO(), nil, metav1.ListOptions{}) - defer testClient.StorageV1().StorageClasses().DeleteCollection(context.TODO(), nil, metav1.ListOptions{}) + defer testClient.CoreV1().PersistentVolumes().DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{}) + defer testClient.StorageV1().StorageClasses().DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{}) storageClass := storage.StorageClass{ TypeMeta: metav1.TypeMeta{ @@ -922,7 +922,7 @@ func TestPersistentVolumeProvisionMultiPVCs(t *testing.T) { // Delete the claims for i := 0; i < objCount; i++ { - _ = testClient.CoreV1().PersistentVolumeClaims(ns.Name).Delete(context.TODO(), pvcs[i].Name, nil) + _ = testClient.CoreV1().PersistentVolumeClaims(ns.Name).Delete(context.TODO(), pvcs[i].Name, metav1.DeleteOptions{}) } // Wait for the PVs to get deleted by listing remaining volumes @@ -957,7 +957,7 @@ func TestPersistentVolumeMultiPVsDiffAccessModes(t *testing.T) { // NOTE: This test cannot run in parallel, because it is creating and deleting // non-namespaced objects (PersistenceVolumes). - defer testClient.CoreV1().PersistentVolumes().DeleteCollection(context.TODO(), nil, metav1.ListOptions{}) + defer testClient.CoreV1().PersistentVolumes().DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{}) stopCh := make(chan struct{}) informers.Start(stopCh) @@ -1014,7 +1014,7 @@ func TestPersistentVolumeMultiPVsDiffAccessModes(t *testing.T) { } // deleting a claim releases the volume - if err := testClient.CoreV1().PersistentVolumeClaims(ns.Name).Delete(context.TODO(), pvc.Name, nil); err != nil { + if err := testClient.CoreV1().PersistentVolumeClaims(ns.Name).Delete(context.TODO(), pvc.Name, metav1.DeleteOptions{}); err != nil { t.Errorf("error deleting claim %s", pvc.Name) } t.Log("claim deleted") diff --git a/test/integration/volumescheduling/util.go b/test/integration/volumescheduling/util.go index 49b2bfbc3a7..a4efc0fde6f 100644 --- a/test/integration/volumescheduling/util.go +++ b/test/integration/volumescheduling/util.go @@ -135,7 +135,7 @@ func cleanupTest(t *testing.T, testCtx *testContext) { // Kill the scheduler. testCtx.cancelFn() // Cleanup nodes. - testCtx.clientSet.CoreV1().Nodes().DeleteCollection(context.TODO(), nil, metav1.ListOptions{}) + testCtx.clientSet.CoreV1().Nodes().DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{}) framework.DeleteTestingNamespace(testCtx.ns, testCtx.httpServer, t) testCtx.closeFn() } diff --git a/test/integration/volumescheduling/volume_binding_test.go b/test/integration/volumescheduling/volume_binding_test.go index 22d81603724..25b4a0b1508 100644 --- a/test/integration/volumescheduling/volume_binding_test.go +++ b/test/integration/volumescheduling/volume_binding_test.go @@ -56,7 +56,7 @@ type testConfig struct { var ( // Delete API objects immediately deletePeriod = int64(0) - deleteOption = &metav1.DeleteOptions{GracePeriodSeconds: &deletePeriod} + deleteOption = metav1.DeleteOptions{GracePeriodSeconds: &deletePeriod} modeWait = storagev1.VolumeBindingWaitForFirstConsumer modeImmediate = storagev1.VolumeBindingImmediate @@ -693,7 +693,7 @@ func TestPVAffinityConflict(t *testing.T) { t.Fatalf("Failed as Pod's %s failure message does not contain expected message: node(s) didn't match node selector, node(s) had volume node affinity conflict. Got message %q", podName, p.Status.Conditions[0].Message) } // Deleting test pod - if err := config.client.CoreV1().Pods(config.ns).Delete(context.TODO(), podName, &metav1.DeleteOptions{}); err != nil { + if err := config.client.CoreV1().Pods(config.ns).Delete(context.TODO(), podName, metav1.DeleteOptions{}); err != nil { t.Fatalf("Failed to delete Pod %s: %v", podName, err) } } @@ -847,8 +847,8 @@ func TestRescheduleProvisioning(t *testing.T) { defer func() { close(controllerCh) - deleteTestObjects(clientset, ns, nil) - testCtx.clientSet.CoreV1().Nodes().DeleteCollection(context.TODO(), nil, metav1.ListOptions{}) + deleteTestObjects(clientset, ns, metav1.DeleteOptions{}) + testCtx.clientSet.CoreV1().Nodes().DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{}) testCtx.closeFn() }() @@ -931,7 +931,7 @@ func setupCluster(t *testing.T, nsName string, numberOfNodes int, resyncPeriod t stop: textCtx.ctx.Done(), teardown: func() { klog.Infof("test cluster %q start to tear down", ns) - deleteTestObjects(clientset, ns, nil) + deleteTestObjects(clientset, ns, metav1.DeleteOptions{}) cleanupTest(t, textCtx) }, } @@ -983,7 +983,7 @@ func initPVController(t *testing.T, testCtx *testContext, provisionDelaySeconds return ctrl, informerFactory, nil } -func deleteTestObjects(client clientset.Interface, ns string, option *metav1.DeleteOptions) { +func deleteTestObjects(client clientset.Interface, ns string, option metav1.DeleteOptions) { client.CoreV1().Pods(ns).DeleteCollection(context.TODO(), option, metav1.ListOptions{}) client.CoreV1().PersistentVolumeClaims(ns).DeleteCollection(context.TODO(), option, metav1.ListOptions{}) client.CoreV1().PersistentVolumes().DeleteCollection(context.TODO(), option, metav1.ListOptions{}) diff --git a/test/soak/serve_hostnames/serve_hostnames.go b/test/soak/serve_hostnames/serve_hostnames.go index 3071e0ff9ec..6d5951c1aa2 100644 --- a/test/soak/serve_hostnames/serve_hostnames.go +++ b/test/soak/serve_hostnames/serve_hostnames.go @@ -122,7 +122,7 @@ func main() { } ns := got.Name defer func(ns string) { - if err := client.CoreV1().Namespaces().Delete(context.TODO(), ns, nil); err != nil { + if err := client.CoreV1().Namespaces().Delete(context.TODO(), ns, metav1.DeleteOptions{}); err != nil { klog.Warningf("Failed to delete namespace %s: %v", ns, err) } else { // wait until the namespace disappears @@ -177,7 +177,7 @@ func main() { klog.Infof("Cleaning up service %s/serve-hostnames", ns) // Make several attempts to delete the service. for start := time.Now(); time.Since(start) < deleteTimeout; time.Sleep(1 * time.Second) { - if err := client.CoreV1().Services(ns).Delete(context.TODO(), svc.Name, nil); err == nil { + if err := client.CoreV1().Services(ns).Delete(context.TODO(), svc.Name, metav1.DeleteOptions{}); err == nil { return } klog.Warningf("After %v unable to delete service %s/%s: %v", time.Since(start), ns, svc.Name, err) @@ -230,7 +230,7 @@ func main() { // Make several attempts to delete the pods. for _, podName := range podNames { for start := time.Now(); time.Since(start) < deleteTimeout; time.Sleep(1 * time.Second) { - if err = client.CoreV1().Pods(ns).Delete(context.TODO(), podName, nil); err == nil { + if err = client.CoreV1().Pods(ns).Delete(context.TODO(), podName, metav1.DeleteOptions{}); err == nil { break } klog.Warningf("After %v failed to delete pod %s/%s: %v", time.Since(start), ns, podName, err) diff --git a/test/utils/delete_resources.go b/test/utils/delete_resources.go index 60d1ba44e8c..01c21842286 100644 --- a/test/utils/delete_resources.go +++ b/test/utils/delete_resources.go @@ -32,7 +32,7 @@ import ( extensionsinternal "k8s.io/kubernetes/pkg/apis/extensions" ) -func deleteResource(c clientset.Interface, kind schema.GroupKind, namespace, name string, options *metav1.DeleteOptions) error { +func deleteResource(c clientset.Interface, kind schema.GroupKind, namespace, name string, options metav1.DeleteOptions) error { switch kind { case api.Kind("Pod"): return c.CoreV1().Pods(namespace).Delete(context.TODO(), name, options) @@ -57,7 +57,7 @@ func deleteResource(c clientset.Interface, kind schema.GroupKind, namespace, nam } } -func DeleteResourceWithRetries(c clientset.Interface, kind schema.GroupKind, namespace, name string, options *metav1.DeleteOptions) error { +func DeleteResourceWithRetries(c clientset.Interface, kind schema.GroupKind, namespace, name string, options metav1.DeleteOptions) error { deleteFunc := func() (bool, error) { err := deleteResource(c, kind, namespace, name, options) if err == nil || apierrors.IsNotFound(err) { diff --git a/test/utils/runners.go b/test/utils/runners.go index 3d0498cfd21..aaac8bd37d5 100644 --- a/test/utils/runners.go +++ b/test/utils/runners.go @@ -1565,7 +1565,7 @@ func (config *SecretConfig) Run() error { } func (config *SecretConfig) Stop() error { - if err := DeleteResourceWithRetries(config.Client, api.Kind("Secret"), config.Namespace, config.Name, &metav1.DeleteOptions{}); err != nil { + if err := DeleteResourceWithRetries(config.Client, api.Kind("Secret"), config.Namespace, config.Name, metav1.DeleteOptions{}); err != nil { return fmt.Errorf("Error deleting secret: %v", err) } config.LogFunc("Deleted secret %v/%v", config.Namespace, config.Name) @@ -1623,7 +1623,7 @@ func (config *ConfigMapConfig) Run() error { } func (config *ConfigMapConfig) Stop() error { - if err := DeleteResourceWithRetries(config.Client, api.Kind("ConfigMap"), config.Namespace, config.Name, &metav1.DeleteOptions{}); err != nil { + if err := DeleteResourceWithRetries(config.Client, api.Kind("ConfigMap"), config.Namespace, config.Name, metav1.DeleteOptions{}); err != nil { return fmt.Errorf("Error deleting configmap: %v", err) } config.LogFunc("Deleted configmap %v/%v", config.Namespace, config.Name)