forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake.go
141 lines (108 loc) · 4.07 KB
/
fake.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
package client
import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/client/testclient"
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
)
type FakeAction testclient.FakeAction
// Fake implements Interface. Meant to be embedded into a struct to get a default
// implementation. This makes faking out just the method you want to test easier.
type Fake struct {
// Fake by default keeps a simple list of the methods that have been called.
Actions []FakeAction
Err error
// ReactFn is an optional function that will be invoked with the provided action
// and return a response.
ReactFn testclient.ReactionFunc
}
func (c *Fake) Invokes(action FakeAction, obj runtime.Object) (runtime.Object, error) {
c.Actions = append(c.Actions, action)
if c.ReactFn != nil {
return c.ReactFn(testclient.FakeAction(action))
}
return obj, c.Err
}
var _ Interface = &Fake{}
func (c *Fake) Builds(namespace string) BuildInterface {
return &FakeBuilds{Fake: c, Namespace: namespace}
}
func (c *Fake) BuildConfigs(namespace string) BuildConfigInterface {
return &FakeBuildConfigs{Fake: c, Namespace: namespace}
}
func (c *Fake) BuildLogs(namespace string) BuildLogsInterface {
return &FakeBuildLogs{Fake: c, Namespace: namespace}
}
func (c *Fake) Images() ImageInterface {
return &FakeImages{Fake: c}
}
func (c *Fake) ImageRepositories(namespace string) ImageRepositoryInterface {
return &FakeImageRepositories{Fake: c, Namespace: namespace}
}
func (c *Fake) ImageRepositoryMappings(namespace string) ImageRepositoryMappingInterface {
return &FakeImageRepositoryMappings{Fake: c, Namespace: namespace}
}
func (c *Fake) ImageRepositoryTags(namespace string) ImageRepositoryTagInterface {
return &FakeImageRepositoryTags{Fake: c, Namespace: namespace}
}
func (c *Fake) ImageStreams(namespace string) ImageStreamInterface {
return &FakeImageStreams{Fake: c, Namespace: namespace}
}
func (c *Fake) ImageStreamMappings(namespace string) ImageStreamMappingInterface {
return &FakeImageStreamMappings{Fake: c, Namespace: namespace}
}
func (c *Fake) ImageStreamTags(namespace string) ImageStreamTagInterface {
return &FakeImageStreamTags{Fake: c, Namespace: namespace}
}
func (c *Fake) ImageStreamImages(namespace string) ImageStreamImageInterface {
return &FakeImageStreamImages{Fake: c, Namespace: namespace}
}
func (c *Fake) Deployments(namespace string) DeploymentInterface {
return &FakeDeployments{Fake: c, Namespace: namespace}
}
func (c *Fake) DeploymentConfigs(namespace string) DeploymentConfigInterface {
return &FakeDeploymentConfigs{Fake: c, Namespace: namespace}
}
func (c *Fake) Routes(namespace string) RouteInterface {
return &FakeRoutes{Fake: c, Namespace: namespace}
}
func (c *Fake) Templates(namespace string) TemplateInterface {
return &FakeTemplates{Fake: c}
}
func (c *Fake) TemplateConfigs(namespace string) TemplateConfigInterface {
return &FakeTemplateConfigs{Fake: c}
}
func (c *Fake) Identities() IdentityInterface {
return &FakeIdentities{Fake: c}
}
func (c *Fake) Users() UserInterface {
return &FakeUsers{Fake: c}
}
func (c *Fake) UserIdentityMappings() UserIdentityMappingInterface {
return &FakeUserIdentityMappings{Fake: c}
}
func (c *Fake) Projects() ProjectInterface {
return &FakeProjects{Fake: c}
}
func (c *Fake) ProjectRequests() ProjectRequestInterface {
return &FakeProjectRequests{Fake: c}
}
func (c *Fake) Policies(namespace string) PolicyInterface {
return &FakePolicies{Fake: c}
}
func (c *Fake) Roles(namespace string) RoleInterface {
return &FakeRoles{Fake: c}
}
func (c *Fake) RoleBindings(namespace string) RoleBindingInterface {
return &FakeRoleBindings{Fake: c}
}
func (c *Fake) PolicyBindings(namespace string) PolicyBindingInterface {
return &FakePolicyBindings{Fake: c}
}
func (c *Fake) ResourceAccessReviews(namespace string) ResourceAccessReviewInterface {
return &FakeResourceAccessReviews{Fake: c}
}
func (c *Fake) RootResourceAccessReviews() ResourceAccessReviewInterface {
return &FakeRootResourceAccessReviews{Fake: c}
}
func (c *Fake) SubjectAccessReviews(namespace string) SubjectAccessReviewInterface {
return &FakeSubjectAccessReviews{Fake: c}
}