Skip to content

Commit 2440a11

Browse files
committed
(docs) drop patchStrategy/protobuf tags from Conditions in Getting Started section
Followup of PR #4893 These tags are of no use for CRDs. They have their use in k8s core types in order to produce proper strategic merge patches, see https://github.com/kubernetes/community/blob/master/contributors/devel/sig-api-machinery/strategic-merge-patch.md but are superseded by +listType and +listMapKey in CRD world. Added `+listType`, `+listMapKey` and `+optional` markers to the example snippet
1 parent 3fd0419 commit 2440a11

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/book/src/getting-started.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@ similar to how we do with any resource from the Kubernetes API.
9999
```go
100100
// MemcachedStatus defines the observed state of Memcached
101101
type MemcachedStatus struct {
102-
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
102+
// +listType=map
103+
// +listMapKey=type
104+
// +optional
105+
Conditions []metav1.Condition `json:"conditions,omitempty"`
103106
}
104107
```
105108

0 commit comments

Comments
 (0)