Skip to content

Support setting dataSourceConfig through secrets or extraEnv#51

Merged
RazcoDev merged 2 commits intopermitio:masterfrom
northvolt:pc/data-config-through-secrets
Aug 10, 2023
Merged

Support setting dataSourceConfig through secrets or extraEnv#51
RazcoDev merged 2 commits intopermitio:masterfrom
northvolt:pc/data-config-through-secrets

Conversation

@philipclaesson
Copy link
Copy Markdown
Contributor

@philipclaesson philipclaesson commented Aug 10, 2023

This PR contains two changes which are necessary in order to support passing dataSourceConfig as an env variable (through extraEnv or secrets) rather than via values.yaml.

  1. Don't set env variable OPAL_DATA_CONFIG_SOURCES if config: null
  2. Don't set env variable OPAL_DATA_UPDATER_ENABLED if it is passed as extraEnv

Before this change, running template with an empty datasources object

dataConfigSources:
	config: null

and also passing an extraEnv containing OPAL_DATA_UPDATER_ENABLED

extraEnv: {
"OPAL_DATA_UPDATER_ENABLED": "true"
}

would yield two conflicting definitions of the OPAL_DATA_UPDATER_ENABLED:

➜ helm template . -f values.yaml | grep DATA_UPDATER -A 1
            - name: OPAL_DATA_UPDATER_ENABLED
              value: "False"
--
            - name: OPAL_DATA_UPDATER_ENABLED
              value: "true"

After this change, the value passed in extraEnv takes precedence

➜ helm template . -f values.yaml | grep DATA_UPDATER -A 1
            - name: OPAL_DATA_UPDATER_ENABLED
              value: "true"

Furthermore, with config: null we do not set OPAL_DATA_CONFIG_SOURCES, and assume that it will be passed through extraEnv or secret.

Philip Claesson added 2 commits August 10, 2023 11:33
Adding a fourth option to set the config to null, which will leave the variable out completely, assuming it will be passed through env or secret.
@RazcoDev RazcoDev merged commit f0f8918 into permitio:master Aug 10, 2023
@philipclaesson philipclaesson deleted the pc/data-config-through-secrets branch August 10, 2023 11:11
philipclaesson pushed a commit to northvolt/opal-helm-chart that referenced this pull request Aug 10, 2023
In my latest pr permitio#51, I introduced functionality that would avoid setting the OPAL_DATA_UPDATER_ENABLED variable on the client if the variable was set on the server.

This is obviously a bit confusing. We should instead override the client env var on the client itself.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants