-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[APM] ensure rum_allow_origins setting only saves valid YAML strings #128704
Conversation
Pinging @elastic/apm-ui (Team:apm) |
@@ -65,7 +66,7 @@ export async function createCloudApmPackgePolicy({ | |||
savedObjectsClient, | |||
esClient, | |||
mergedAPMPackagePolicy, | |||
{ force: true, bumpRevision: true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ensures the package policy ID is set correct. There was a bug previously in #128496 .
@@ -73,6 +72,9 @@ function getApmPackageInputVars({ | |||
}): Record<string, { type: string; value: any }> { | |||
const overrideValues: Record<string, any> = { | |||
url: cloudPluginSetup?.apm?.url, // overrides 'apm-server.url' to be the cloud APM host | |||
rum_allow_origins: ensureValidMultiText( | |||
apmServerSchema[INPUT_VAR_NAME_TO_SCHEMA_PATH.rum_allow_origins] | |||
), // fixes issue where "*" needs to be wrapped in quotes to be parsed as a YAML string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is specific to rum_allow_origins
since it's the only type: "text", multi: true
input var that accepts wildcard string values (allows all origins). But we could apply this to all similar values if we want to.
💚 Build SucceededMetrics [docs]
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ogupte for doing this and for the comments to help us understand the changes 🌟
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Closes #128703.
Ensures that the text values set in the
rum_allow_origins
setting (apm-server.rum.allow_origins
) will be checked if they are valid YAML strings and then wrapped in quotes if not. This fixes the bug #121934 (in the short term) that would fail when the user attempts to migrate from classic indices / standalong APM server to a fleet-managed APM server agent policy. The fix validates and updates the settings values only when a user attempts the migration.