-
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
[Synthetics] adjust run_from.id for private locations #156324
Changes from 4 commits
f93654c
6c692f3
8562115
f8d2c46
b2e59a2
464c507
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,8 @@ export const migratePackagePolicyToV880: SavedObjectMigrationFn<PackagePolicy, P | |
return packagePolicyDoc; | ||
} | ||
|
||
const agentPolicyId = packagePolicyDoc.attributes.policy_id; | ||
|
||
const updatedPackagePolicyDoc: SavedObjectUnsanitizedDoc<PackagePolicy> = packagePolicyDoc; | ||
|
||
const enabledInput = updatedPackagePolicyDoc.attributes.inputs.find( | ||
|
@@ -66,6 +68,12 @@ export const migratePackagePolicyToV880: SavedObjectMigrationFn<PackagePolicy, P | |
} | ||
} | ||
|
||
// set location_id.id to agentPolicyId | ||
if (enabledStream.vars && enabledStream.vars.location_id) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This var doesn't yet exist in existing policies, so this condition will never be satisfied. We need to manually add on the new variable. |
||
enabledStream.vars.location_id.value = agentPolicyId; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So this var doesn't yet exist, but will in the version of the policy that will be shipped with 8.8.0. Because of that, we may want to also add in the type?
I'm not sure if creating a brand new variable that doesn't yet exist causes issues, @kpollich |
||
enabledStream.compiled_stream.location_id = agentPolicyId; | ||
} | ||
|
||
return updatedPackagePolicyDoc; | ||
}; | ||
|
||
|
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.
Remove this. This does not exist in the current policies. It's a bad fixture.