forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
91 lines (78 loc) · 3.25 KB
/
types.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
package admission
import (
"k8s.io/apiserver/pkg/admission"
kauthorizer "k8s.io/apiserver/pkg/authorization/authorizer"
restclient "k8s.io/client-go/rest"
kinternalinformers "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion"
"k8s.io/kubernetes/pkg/quota"
"github.com/openshift/origin/pkg/client"
configapi "github.com/openshift/origin/pkg/cmd/server/api"
imageapi "github.com/openshift/origin/pkg/image/apis/image"
"github.com/openshift/origin/pkg/project/cache"
"github.com/openshift/origin/pkg/quota/controller/clusterquotamapping"
quotainformer "github.com/openshift/origin/pkg/quota/generated/informers/internalversion/quota/internalversion"
securityinformer "github.com/openshift/origin/pkg/security/generated/informers/internalversion"
usercache "github.com/openshift/origin/pkg/user/cache"
)
// WantsOpenshiftClient should be implemented by admission plugins that need
// an Openshift client
type WantsOpenshiftClient interface {
SetOpenshiftClient(client.Interface)
admission.Validator
}
// WantsProjectCache should be implemented by admission plugins that need a
// project cache
type WantsProjectCache interface {
SetProjectCache(*cache.ProjectCache)
admission.Validator
}
// WantsQuotaRegistry should be implemented by admission plugins that need a quota registry
type WantsOriginQuotaRegistry interface {
SetOriginQuotaRegistry(quota.Registry)
admission.Validator
}
// WantsAuthorizer should be implemented by admission plugins that
// need access to the Authorizer interface
type WantsAuthorizer interface {
SetAuthorizer(kauthorizer.Authorizer)
admission.Validator
}
// WantsJenkinsPipelineConfig gives access to the JenkinsPipelineConfig. This is a historical oddity.
// It's likely that what we really wanted was this as an admission plugin config
type WantsJenkinsPipelineConfig interface {
SetJenkinsPipelineConfig(jenkinsConfig configapi.JenkinsPipelineConfig)
admission.Validator
}
// WantsRESTClientConfig gives access to a RESTClientConfig. It's useful for doing unusual things with transports.
type WantsRESTClientConfig interface {
SetRESTClientConfig(restclient.Config)
admission.Validator
}
// WantsInternalKubernetesInformers should be implemented by admission plugins that need the internal kubernetes
// informers.
type WantsInternalKubernetesInformers interface {
SetInternalKubernetesInformers(kinternalinformers.SharedInformerFactory)
admission.Validator
}
// WantsClusterQuota should be implemented by admission plugins that need to know how to map between
// cluster quota and namespaces and get access to the informer.
type WantsClusterQuota interface {
SetClusterQuota(clusterquotamapping.ClusterQuotaMapper, quotainformer.ClusterResourceQuotaInformer)
admission.Validator
}
type WantsSecurityInformer interface {
SetSecurityInformers(securityinformer.SharedInformerFactory)
admission.Validator
}
// WantsDefaultRegistryFunc should be implemented by admission plugins that need to know the default registry
// address.
type WantsDefaultRegistryFunc interface {
SetDefaultRegistryFunc(imageapi.DefaultRegistryFunc)
admission.Validator
}
// WantsGroupCache should be implemented by admission plugins that need a
// group cache.
type WantsGroupCache interface {
SetGroupCache(*usercache.GroupCache)
admission.Validator
}