diff --git a/contributors/devel/sig-architecture/api-conventions.md b/contributors/devel/sig-architecture/api-conventions.md index a14db08ce..32f5f26bc 100644 --- a/contributors/devel/sig-architecture/api-conventions.md +++ b/contributors/devel/sig-architecture/api-conventions.md @@ -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.