/
workshop_types.go
96 lines (82 loc) · 3.22 KB
/
workshop_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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
//WorkshopProject defines the student projects of Workshop
type WorkshopProject struct {
Create bool `json:"create"`
Prefixes []string `json:"prefixes"`
}
//WorkshopUser defines the students for Workshop
type WorkshopUser struct {
Create bool `json:"create"`
Prefix string `json:"prefix"`
Password string `json:"password"`
AdminPassword string `json:"adminPassword"`
//+kubebuilder:validation:Minimum=0
//+kubebuilder:validation:Maximum=1
Start int32 `json:"start"`
//+kubebuilder:validation:Minimum=1
//+kubebuilder:validation:Maximum=100
End int32 `json:"end"`
}
//WorkshopStack defines the software stack for the Workshop
type WorkshopStack struct {
Install bool `json:"install"`
Che EclipseChe `json:"che"`
Community []PackageInfo `json:"community"`
RedHat []PackageInfo `json:"redhat"`
}
//PackageInfo defines the software package that will be installed using the operators
type PackageInfo struct {
Name string `json:"name"`
Version string `json:"version"`
Operator string `json:"operator"`
}
//EclipseChe configures few parameters for CR Eclipse Che Cluster
type EclipseChe struct {
EnableTokenExchange bool `json:"enableTokenExchange"`
OperatorImage string `json:"operatorImage"`
CheVersion string `json:"version"`
TLSSupport bool `json:"tlsSupport,omitempty"`
SelfSignedCert bool `json:"selfSignedCert,omitempty"`
}
// WorkshopSpec defines the desired state of Workshop
// +k8s:openapi-gen=true
type WorkshopSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
// Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
Clean bool `json:"clean"`
OpenshiftAPIServer string `json:"openshiftAPIServer,omitempty"`
Project WorkshopProject `json:"project"`
User WorkshopUser `json:"user"`
Stack WorkshopStack `json:"stack"`
}
// WorkshopStatus defines the observed state of Workshop
// +k8s:openapi-gen=true
type WorkshopStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
// Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// Workshop is the Schema for the workshops API
// +k8s:openapi-gen=true
// +kubebuilder:subresource:status
type Workshop struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec WorkshopSpec `json:"spec,omitempty"`
Status WorkshopStatus `json:"status,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// WorkshopList contains a list of Workshop
type WorkshopList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Workshop `json:"items"`
}
func init() {
SchemeBuilder.Register(&Workshop{}, &WorkshopList{})
}