Skip to content

Commit 4d3bfd9

Browse files
authored
Merge pull request #1242 from iredelmeier/fix-guestbook-types
Fix guestbook types in Quick Start
2 parents 0e3f194 + 9989706 commit 4d3bfd9

File tree

1 file changed

+23
-27
lines changed

1 file changed

+23
-27
lines changed

docs/book/src/quick-start.md

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -91,49 +91,45 @@ a Controller](cronjob-tutorial/controller-overview.md).
9191
<details><summary>Click here to see an example. `(api/v1/guestbook_types.go)` </summary>
9292
<p>
9393

94-
```go
94+
```go
9595
// GuestbookSpec defines the desired state of Guestbook
9696
type GuestbookSpec struct {
9797
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
9898
// Important: Run "make" to regenerate code after modifying this file
9999

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"`
115112
}
116113

117114
// GuestbookStatus defines the observed state of Guestbook
118115
type GuestbookStatus struct {
119116
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
120117
// 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 {
130118

131-
// PodName of the active Guestbook node.
119+
// PodName of the active Guestbook node.
132120
Active string `json:"active"`
133121

134122
// PodNames of the standby Guestbook nodes.
135123
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+
}
137133
```
138134

139135
</p>

0 commit comments

Comments
 (0)