/
aclaccount_types.go
65 lines (52 loc) · 1.85 KB
/
aclaccount_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
package v1
import (
ct "github.com/kloudlite/operator/apis/common-types"
"github.com/kloudlite/operator/pkg/constants"
rApi "github.com/kloudlite/operator/pkg/operator"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// ACLAccountSpec defines the desired state of ACLAccount
type ACLAccountSpec struct {
KeyPrefix string `json:"keyPrefix,omitempty"`
MsvcRef ct.MsvcRef `json:"msvcRef"`
ResourceName string `json:"resourceName,omitempty"`
}
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:JSONPath=".status.isReady",name=Ready,type=boolean
// +kubebuilder:printcolumn:JSONPath=".metadata.creationTimestamp",name=Age,type=date
// ACLAccount is the Schema for the aclaccounts API
type ACLAccount struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ACLAccountSpec `json:"spec"`
Status rApi.Status `json:"status,omitempty"`
}
func (a *ACLAccount) EnsureGVK() {
if a != nil {
a.SetGroupVersionKind(GroupVersion.WithKind("ACLAccount"))
}
}
func (a *ACLAccount) GetStatus() *rApi.Status {
return &a.Status
}
func (a *ACLAccount) GetEnsuredLabels() map[string]string {
return map[string]string{}
}
func (a *ACLAccount) GetEnsuredAnnotations() map[string]string {
return map[string]string{
constants.AnnotationKeys.GroupVersionKind: GroupVersion.WithKind("ACLAccount").String(),
}
}
// +kubebuilder:object:root=true
// ACLAccountList contains a list of ACLAccount
type ACLAccountList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ACLAccount `json:"items"`
}
func init() {
SchemeBuilder.Register(&ACLAccount{}, &ACLAccountList{})
}