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

Replace all secret references in input map #3086

Merged
merged 4 commits into from
Nov 8, 2023

Conversation

michel-laterman
Copy link
Contributor

What is the problem this PR solves?

Secret references are being missed as they can be embedded in sub objects or arrays as part of the input (or stream) object.

How does this PR solve the problem?

Use a more generic approach to go through input objects and replace secret references.

How to test this PR locally

make test for the unit test that was added.

Or follow the integration setup instructions in #3083

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool

Related issues

Use a more generic approach to go through input objects and replace
secret references.
@michel-laterman michel-laterman added bug Something isn't working Team:Fleet Label for the Fleet team labels Nov 7, 2023
@michel-laterman michel-laterman requested a review from a team as a code owner November 7, 2023 18:26
Copy link
Member

@kpollich kpollich left a comment

Choose a reason for hiding this comment

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

Code + tests LGTM 🚀

internal/pkg/policy/secret.go Outdated Show resolved Hide resolved
Copy link

@joshdover joshdover added the backport-v8.11.0 Automated backport with mergify label Nov 8, 2023
@michel-laterman michel-laterman merged commit 0718a55 into elastic:main Nov 8, 2023
9 checks passed
@michel-laterman michel-laterman deleted the embedded-secret-refs branch November 8, 2023 15:50
mergify bot pushed a commit that referenced this pull request Nov 8, 2023
Use a more generic approach to go through input objects and replace
secret references.

(cherry picked from commit 0718a55)

# Conflicts:
#	internal/pkg/policy/secret.go
#	internal/pkg/policy/secret_test.go
elasticmachine pushed a commit that referenced this pull request Dec 6, 2023
)

Use a more generic approach to go through input objects and replace
secret references.

(cherry picked from commit 0718a55)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v8.11.0 Automated backport with mergify bug Something isn't working Team:Fleet Label for the Fleet team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace secret vars for arrays
4 participants