forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_policies.go
32 lines (25 loc) · 1.01 KB
/
fake_policies.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
package client
import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"github.com/GoogleCloudPlatform/kubernetes/pkg/watch"
authorizationapi "github.com/openshift/origin/pkg/authorization/api"
)
type FakePolicies struct {
Fake *Fake
}
func (c *FakePolicies) List(label, field labels.Selector) (*authorizationapi.PolicyList, error) {
c.Fake.Actions = append(c.Fake.Actions, FakeAction{Action: "list-policies"})
return &authorizationapi.PolicyList{}, nil
}
func (c *FakePolicies) Get(name string) (*authorizationapi.Policy, error) {
c.Fake.Actions = append(c.Fake.Actions, FakeAction{Action: "get-policy"})
return &authorizationapi.Policy{}, nil
}
func (c *FakePolicies) Delete(name string) error {
c.Fake.Actions = append(c.Fake.Actions, FakeAction{Action: "delete-policy", Value: name})
return nil
}
func (c *FakePolicies) Watch(label, field labels.Selector, resourceVersion string) (watch.Interface, error) {
c.Fake.Actions = append(c.Fake.Actions, FakeAction{Action: "watch-policy"})
return nil, nil
}