Skip to content

Commit

Permalink
fix golang tutorial spec to match controller code (#6252)
Browse files Browse the repository at this point in the history
  • Loading branch information
jberkhahn authored Jan 19, 2023
1 parent 398ae9d commit b38c7f8
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion website/content/en/docs/building-operators/golang/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,20 @@ Define the API for the Memcached Custom Resource(CR) by modifying the Go type de
type MemcachedSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
// Size defines the number of Memcached instances

// The following markers will use OpenAPI v3 schema to validate the value
// More info: https://book.kubebuilder.io/reference/markers/crd-validation.html
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:Maximum=3
// +kubebuilder:validation:ExclusiveMaximum=false

// Size defines the number of Memcached instances
// +operator-sdk:csv:customresourcedefinitions:type=spec
Size int32 `json:"size,omitempty"`

// Port defines the port that will be used to init the container with the image
// +operator-sdk:csv:customresourcedefinitions:type=spec
ContainerPort int32 `json:"containerPort,omitempty"`
}

// MemcachedStatus defines the observed state of Memcached
Expand All @@ -128,6 +136,10 @@ type MemcachedStatus struct {
// condition types may define expected values and meanings for this field, and whether the values
// are considered a guaranteed API.
// Memcached.status.conditions.Message is a human readable message indicating details about the transition.
// For further information see: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties

// Conditions store the status conditions of the Memcached instances
// +operator-sdk:csv:customresourcedefinitions:type=status
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
}
```
Expand Down

0 comments on commit b38c7f8

Please sign in to comment.