Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

agent: Add logic to validate env_template entries in configuration #20569

Merged
merged 53 commits into from
May 23, 2023

Conversation

averche
Copy link
Contributor

@averche averche commented May 11, 2023

This pull request adds logic to validate that the given agent configuration with env_template or top level exec entries is valid. It is part of the larger effort to add environment variable support within Vault Agent (VLT-253).

In brief, the following rules are ascertained as part of validation:

  • exec must be present if at least one env_template entry is specified and vice-versa
  • template and api_proxy are not compatible with env_template entries
  • env_template only allows a subset of file template fields (currently only the name, contents, and error_on_missing_key), all other fields will result in a validation error.

Related PRs:

@averche averche requested review from VioletHynes, dhuckins and a team May 11, 2023 21:21
averche and others added 4 commits May 19, 2023 13:57
@averche averche marked this pull request as ready for review May 19, 2023 18:03
command/agent/config/config.go Outdated Show resolved Hide resolved
command/agent/config/config.go Outdated Show resolved Hide resolved
command/agent/config/config.go Outdated Show resolved Hide resolved
command/agent/config/config.go Outdated Show resolved Hide resolved
command/agent/config/config.go Outdated Show resolved Hide resolved
@averche averche requested a review from VioletHynes May 19, 2023 21:28
Base automatically changed from agent-runner-env-var-config to main May 19, 2023 22:11
@averche averche added this to the 1.14 milestone May 19, 2023
@averche averche requested a review from VioletHynes May 23, 2023 16:10
Copy link
Contributor

@VioletHynes VioletHynes left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for incorporating the feedback!

@averche averche enabled auto-merge (squash) May 23, 2023 18:30
@averche averche changed the title agent: Add logic to validate env_template entries agent: Add logic to validate env_template entries in configuration May 23, 2023
@averche averche merged commit a051ab4 into main May 23, 2023
@averche averche deleted the agent-template-validation branch May 23, 2023 18:37
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