forked from projectatomic/atomic-enterprise
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_roles.go
37 lines (29 loc) · 1.21 KB
/
fake_roles.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package client
import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/fields"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
authorizationapi "github.com/openshift/origin/pkg/authorization/api"
)
type FakeRoles struct {
Fake *Fake
}
func (c *FakeRoles) List(label labels.Selector, field fields.Selector) (*authorizationapi.RoleList, error) {
c.Fake.Actions = append(c.Fake.Actions, FakeAction{Action: "list-role"})
return &authorizationapi.RoleList{}, nil
}
func (c *FakeRoles) Get(name string) (*authorizationapi.Role, error) {
c.Fake.Actions = append(c.Fake.Actions, FakeAction{Action: "get-role"})
return &authorizationapi.Role{}, nil
}
func (c *FakeRoles) Create(role *authorizationapi.Role) (*authorizationapi.Role, error) {
c.Fake.Actions = append(c.Fake.Actions, FakeAction{Action: "create-role", Value: role})
return &authorizationapi.Role{}, nil
}
func (c *FakeRoles) Update(role *authorizationapi.Role) (*authorizationapi.Role, error) {
c.Fake.Actions = append(c.Fake.Actions, FakeAction{Action: "update-role"})
return &authorizationapi.Role{}, nil
}
func (c *FakeRoles) Delete(name string) error {
c.Fake.Actions = append(c.Fake.Actions, FakeAction{Action: "delete-role", Value: name})
return nil
}