@@ -1004,6 +1004,7 @@ Compositions support matching resource fields by:
1004
1004
* [non-empty match](#match-that-a-field-exists)
1005
1005
* [always ready](#always-consider-a-resource-ready)
1006
1006
* [condition match](#match-a-condition)
1007
+ * [boolean match](#match-a-boolean)
1007
1008
1008
1009
# ### Match a string
1009
1010
@@ -1159,6 +1160,72 @@ spec:
1159
1160
status: Success
1160
1161
` ` `
1161
1162
1163
+ # ### Match a Boolean
1164
+
1165
+ Two types of checks exist for matching boolean fields :
1166
+ * `MatchTrue`
1167
+ * `MatchFalse`
1168
+
1169
+ ` MatchTrue` considers the composed resource to be ready when the value of a
1170
+ field within that resource is `true`.
1171
+
1172
+ ` MatchFalse` considers the composed resource to be ready when the value of a
1173
+ field within that resource is `false`.
1174
+
1175
+ For example, consider
1176
+ {{<hover label="matchTrue" line="7">}}my-resource{{</hover>}}, which will be marked
1177
+ as ready if
1178
+ {{<hover label="matchTrue" line="12">}} status.atProvider.manifest.status.ready{{</hover>}}
1179
+ is {{<hover label="matchTrue" line="11">}}true{{</hover>}}.
1180
+
1181
+ ` ` ` yaml {label="matchTrue",copy-lines="none"}
1182
+ apiVersion: apiextensions.crossplane.io/v1
1183
+ kind: Composition
1184
+ # Removed for Brevity
1185
+ spec:
1186
+ resources:
1187
+ # Removed for Brevity
1188
+ - name: my-resource
1189
+ base:
1190
+ # Removed for brevity
1191
+ readinessChecks:
1192
+ - type: MatchTrue
1193
+ fieldPath: status.atProvider.manifest.status.ready
1194
+ ` ` `
1195
+ {{<hint "tip" >}}
1196
+ Checking {{<hover label="matchTrue" line="11">}}MatchTrue{{</hover>}} doesn't
1197
+ require a `match` field.
1198
+ {{< /hint >}}
1199
+
1200
+ Alternatively, `MatchFalse` can be used for fields that express readiness with
1201
+ negative polarity.
1202
+
1203
+ For example, consider
1204
+ {{<hover label="matchFalse" line="7">}}my-resource{{</hover>}}, which will be marked
1205
+ as ready if
1206
+ {{<hover label="matchFalse" line="12">}} status.atProvider.manifest.status.pending{{</hover>}}
1207
+ is {{<hover label="matchFalse" line="11">}}false{{</hover>}}.
1208
+
1209
+ ` ` ` yaml {label="matchFalse",copy-lines="none"}
1210
+ apiVersion: apiextensions.crossplane.io/v1
1211
+ kind: Composition
1212
+ # Removed for Brevity
1213
+ spec:
1214
+ resources:
1215
+ # Removed for Brevity
1216
+ - name: my-resource
1217
+ base:
1218
+ # Removed for brevity
1219
+ readinessChecks:
1220
+ - type: MatchFalse
1221
+ fieldPath: status.atProvider.manifest.status.pending
1222
+ ` ` `
1223
+
1224
+ {{<hint "tip" >}}
1225
+ Checking {{<hover label="matchFalse" line="11">}}MatchFalse{{</hover>}} doesn't
1226
+ require a `match` field.
1227
+ {{< /hint >}}
1228
+
1162
1229
# # Verify a Composition
1163
1230
1164
1231
View all available Compositions with `kubectl get composition`.
0 commit comments