forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
deployconfig.go
64 lines (49 loc) · 1.7 KB
/
deployconfig.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
package test
import (
"sync"
deployapi "github.com/openshift/origin/pkg/deploy/apis/apps"
metainternal "k8s.io/apimachinery/pkg/apis/meta/internalversion"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/watch"
apirequest "k8s.io/apiserver/pkg/endpoints/request"
)
type DeploymentConfigRegistry struct {
Err error
DeploymentConfig *deployapi.DeploymentConfig
DeploymentConfigs *deployapi.DeploymentConfigList
sync.Mutex
}
func NewDeploymentConfigRegistry() *DeploymentConfigRegistry {
return &DeploymentConfigRegistry{}
}
func (r *DeploymentConfigRegistry) ListDeploymentConfigs(ctx apirequest.Context, label labels.Selector, field fields.Selector) (*deployapi.DeploymentConfigList, error) {
r.Lock()
defer r.Unlock()
return r.DeploymentConfigs, r.Err
}
func (r *DeploymentConfigRegistry) GetDeploymentConfig(ctx apirequest.Context, id string) (*deployapi.DeploymentConfig, error) {
r.Lock()
defer r.Unlock()
return r.DeploymentConfig, r.Err
}
func (r *DeploymentConfigRegistry) CreateDeploymentConfig(ctx apirequest.Context, image *deployapi.DeploymentConfig) error {
r.Lock()
defer r.Unlock()
r.DeploymentConfig = image
return r.Err
}
func (r *DeploymentConfigRegistry) UpdateDeploymentConfig(ctx apirequest.Context, image *deployapi.DeploymentConfig) error {
r.Lock()
defer r.Unlock()
r.DeploymentConfig = image
return r.Err
}
func (r *DeploymentConfigRegistry) DeleteDeploymentConfig(ctx apirequest.Context, id string) error {
r.Lock()
defer r.Unlock()
return r.Err
}
func (r *DeploymentConfigRegistry) WatchDeploymentConfigs(ctx apirequest.Context, options *metainternal.ListOptions) (watch.Interface, error) {
return nil, r.Err
}