From d4d7edde74b33b3b042edf4bb423c754594aea2b Mon Sep 17 00:00:00 2001 From: Pete Lumbis Date: Fri, 15 Sep 2023 13:46:32 -0400 Subject: [PATCH] Updates based on PR feedback Signed-off-by: Pete Lumbis --- content/master/concepts/compositions.md | 29 ++++++----- .../master/concepts/environment-configs.md | 48 +++++++++---------- .../master/concepts/patch-and-transform.md | 3 -- content/v1.13/concepts/compositions.md | 29 ++++++----- content/v1.13/concepts/environment-configs.md | 34 +++++++------ 5 files changed, 67 insertions(+), 76 deletions(-) diff --git a/content/master/concepts/compositions.md b/content/master/concepts/compositions.md index 2d346dde6..5ff961471 100644 --- a/content/master/concepts/compositions.md +++ b/content/master/concepts/compositions.md @@ -550,8 +550,8 @@ spec: #### Patch with EnvironmentConfigs -Crossplane uses EnvironmentConfigs as an in-memory data store. Compositions can -read and write from this data store as part of the patch process. +Crossplane uses EnvironmentConfigs to create in-memory data stores. Compositions +can read and write from this data store as part of the patch process. {{}} EnvironmentConfigs are an alpha feature. Alpha features aren't enabled by @@ -559,7 +559,7 @@ default. {{< /hint >}} EnvironmentConfigs can predefine data that Compositions can use - or a Composite Resource can write data to the EnvironmentConfig for other + or a Composite Resource can write data to their in-memory environment for other resources to read. @@ -569,10 +569,9 @@ Read the [EnvironmentConfigs]({{}}) page for more information on using EnvironmentConfigs. {{< /hint >}} -To apply a patch using EnvironmentConfigs, first define which EnvironmentConfig +To apply a patch using EnvironmentConfigs, first define which EnvironmentConfigs to use with -{{}}environment.environmentConfigs{{}}. +{{}}environment.environmentConfigs{{}}. @@ -580,7 +579,7 @@ line="6">}}environment.environmentConfigs{{}}. Use either a [reference]({{}}) or a [selector]({{}}) to -identify the EnvironmentConfig to use. +identify the EnvironmentConfigs to use. ```yaml {label="envselect",copy-lines="none"} @@ -599,16 +598,16 @@ spec: ##### Patch a composite resource -To patch the composite resource use the -{{< hover label="xrpatch" line="7">}}patches{{}} object inside of the +To patch the composite resource use +{{< hover label="xrpatch" line="7">}}patches{{}} inside of the {{< hover label="xrpatch" line="5">}}environment{{}}. Use the {{< hover label="xrpatch" line="5">}}ToCompositeFieldPath{{}} to copy -data from the EnvironmentConfig to the composite resource. +data from the in-memory environment to the composite resource. Use the {{< hover label="xrpatch" line="5">}}FromCompositeFieldPath{{}} to copy -data from the composite resource to the EnvironmentConfig. +data from the composite resource to the in-memory environment. ```yaml {label="xrpatch",copy-lines="none"} apiVersion: apiextensions.crossplane.io/v1 @@ -626,16 +625,16 @@ spec: toFieldPath: newEnvironmentKey ``` -Individual resources can use any data written to the EnvironmentConfig. +Individual resources can use any data written to their in-memory environment. ##### Patch an individual resource To patch an individual resource, inside the -{{}}patches{{}} object of the +{{}}patches{{}} of the resource, use {{}}ToEnvironmentFieldPath{{}} to copy -data from the resource to the EnvironmentConfig. +data from the resource to the in-memory environment. Use {{}}FromEnvironmentFieldPath{{}} -to copy data to the resource from the EnvironmentConfig. +to copy data to the resource from the in-memory environment. ```yaml {label="envpatch",copy-lines="none"} apiVersion: apiextensions.crossplane.io/v1 diff --git a/content/master/concepts/environment-configs.md b/content/master/concepts/environment-configs.md index cb845dae5..8b17a4571 100644 --- a/content/master/concepts/environment-configs.md +++ b/content/master/concepts/environment-configs.md @@ -6,24 +6,25 @@ alphaVersion: "1.11" description: "Environment Configurations or EnvironmentConfigs are an in-memory datastore used in patching Compositions" --- -A Crossplane EnvironmentConfig is an in-memory data store. Composition -patches can read from and write to an environment. +A Crossplane EnvironmentConfig is a cluster scoped +[ConfigMap](https://kubernetes.io/docs/concepts/configuration/configmap/) used +by Compositions. Compositions can use the environment to store information from +individual resources or to apply [patches]({{}}). Crossplane supports multiple EnvironmentConfigs, each acting as a unique data store. -A Composition defines access to one or more EnvironmentConfigs. - -When Crossplane creates a composite resource, Crossplane creates a unique copy -of the defined EnvironmentConfigs for that composite resource. +When Crossplane creates a composite resource, Crossplane merges all the +EnvironmentConfigs referenced in the associated Composition and creates a unique +in-memory environment for that composite resource. The composite resource can read and write data to their unique -EnvironmentConfig. +in-memory environment. {{}} -EnvironmentConfigs are unique to each composite resource. -A composite resource can't read data in an EnvironmentConfig written by another -composite resource. +The in-memory environment is unique to each composite resource. +A composite resource can't read data in another composite resource's +environment. {{< /hint >}} ## Enable EnvironmentConfigs @@ -93,7 +94,7 @@ data: ## Select an EnvironmentConfig -Select the EnvironmentConfig to use +Select the EnvironmentConfigs to use inside a Composition's {{}}environment{{}} field. @@ -316,8 +317,8 @@ TODO: Add Policies ## Patching with EnvironmentConfigs -When Crossplane creates a composite resource, Crossplane creates a unique copy -of the EnvironmentConfig for the composite resource. +When Crossplane creates or updates a composite resource, Crossplane +merges all the specified EnvironmentConfigs into an in-memory environment. The composite resource can read or write data between the EnvironmentConfig and composite resource or between the EnvironmentConfig and individual resources @@ -330,19 +331,17 @@ Read about EnvironmentConfig patch types in the -### Patching a composite resource - -To patch a composite resource use the -{{< hover label="xrpatch" line="7">}}patches{{}} object inside of a -Composition's +##### Patch a composite resource +To patch the composite resource use +{{< hover label="xrpatch" line="7">}}patches{{}} inside of the {{< hover label="xrpatch" line="5">}}environment{{}}. Use the {{< hover label="xrpatch" line="5">}}ToCompositeFieldPath{{}} to copy -data from the EnvironmentConfig to the composite resource. +data from the in-memory environment to the composite resource. Use the {{< hover label="xrpatch" line="5">}}FromCompositeFieldPath{{}} to copy -data from the composite resource to the EnvironmentConfig. +data from the composite resource to the in-memory environment. ```yaml {label="xrpatch",copy-lines="none"} apiVersion: apiextensions.crossplane.io/v1 @@ -360,17 +359,16 @@ spec: toFieldPath: newEnvironmentKey ``` -Individual resources can use any data written to the EnvironmentConfig. +Individual resources can use any data written to the in-memory environment. ##### Patch an individual resource - To patch an individual resource, inside the -{{}}patches{{}} object of the +{{}}patches{{}} of the resource, use {{}}ToEnvironmentFieldPath{{}} to copy -data from the resource to the EnvironmentConfig. +data from the resource to the in-memory environment. Use {{}}FromEnvironmentFieldPath{{}} -to copy data to the resource from the EnvironmentConfig. +to copy data to the resource from the in-memory environment. ```yaml {label="envpatch",copy-lines="none"} apiVersion: apiextensions.crossplane.io/v1 diff --git a/content/master/concepts/patch-and-transform.md b/content/master/concepts/patch-and-transform.md index d6fcf5612..969d7c0e3 100644 --- a/content/master/concepts/patch-and-transform.md +++ b/content/master/concepts/patch-and-transform.md @@ -1567,9 +1567,6 @@ converts the input based on one of the following conversion types: * `ToSha1` - Create a SHA-1 hash of the input string. * `ToSha256` - Create a SHA-256 hash of the input string. * `ToSha512` - Create a SHA-512 hash of the input string. -* `ToSha512` - Create a SHA-512 hash of the input string. -* `ToAdler32` - Create an Adler32 hash of the input string. -* `ToSha512` - Create a SHA-512 hash of the input string. * `ToAdler32` - Create an Adler32 hash of the input string. ```yaml {label="stringConvert"} diff --git a/content/v1.13/concepts/compositions.md b/content/v1.13/concepts/compositions.md index 7a48285fd..e9a33b774 100644 --- a/content/v1.13/concepts/compositions.md +++ b/content/v1.13/concepts/compositions.md @@ -550,8 +550,8 @@ spec: #### Patch with EnvironmentConfigs -Crossplane uses EnvironmentConfigs as an in-memory data store. Compositions can -read and write from this data store as part of the patch process. +Crossplane uses EnvironmentConfigs to create in-memory data stores. Compositions +can read and write from this data store as part of the patch process. {{}} EnvironmentConfigs are an alpha feature. Alpha features aren't enabled by @@ -559,7 +559,7 @@ default. {{< /hint >}} EnvironmentConfigs can predefine data that Compositions can use - or a Composite Resource can write data to the EnvironmentConfig for other + or a Composite Resource can write data to their in-memory environment for other resources to read. @@ -569,10 +569,9 @@ Read the [EnvironmentConfigs]({{}}) page for more information on using EnvironmentConfigs. {{< /hint >}} -To apply a patch using EnvironmentConfigs, first define which EnvironmentConfig +To apply a patch using EnvironmentConfigs, first define which EnvironmentConfigs to use with -{{}}environment.environmentConfigs{{}}. +{{}}environment.environmentConfigs{{}}. @@ -580,7 +579,7 @@ line="6">}}environment.environmentConfigs{{}}. Use either a [reference]({{}}) or a [selector]({{}}) to -identify the EnvironmentConfig to use. +identify the EnvironmentConfigs to use. ```yaml {label="envselect",copy-lines="none"} @@ -599,16 +598,16 @@ spec: ##### Patch a composite resource -To patch the composite resource use the -{{< hover label="xrpatch" line="7">}}patches{{}} object inside of the +To patch the composite resource use +{{< hover label="xrpatch" line="7">}}patches{{}} inside of the {{< hover label="xrpatch" line="5">}}environment{{}}. Use the {{< hover label="xrpatch" line="5">}}ToCompositeFieldPath{{}} to copy -data from the EnvironmentConfig to the composite resource. +data from the in-memory environment to the composite resource. Use the {{< hover label="xrpatch" line="5">}}FromCompositeFieldPath{{}} to copy -data from the composite resource to the EnvironmentConfig. +data from the composite resource to the in-memory environment. ```yaml {label="xrpatch",copy-lines="none"} apiVersion: apiextensions.crossplane.io/v1 @@ -626,16 +625,16 @@ spec: toFieldPath: newEnvironmentKey ``` -Individual resources can use any data written to the EnvironmentConfig. +Individual resources can use any data written to their in-memory environment. ##### Patch an individual resource To patch an individual resource, inside the -{{}}patches{{}} object of the +{{}}patches{{}} of the resource, use {{}}ToEnvironmentFieldPath{{}} to copy -data from the resource to the EnvironmentConfig. +data from the resource to the in-memory environment. Use {{}}FromEnvironmentFieldPath{{}} -to copy data to the resource from the EnvironmentConfig. +to copy data to the resource from the in-memory environment. ```yaml {label="envpatch",copy-lines="none"} apiVersion: apiextensions.crossplane.io/v1 diff --git a/content/v1.13/concepts/environment-configs.md b/content/v1.13/concepts/environment-configs.md index cb845dae5..ef7d5032d 100644 --- a/content/v1.13/concepts/environment-configs.md +++ b/content/v1.13/concepts/environment-configs.md @@ -14,16 +14,17 @@ data store. A Composition defines access to one or more EnvironmentConfigs. -When Crossplane creates a composite resource, Crossplane creates a unique copy -of the defined EnvironmentConfigs for that composite resource. +When Crossplane creates a composite resource, Crossplane merges all referenced +EnvironmentConfigs and creates a unique in-memory environment +for that composite resource. The composite resource can read and write data to their unique -EnvironmentConfig. +in-memory environment. {{}} -EnvironmentConfigs are unique to each composite resource. -A composite resource can't read data in an EnvironmentConfig written by another -composite resource. +The in-memory environment is unique to each composite resource. +A composite resource can't read data in another composite resource's +environment. {{< /hint >}} ## Enable EnvironmentConfigs @@ -330,19 +331,17 @@ Read about EnvironmentConfig patch types in the -### Patching a composite resource - -To patch a composite resource use the -{{< hover label="xrpatch" line="7">}}patches{{}} object inside of a -Composition's +##### Patch a composite resource +To patch the composite resource use +{{< hover label="xrpatch" line="7">}}patches{{}} inside of the {{< hover label="xrpatch" line="5">}}environment{{}}. Use the {{< hover label="xrpatch" line="5">}}ToCompositeFieldPath{{}} to copy -data from the EnvironmentConfig to the composite resource. +data from the in-memory environment to the composite resource. Use the {{< hover label="xrpatch" line="5">}}FromCompositeFieldPath{{}} to copy -data from the composite resource to the EnvironmentConfig. +data from the composite resource to the in-memory environment. ```yaml {label="xrpatch",copy-lines="none"} apiVersion: apiextensions.crossplane.io/v1 @@ -360,17 +359,16 @@ spec: toFieldPath: newEnvironmentKey ``` -Individual resources can use any data written to the EnvironmentConfig. +Individual resources can use any data written to the in-memory environment. ##### Patch an individual resource - To patch an individual resource, inside the -{{}}patches{{}} object of the +{{}}patches{{}} of the resource, use {{}}ToEnvironmentFieldPath{{}} to copy -data from the resource to the EnvironmentConfig. +data from the resource to the in-memory environment. Use {{}}FromEnvironmentFieldPath{{}} -to copy data to the resource from the EnvironmentConfig. +to copy data to the resource from the in-memory environment. ```yaml {label="envpatch",copy-lines="none"} apiVersion: apiextensions.crossplane.io/v1