Skip to content

Commit 4f9521a

Browse files
committed
Replace references to Fake* types removed in client-go bump.
1 parent 056febb commit 4f9521a

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

pkg/user/apiserver/registry/useridentitymapping/identity_test.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
kerrs "k8s.io/apimachinery/pkg/api/errors"
77
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
88

9-
userapi "github.com/openshift/api/user/v1"
10-
"github.com/openshift/client-go/user/clientset/versioned/typed/user/v1/fake"
9+
userv1 "github.com/openshift/api/user/v1"
10+
userv1client "github.com/openshift/client-go/user/clientset/versioned/typed/user/v1"
1111
)
1212

1313
type Action struct {
@@ -16,54 +16,54 @@ type Action struct {
1616
}
1717

1818
type IdentityRegistry struct {
19-
*fake.FakeIdentities
19+
userv1client.IdentityInterface
2020

2121
GetErr map[string]error
22-
GetIdentities map[string]*userapi.Identity
22+
GetIdentities map[string]*userv1.Identity
2323

2424
CreateErr error
25-
CreateIdentity *userapi.Identity
25+
CreateIdentity *userv1.Identity
2626

2727
UpdateErr error
28-
UpdateIdentity *userapi.Identity
28+
UpdateIdentity *userv1.Identity
2929

3030
ListErr error
31-
ListIdentity *userapi.IdentityList
31+
ListIdentity *userv1.IdentityList
3232

3333
Actions *[]Action
3434
}
3535

36-
func (r *IdentityRegistry) Get(_ context.Context, name string, options metav1.GetOptions) (*userapi.Identity, error) {
36+
func (r *IdentityRegistry) Get(_ context.Context, name string, options metav1.GetOptions) (*userv1.Identity, error) {
3737
*r.Actions = append(*r.Actions, Action{"GetIdentity", name})
3838
if identity, ok := r.GetIdentities[name]; ok {
3939
return identity, nil
4040
}
4141
if err, ok := r.GetErr[name]; ok {
4242
return nil, err
4343
}
44-
return nil, kerrs.NewNotFound(userapi.Resource("identity"), name)
44+
return nil, kerrs.NewNotFound(userv1.Resource("identity"), name)
4545
}
4646

47-
func (r *IdentityRegistry) Create(_ context.Context, u *userapi.Identity, _ metav1.CreateOptions) (*userapi.Identity, error) {
47+
func (r *IdentityRegistry) Create(_ context.Context, u *userv1.Identity, _ metav1.CreateOptions) (*userv1.Identity, error) {
4848
*r.Actions = append(*r.Actions, Action{"CreateIdentity", u})
4949
if r.CreateIdentity == nil && r.CreateErr == nil {
5050
return u, nil
5151
}
5252
return r.CreateIdentity, r.CreateErr
5353
}
5454

55-
func (r *IdentityRegistry) Update(_ context.Context, u *userapi.Identity, _ metav1.UpdateOptions) (*userapi.Identity, error) {
55+
func (r *IdentityRegistry) Update(_ context.Context, u *userv1.Identity, _ metav1.UpdateOptions) (*userv1.Identity, error) {
5656
*r.Actions = append(*r.Actions, Action{"UpdateIdentity", u})
5757
if r.UpdateIdentity == nil && r.UpdateErr == nil {
5858
return u, nil
5959
}
6060
return r.UpdateIdentity, r.UpdateErr
6161
}
6262

63-
func (r *IdentityRegistry) List(_ context.Context, options metav1.ListOptions) (*userapi.IdentityList, error) {
63+
func (r *IdentityRegistry) List(_ context.Context, options metav1.ListOptions) (*userv1.IdentityList, error) {
6464
*r.Actions = append(*r.Actions, Action{"ListIdentities", options})
6565
if r.ListIdentity == nil && r.ListErr == nil {
66-
return &userapi.IdentityList{}, nil
66+
return &userv1.IdentityList{}, nil
6767
}
6868
return r.ListIdentity, r.ListErr
6969
}

pkg/user/apiserver/registry/useridentitymapping/user_test.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,49 +6,49 @@ import (
66
kerrs "k8s.io/apimachinery/pkg/api/errors"
77
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
88

9-
userapi "github.com/openshift/api/user/v1"
10-
"github.com/openshift/client-go/user/clientset/versioned/typed/user/v1/fake"
9+
userv1 "github.com/openshift/api/user/v1"
10+
userv1client "github.com/openshift/client-go/user/clientset/versioned/typed/user/v1"
1111
)
1212

1313
type UserRegistry struct {
1414
// included to fill out the interface for testing
15-
*fake.FakeUsers
15+
userv1client.UserInterface
1616

1717
GetErr map[string]error
18-
GetUsers map[string]*userapi.User
18+
GetUsers map[string]*userv1.User
1919

2020
CreateErr error
21-
CreateUser *userapi.User
21+
CreateUser *userv1.User
2222

2323
UpdateErr map[string]error
24-
UpdateUser *userapi.User
24+
UpdateUser *userv1.User
2525

2626
ListErr error
27-
ListUsers *userapi.UserList
27+
ListUsers *userv1.UserList
2828

2929
Actions *[]Action
3030
}
3131

32-
func (r *UserRegistry) Get(_ context.Context, name string, options metav1.GetOptions) (*userapi.User, error) {
32+
func (r *UserRegistry) Get(_ context.Context, name string, options metav1.GetOptions) (*userv1.User, error) {
3333
*r.Actions = append(*r.Actions, Action{"GetUser", name})
3434
if user, ok := r.GetUsers[name]; ok {
3535
return user, nil
3636
}
3737
if err, ok := r.GetErr[name]; ok {
3838
return nil, err
3939
}
40-
return nil, kerrs.NewNotFound(userapi.Resource("user"), name)
40+
return nil, kerrs.NewNotFound(userv1.Resource("user"), name)
4141
}
4242

43-
func (r *UserRegistry) Create(_ context.Context, u *userapi.User, _ metav1.CreateOptions) (*userapi.User, error) {
43+
func (r *UserRegistry) Create(_ context.Context, u *userv1.User, _ metav1.CreateOptions) (*userv1.User, error) {
4444
*r.Actions = append(*r.Actions, Action{"CreateUser", u})
4545
if r.CreateUser == nil && r.CreateErr == nil {
4646
return u, nil
4747
}
4848
return r.CreateUser, r.CreateErr
4949
}
5050

51-
func (r *UserRegistry) Update(_ context.Context, u *userapi.User, _ metav1.UpdateOptions) (*userapi.User, error) {
51+
func (r *UserRegistry) Update(_ context.Context, u *userv1.User, _ metav1.UpdateOptions) (*userv1.User, error) {
5252
*r.Actions = append(*r.Actions, Action{"UpdateUser", u})
5353
err, _ := r.UpdateErr[u.Name]
5454
if r.UpdateUser == nil && err == nil {
@@ -57,10 +57,10 @@ func (r *UserRegistry) Update(_ context.Context, u *userapi.User, _ metav1.Updat
5757
return r.UpdateUser, err
5858
}
5959

60-
func (r *UserRegistry) List(_ context.Context, options metav1.ListOptions) (*userapi.UserList, error) {
60+
func (r *UserRegistry) List(_ context.Context, options metav1.ListOptions) (*userv1.UserList, error) {
6161
*r.Actions = append(*r.Actions, Action{"ListUsers", options})
6262
if r.ListUsers == nil && r.ListErr == nil {
63-
return &userapi.UserList{}, nil
63+
return &userv1.UserList{}, nil
6464
}
6565
return r.ListUsers, r.ListErr
6666
}

0 commit comments

Comments
 (0)