Merge pull request #7477 from jpbetz/kubebuilder-tags
Update example for conditions to use SSA go tags
This commit is contained in:
commit
1f17841be9
|
@ -425,6 +425,11 @@ Conditions are most useful when they follow some consistent conventions:
|
|||
Conditions should follow the standard schema included in [k8s.io/apimachinery/pkg/apis/meta/v1/types.go](https://github.com/kubernetes/apimachinery/blob/release-1.23/pkg/apis/meta/v1/types.go#L1432-L1492).
|
||||
It should be included as a top level element in status, similar to
|
||||
```go
|
||||
// +listType=map
|
||||
// +listMapKey=type
|
||||
// +patchStrategy=merge
|
||||
// +patchMergeKey=type
|
||||
// +optional
|
||||
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
|
||||
```
|
||||
|
||||
|
@ -979,7 +984,7 @@ All forms of defaulting should only make the following types of modifications:
|
|||
- Setting previously unset fields
|
||||
- Adding keys to maps
|
||||
- Adding values to arrays which have mergeable semantics
|
||||
(`patchStrategy:"merge"` attribute in the type definition)
|
||||
(`+listType=map` tag or `patchStrategy:"merge"` attribute in the type definition)
|
||||
|
||||
In particular we never want to change or override a value that was provided by
|
||||
the user. If they requested something invalid, they should get an error.
|
||||
|
|
Loading…
Reference in New Issue