forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deployconfig.go
63 lines (48 loc) · 1.65 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
package test
import (
"sync"
kapi "github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/fields"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"github.com/GoogleCloudPlatform/kubernetes/pkg/watch"
"github.com/openshift/origin/pkg/deploy/api"
)
type DeploymentConfigRegistry struct {
Err error
DeploymentConfig *api.DeploymentConfig
DeploymentConfigs *api.DeploymentConfigList
sync.Mutex
}
func NewDeploymentConfigRegistry() *DeploymentConfigRegistry {
return &DeploymentConfigRegistry{}
}
func (r *DeploymentConfigRegistry) ListDeploymentConfigs(ctx kapi.Context, label labels.Selector, field fields.Selector) (*api.DeploymentConfigList, error) {
r.Lock()
defer r.Unlock()
return r.DeploymentConfigs, r.Err
}
func (r *DeploymentConfigRegistry) GetDeploymentConfig(ctx kapi.Context, id string) (*api.DeploymentConfig, error) {
r.Lock()
defer r.Unlock()
return r.DeploymentConfig, r.Err
}
func (r *DeploymentConfigRegistry) CreateDeploymentConfig(ctx kapi.Context, image *api.DeploymentConfig) error {
r.Lock()
defer r.Unlock()
r.DeploymentConfig = image
return r.Err
}
func (r *DeploymentConfigRegistry) UpdateDeploymentConfig(ctx kapi.Context, image *api.DeploymentConfig) error {
r.Lock()
defer r.Unlock()
r.DeploymentConfig = image
return r.Err
}
func (r *DeploymentConfigRegistry) DeleteDeploymentConfig(ctx kapi.Context, id string) error {
r.Lock()
defer r.Unlock()
return r.Err
}
func (r *DeploymentConfigRegistry) WatchDeploymentConfigs(ctx kapi.Context, label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) {
return nil, r.Err
}