Code refactoring for bpa operator
[icn.git] / cmd / bpa-operator / pkg / apis / bpa / v1alpha1 / provisioning_types.go
1 package v1alpha1
2
3 import (
4         metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
5 )
6
7 // EDIT THIS FILE!  THIS IS SCAFFOLDING FOR YOU TO OWN!
8 // NOTE: json tags are required.  Any new fields you add must have json tags for the fields to be serialized.
9
10 // ProvisioningSpec defines the desired state of Provisioning
11 // +k8s:openapi-gen=true
12 type ProvisioningSpec struct {
13         // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
14         // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
15         // Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
16         Masters []map[string]Master  `json:"masters,omitempty"`
17         Workers []map[string]Worker  `json:"workers,omitempty"`
18         KUDInstaller string `json:"kudInstallerPath,omitempty"`
19         DHCPleaseFile string `json:"dhcpLeaseFile,omitempty"`
20         MultiClusterPath string `json:"multiClusterDir,omitempty"`
21 }
22
23 // ProvisioningStatus defines the observed state of Provisioning
24 // +k8s:openapi-gen=true
25 type ProvisioningStatus struct {
26         // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
27         // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
28         // Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
29 }
30
31 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
32
33 // Provisioning is the Schema for the provisionings API
34 // +k8s:openapi-gen=true
35 // +kubebuilder:subresource:status
36 type Provisioning struct {
37         metav1.TypeMeta   `json:",inline"`
38         metav1.ObjectMeta `json:"metadata,omitempty"`
39
40         Spec   ProvisioningSpec   `json:"spec,omitempty"`
41         Status ProvisioningStatus `json:"status,omitempty"`
42 }
43
44 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
45
46 // ProvisioningList contains a list of Provisioning
47 type ProvisioningList struct {
48         metav1.TypeMeta `json:",inline"`
49         metav1.ListMeta `json:"metadata,omitempty"`
50         Items           []Provisioning `json:"items"`
51 }
52
53 // master struct contains resource requirements for a master node
54 type Master struct {
55         MACaddress string `json:"mac-address,omitempty"`
56         CPU int32  `json:"cpu,omitempty"`
57         Memory string  `json:"memory,omitempty"`
58 }
59
60 // worker struct contains resource requirements for a worker node
61 type Worker struct {
62         MACaddress string `json:"mac-address,omitempty"`
63         CPU int32 `json:"cpu,omitempty"`
64         Memory string  `json:"memory,omitempty"`
65         SRIOV bool  `json:"sriov,omitempty"`
66         QAT  bool      `json:"qat,omitempty"`
67 }
68
69 func init() {
70         SchemeBuilder.Register(&Provisioning{}, &ProvisioningList{})
71 }