Skip to content

plugins/discovery: Replace environment variables after evaluation.#7787

Merged
srenatus merged 1 commit intoopen-policy-agent:mainfrom
srenatus:sr/kkssrkzztxtm
Jul 23, 2025
Merged

plugins/discovery: Replace environment variables after evaluation.#7787
srenatus merged 1 commit intoopen-policy-agent:mainfrom
srenatus:sr/kkssrkzztxtm

Conversation

@srenatus
Copy link
Copy Markdown
Contributor

This allows simple setups -- those feeding the OPA discovery plugin with a static JSON file -- to still do env variable replacements.

This should be possible already, by using a policy to construct the disco config, but it becomes easier now.

This allows simple setups -- those feeding the OPA discovery plugin with
a static JSON file -- to still do env variable replacements.

This should be possible already, by using a policy to construct the
disco config, but it becomes easier now.

Co-authored-by: Teemu Koponen <koponen@styra.com>
Signed-off-by: Stephan Renatus <stephan@styra.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented Jul 23, 2025

Deploy Preview for openpolicyagent ready!

Name Link
🔨 Latest commit 0bc0952
🔍 Latest deploy log https://app.netlify.com/projects/openpolicyagent/deploys/6880d7588dc2f800088c721f
😎 Deploy Preview https://deploy-preview-7787--openpolicyagent.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

@johanfylling johanfylling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

}

return config.ParseConfig(bs, id)
processedConf := cfg.SubEnvVars(string(bs))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it'd be possible to create a disco policy that has ${VAR_NAME} values/strings in its result?

@srenatus srenatus merged commit 2d014a8 into open-policy-agent:main Jul 23, 2025
31 checks passed
@srenatus srenatus deleted the sr/kkssrkzztxtm branch July 23, 2025 17:04
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.

3 participants