forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
strategy.go
38 lines (29 loc) · 894 Bytes
/
strategy.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
package imagestreamimport
import (
kapi "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util/validation/field"
"github.com/openshift/origin/pkg/image/api"
"github.com/openshift/origin/pkg/image/api/validation"
)
// strategy implements behavior for ImageStreamImports.
type strategy struct {
runtime.ObjectTyper
}
var Strategy = &strategy{kapi.Scheme}
func (s *strategy) NamespaceScoped() bool {
return true
}
func (s *strategy) GenerateName(string) string {
return ""
}
func (s *strategy) Canonicalize(runtime.Object) {
}
func (s *strategy) PrepareForCreate(obj runtime.Object) {
newIST := obj.(*api.ImageStreamImport)
newIST.Status = api.ImageStreamImportStatus{}
}
func (s *strategy) Validate(ctx kapi.Context, obj runtime.Object) field.ErrorList {
isi := obj.(*api.ImageStreamImport)
return validation.ValidateImageStreamImport(isi)
}