mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-20 10:39:46 +00:00
Collapse duplicate code into pkg/util/csr
There is no reason to duplicate this code into two places. Kubernetes-commit: c3bea24ab6242b084e7d09073c8906c778611243
This commit is contained in:
committed by
Kubernetes Publisher
parent
fc5236ea29
commit
bb96050dfb
@@ -643,6 +643,18 @@ type fakeClient struct {
|
||||
certificatePEM []byte
|
||||
}
|
||||
|
||||
func (c fakeClient) List(opts v1.ListOptions) (*certificates.CertificateSigningRequestList, error) {
|
||||
if c.failureType == watchError {
|
||||
return nil, fmt.Errorf("Watch error")
|
||||
}
|
||||
csrReply := certificates.CertificateSigningRequestList{
|
||||
Items: []certificates.CertificateSigningRequest{
|
||||
{ObjectMeta: v1.ObjectMeta{UID: "fake-uid"}},
|
||||
},
|
||||
}
|
||||
return &csrReply, nil
|
||||
}
|
||||
|
||||
func (c fakeClient) Create(*certificates.CertificateSigningRequest) (*certificates.CertificateSigningRequest, error) {
|
||||
if c.failureType == createError {
|
||||
return nil, fmt.Errorf("Create error")
|
||||
|
Reference in New Issue
Block a user