generated: run refactor

Kubernetes-commit: 25651408aeadf38c3df7ea8c760e7519fd37d625
This commit is contained in:
Mike Danese
2020-02-08 12:30:21 -05:00
committed by Kubernetes Publisher
parent c44f517f89
commit 6659ae5216
6 changed files with 10 additions and 10 deletions

View File

@@ -101,7 +101,7 @@ func main() {
// Create Deployment
fmt.Println("Creating deployment...")
result, err := deploymentsClient.Create(context.TODO(), deployment)
result, err := deploymentsClient.Create(context.TODO(), deployment, metav1.CreateOptions{})
if err != nil {
panic(err)
}
@@ -133,7 +133,7 @@ func main() {
result.Spec.Replicas = int32Ptr(1) // reduce replica count
result.Spec.Template.Spec.Containers[0].Image = "nginx:1.13" // change nginx version
_, updateErr := deploymentsClient.Update(context.TODO(), result)
_, updateErr := deploymentsClient.Update(context.TODO(), result, metav1.UpdateOptions{})
return updateErr
})
if retryErr != nil {

View File

@@ -59,7 +59,7 @@ func TestFakeClient(t *testing.T) {
// Inject an event into the fake client.
p := &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "my-pod"}}
_, err := client.CoreV1().Pods("test-ns").Create(context.TODO(), p)
_, err := client.CoreV1().Pods("test-ns").Create(context.TODO(), p, metav1.CreateOptions{})
if err != nil {
t.Fatalf("error injecting pod add: %v", err)
}

View File

@@ -75,7 +75,7 @@ func (cml *ConfigMapLock) Create(ler LeaderElectionRecord) error {
LeaderElectionRecordAnnotationKey: string(recordBytes),
},
},
})
}, metav1.CreateOptions{})
return err
}
@@ -89,7 +89,7 @@ func (cml *ConfigMapLock) Update(ler LeaderElectionRecord) error {
return err
}
cml.cm.Annotations[LeaderElectionRecordAnnotationKey] = string(recordBytes)
cml.cm, err = cml.Client.ConfigMaps(cml.ConfigMapMeta.Namespace).Update(context.TODO(), cml.cm)
cml.cm, err = cml.Client.ConfigMaps(cml.ConfigMapMeta.Namespace).Update(context.TODO(), cml.cm, metav1.UpdateOptions{})
return err
}

View File

@@ -70,7 +70,7 @@ func (el *EndpointsLock) Create(ler LeaderElectionRecord) error {
LeaderElectionRecordAnnotationKey: string(recordBytes),
},
},
})
}, metav1.CreateOptions{})
return err
}
@@ -87,7 +87,7 @@ func (el *EndpointsLock) Update(ler LeaderElectionRecord) error {
el.e.Annotations = make(map[string]string)
}
el.e.Annotations[LeaderElectionRecordAnnotationKey] = string(recordBytes)
el.e, err = el.Client.Endpoints(el.EndpointsMeta.Namespace).Update(context.TODO(), el.e)
el.e, err = el.Client.Endpoints(el.EndpointsMeta.Namespace).Update(context.TODO(), el.e, metav1.UpdateOptions{})
return err
}

View File

@@ -61,7 +61,7 @@ func (ll *LeaseLock) Create(ler LeaderElectionRecord) error {
Namespace: ll.LeaseMeta.Namespace,
},
Spec: LeaderElectionRecordToLeaseSpec(&ler),
})
}, metav1.CreateOptions{})
return err
}
@@ -72,7 +72,7 @@ func (ll *LeaseLock) Update(ler LeaderElectionRecord) error {
}
ll.lease.Spec = LeaderElectionRecordToLeaseSpec(&ler)
var err error
ll.lease, err = ll.Client.Leases(ll.LeaseMeta.Namespace).Update(context.TODO(), ll.lease)
ll.lease, err = ll.Client.Leases(ll.LeaseMeta.Namespace).Update(context.TODO(), ll.lease, metav1.UpdateOptions{})
return err
}

View File

@@ -62,7 +62,7 @@ func RequestCertificate(client certificatesclient.CertificateSigningRequestInter
csr.GenerateName = "csr-"
}
req, err = client.Create(context.TODO(), csr)
req, err = client.Create(context.TODO(), csr, metav1.CreateOptions{})
switch {
case err == nil:
case errors.IsAlreadyExists(err) && len(name) > 0: