This repository has been archived by the owner on Oct 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consume Quarks Links as environment variables
[#170725085](https://www.pivotaltracker.com/story/show/170725085) Using Quarks links (entanglements) on the consumer side required changes in the operator so that a link property can be used through an environment variable and as a file with just the property content. In theory, this should enable consumers to retrieve the property value in their respective project with minimal adjustments. Introduce flattened link properties in the Kubernetes secrets that contain the link properties. The name and the data of the link secret change from `link-deploymentname-name` ``` "nats.nats": "{\"nats\": { \"port\": 4442}, ... }" ``` to a new flatten look and name `link-deploymentname-type-name` ``` "nats.port": "4442" "nats.user": "admin" ``` The link type and name become part of the secret name and will not be used in the secret data as the root key anymore. Therefore, all code sections and tests that wait or rely on the old link secret name were updated to use the new names. This relies on new convenience functions to create the name for both the link secret name and the type/name pair. The `cmd_instance_group_resolver` code and tests were updated to write the flattened properties in the `provides.json`, which is later used by a Quarks Job to persist the data into the link secrets. The `job_factory` code and tests were updated to use the new "fan-out" style of the Quarks Job project that writes the content of the aforementioned `provides.json` into separate link secrets, each only containing one key/value pair. With other words, there will be one secret per each link type/name tuple. The `pod_mutator` code and tests were changed to not mount the link properties as one file (`link.yaml`) anymore, but that each entry in the link properties becomes its own file in the target container. Also, each entry in the properties will result in an environment variable starting with the prefix `LINK_` and the respective value. For example, the nats username will be exposed as `LINK_NATS_USER` in the containers. Update documentation to include the changes with respect to the newly added environment variables that are based on the link secrets.
- Loading branch information
1 parent
4809336
commit 7427322
Showing
16 changed files
with
208 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.