-
Notifications
You must be signed in to change notification settings - Fork 0
/
namespace.go
44 lines (36 loc) · 1.03 KB
/
namespace.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
package client
type (
NamespaceInterface interface {
CreateNamespace(item *Namespace) (*Namespace, error)
GetNamespace(name string) (result *Namespace, err error)
ListNamespaces(opts *ListOptions) (*NamespaceList, error)
DeleteNamespace(name string) error
UpdateNamespace(item *Namespace) (*Namespace, error)
}
NamespaceSpec struct {
Finalizers []FinalizerName
}
NamespacePhase string
NamespaceStatus struct {
Phase NamespacePhase `json:"phase,omitempty"`
}
Namespace struct {
TypeMeta `json:",inline"`
ObjectMeta `json:"metadata,omitempty"`
Spec *NamespaceSpec `json:"spec,omitempty"`
Status *NamespaceStatus `json:"status,omitempty"`
}
NamespaceList struct {
TypeMeta `json:",inline"`
ListMeta `json:"metadata,omitempty"`
Items []Namespace `json:"items"`
}
)
// NewNamespace creates a new namespace struct
func NewNamespace(name string) *Namespace {
return &Namespace{
TypeMeta: NewTypeMeta("Namespace", "v1"),
ObjectMeta: NewObjectMeta(name, name),
Spec: &NamespaceSpec{},
}
}