@@ -91,49 +91,45 @@ a Controller](cronjob-tutorial/controller-overview.md).
91
91
<details ><summary >Click here to see an example. `(api/v1/guestbook_types.go)` </summary >
92
92
<p >
93
93
94
- ``` go
94
+ ``` go
95
95
// GuestbookSpec defines the desired state of Guestbook
96
96
type GuestbookSpec struct {
97
97
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
98
98
// Important: Run "make" to regenerate code after modifying this file
99
99
100
- // Quantity of instances
101
- // +kubebuilder:validation:Minimum=1
102
- // +kubebuilder:validation:Maximum=10
103
- Size int32 ` json:"size"`
104
-
105
- // Name of the ConfigMap for GuestbookSpec's configuration
106
- // +kubebuilder:validation:MaxLength=15
107
- // +kubebuilder:validation:MinLength=1
108
- ConfigMapName string ` json:"configMapName"`
109
-
110
- // +kubebuilder:validation:Enum=Phone,Address,Name
111
- Type string ` json:"alias,omitempty"`
112
-
113
- // TLS policy of Guestbook nodes
114
- TLS *TLSPolicy ` json:"TLS,omitempty"`
100
+ // Quantity of instances
101
+ // +kubebuilder:validation:Minimum=1
102
+ // +kubebuilder:validation:Maximum=10
103
+ Size int32 ` json:"size"`
104
+
105
+ // Name of the ConfigMap for GuestbookSpec's configuration
106
+ // +kubebuilder:validation:MaxLength=15
107
+ // +kubebuilder:validation:MinLength=1
108
+ ConfigMapName string ` json:"configMapName"`
109
+
110
+ // +kubebuilder:validation:Enum=Phone,Address,Name
111
+ Type string ` json:"alias,omitempty"`
115
112
}
116
113
117
114
// GuestbookStatus defines the observed state of Guestbook
118
115
type GuestbookStatus struct {
119
116
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
120
117
// Important: Run "make" to regenerate code after modifying this file
121
-
122
- // GuestbookStatus is the set of Guestbook node specific statuses: Active or Standby
123
- GuestbookStatus GuestbookStatus ` json:"guestbookStatus"`
124
-
125
- // Status of Guestbook Nodes
126
- Nodes []string ` json:"nodes"`
127
- }
128
-
129
- type GuestbookStatus struct {
130
118
131
- // PodName of the active Guestbook node.
119
+ // PodName of the active Guestbook node.
132
120
Active string ` json:"active"`
133
121
134
122
// PodNames of the standby Guestbook nodes.
135
123
Standby []string ` json:"standby"`
136
- }
124
+ }
125
+
126
+ type Guestbook struct {
127
+ metav1.TypeMeta ` json:",inline"`
128
+ metav1.ObjectMeta ` json:"metadata,omitempty"`
129
+
130
+ Spec GuestbookSpec ` json:"spec,omitempty"`
131
+ Status GuestbookStatus ` json:"status,omitempty"`
132
+ }
137
133
```
138
134
139
135
</p >
0 commit comments