Apply suggestions from code review

Signed-off-by: Weiping Cai <weiping.cai@daocloud.io>
pull/21811/head
Cweiping 2020-06-20 12:41:38 +08:00 committed by Weiping Cai
parent 1253c3b39e
commit e3f6541d0a
No known key found for this signature in database
GPG Key ID: 97CBE6D7C8EBC386
1 changed files with 6 additions and 4 deletions

View File

@ -63,11 +63,14 @@ Pod:
As shown above, you have defined the correct dependency reference of `SERVICE_ADDRESS`, bad dependency reference of `UNCHANGED_REFERENCE` and skip dependent references of `ESCAPED_REFERENCE`.
When the environment variable is defined, you can use it directly. You can use it after the definition is completed, such as `SERVICE_ADDRESS`.
When an environment variable is already defined when being referenced,
the reference can be correctly resolved, such as in the `SERVICE_ADDRESS` case.
When the environment variable is undefined or only includes some variables, the undefined environment variable is treated as a normal string, such as `UNCHANGED_REFERENCE`. A bad reference does not interfere with the operation of the container.
When the environment variable is undefined or only includes some variables, the undefined environment variable is treated as a normal string, such as `UNCHANGED_REFERENCE`. Note that incorrectly parsed environment variables, in general, will not block the container from starting.
The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME).Escaped references will never be expanded, regardless of whether the variable exists or not.
The `$(VAR_NAME)` syntax can be escaped with a double `$`, ie: `$$(VAR_NAME)`.
Escaped references are never expanded, regardless of whether the referenced variable
is defined or not. This can be seen from the `ESCAPED_REFERENCE` case above.
## {{% heading "whatsnext" %}}
@ -75,4 +78,3 @@ The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME).Escaped
* Learn more about [environment variables](/docs/tasks/inject-data-application/environment-variable-expose-pod-information/).
* See [EnvVarSource](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#envvarsource-v1-core).