diff --git a/content/master/concepts/usages.md b/content/master/concepts/usages.md index 6518d3c51..826d73937 100644 --- a/content/master/concepts/usages.md +++ b/content/master/concepts/usages.md @@ -14,8 +14,8 @@ as follows: 2. Deletion ordering by ensuring that a resource isn't deleted before the deletion of its dependent resources. -See the [Usage for Deletion Protection](#usage-for-deletion-protection) for the -first use case and the [Usage for Deletion Ordering](#usage-for-deletion-ordering) +See the section [Usage for Deletion Protection](#usage-for-deletion-protection) for the +first use case and the section [Usage for Deletion Ordering](#usage-for-deletion-ordering) for the second one. ## Enable usages @@ -65,6 +65,17 @@ defines the using resource. Both fields are optional, but at least one of them must be provided. +{{}} + +Usage relationships can be defined between `Managed Resources` and `Composites`. + +However, a `Composite` as the using resource (`spec.by`) would be ineffective unless + +`compositeDeletePolicy` `Foreground` is used because it wouldn't block deletion of its +child resources before its own deletion with the default deletion policy `Background`. + +{{< /hint >}} + ### Usage for deletion protection The following example prevents the deletion of the @@ -140,7 +151,7 @@ spec: baz: qux ``` -Once the `Usage` controller resolves the selectors, it persists the resource +After the `Usage` controller resolves the selectors, it persists the resource name in the {{}}resourceRef.name{{}} field. The following example shows the `Usage` resource after the resolution of @@ -220,3 +231,17 @@ spec: resourceSelector: matchControllerRef: true ``` + +{{}} + + +When there are multiple resources of same type in a Composition, the +{{}}Usage{{}} resource must +uniquely identify the resource in use or the using one. This could be +accomplished by using extra labels and combining +{{}}matchControllerRef{{}} +with a `matchLabels` selector or directly patching the `resourceRef.name` +with the help of `ToEnvironmentFieldPath` and `FromEnvironmentFieldPath` +patches. + +{{< /hint >}} \ No newline at end of file