some manual fixes

Kubernetes-commit: 26377722982a8489d2a974db88e7478e54e4eaf0
This commit is contained in:
Mike Danese 2019-12-17 00:01:53 -08:00 committed by Kubernetes Publisher
parent 3e02731f97
commit 6b3a79f9fc
4 changed files with 12 additions and 9 deletions

View File

@ -119,7 +119,7 @@ func (e *events) Search(scheme *runtime.Scheme, objOrRef runtime.Object) (*v1.Ev
refUID = &stringRefUID refUID = &stringRefUID
} }
fieldSelector := e.GetFieldSelector(&ref.Name, &ref.Namespace, refKind, refUID) fieldSelector := e.GetFieldSelector(&ref.Name, &ref.Namespace, refKind, refUID)
return e.List(metav1.ListOptions{FieldSelector: fieldSelector.String()}) return e.List(context.TODO(), metav1.ListOptions{FieldSelector: fieldSelector.String()})
} }
// Returns the appropriate field selector based on the API version being used to communicate with the server. // Returns the appropriate field selector based on the API version being used to communicate with the server.

View File

@ -17,13 +17,15 @@ limitations under the License.
package fake package fake
import ( import (
"k8s.io/api/core/v1" "context"
v1 "k8s.io/api/core/v1"
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
core "k8s.io/client-go/testing" core "k8s.io/client-go/testing"
) )
// TODO: Should take a PatchType as an argument probably. // TODO: Should take a PatchType as an argument probably.
func (c *FakeNodes) PatchStatus(nodeName string, data []byte) (*v1.Node, error) { func (c *FakeNodes) PatchStatus(_ context.Context, nodeName string, data []byte) (*v1.Node, error) {
// TODO: Should be configurable to support additional patch strategies. // TODO: Should be configurable to support additional patch strategies.
pt := types.StrategicMergePatchType pt := types.StrategicMergePatchType
obj, err := c.Fake.Invokes( obj, err := c.Fake.Invokes(

View File

@ -27,19 +27,19 @@ import (
type NodeExpansion interface { type NodeExpansion interface {
// PatchStatus modifies the status of an existing node. It returns the copy // PatchStatus modifies the status of an existing node. It returns the copy
// of the node that the server returns, or an error. // of the node that the server returns, or an error.
PatchStatus(nodeName string, data []byte) (*v1.Node, error) PatchStatus(ctx context.Context, nodeName string, data []byte) (*v1.Node, error)
} }
// PatchStatus modifies the status of an existing node. It returns the copy of // PatchStatus modifies the status of an existing node. It returns the copy of
// the node that the server returns, or an error. // the node that the server returns, or an error.
func (c *nodes) PatchStatus(nodeName string, data []byte) (*v1.Node, error) { func (c *nodes) PatchStatus(ctx context.Context, nodeName string, data []byte) (*v1.Node, error) {
result := &v1.Node{} result := &v1.Node{}
err := c.client.Patch(types.StrategicMergePatchType). err := c.client.Patch(types.StrategicMergePatchType).
Resource("nodes"). Resource("nodes").
Name(nodeName). Name(nodeName).
SubResource("status"). SubResource("status").
Body(data). Body(data).
Do(context.TODO()). Do(ctx).
Into(result) Into(result)
return result, err return result, err
} }

View File

@ -18,6 +18,7 @@ package certificate
import ( import (
"bytes" "bytes"
"context"
"crypto/tls" "crypto/tls"
"crypto/x509" "crypto/x509"
"crypto/x509/pkix" "crypto/x509/pkix"
@ -996,7 +997,7 @@ type fakeClient struct {
err error err error
} }
func (c fakeClient) List(opts v1.ListOptions) (*certificates.CertificateSigningRequestList, error) { func (c fakeClient) List(_ context.Context, opts v1.ListOptions) (*certificates.CertificateSigningRequestList, error) {
if c.failureType == watchError { if c.failureType == watchError {
if c.err != nil { if c.err != nil {
return nil, c.err return nil, c.err
@ -1011,7 +1012,7 @@ func (c fakeClient) List(opts v1.ListOptions) (*certificates.CertificateSigningR
return &csrReply, nil return &csrReply, nil
} }
func (c fakeClient) Create(*certificates.CertificateSigningRequest) (*certificates.CertificateSigningRequest, error) { func (c fakeClient) Create(context.Context, *certificates.CertificateSigningRequest) (*certificates.CertificateSigningRequest, error) {
if c.failureType == createError { if c.failureType == createError {
if c.err != nil { if c.err != nil {
return nil, c.err return nil, c.err
@ -1023,7 +1024,7 @@ func (c fakeClient) Create(*certificates.CertificateSigningRequest) (*certificat
return &csrReply, nil return &csrReply, nil
} }
func (c fakeClient) Watch(opts v1.ListOptions) (watch.Interface, error) { func (c fakeClient) Watch(_ context.Context, opts v1.ListOptions) (watch.Interface, error) {
if c.failureType == watchError { if c.failureType == watchError {
if c.err != nil { if c.err != nil {
return nil, c.err return nil, c.err