gcp: fix test configs#18819
Conversation
|
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
efd6
left a comment
There was a problem hiding this comment.
This is not the correct fix; there is a template error that the new Fleet YAML handling code has uncovered. The correct fix is, for example:
diff --git a/packages/gcp/data_stream/loadbalancing_logs/agent/stream/gcp-pubsub.yml.hbs b/packages/gcp/data_stream/loadbalancing_logs/agent/stream/gcp-pubsub.yml.hbs
index d69cec05b2..e3f22e4aa1 100644
--- a/packages/gcp/data_stream/loadbalancing_logs/agent/stream/gcp-pubsub.yml.hbs
+++ b/packages/gcp/data_stream/loadbalancing_logs/agent/stream/gcp-pubsub.yml.hbs
@@ -5,7 +5,7 @@ subscription.name: {{subscription_name}}
credentials_file: {{credentials_file}}
{{/if}}
{{#if credentials_json}}
-credentials_json: '{{credentials_json}}'
+credentials_json: {{escape_string credentials_json}}
{{/if}}
{{#if alternative_host}}
alternative_host: {{alternative_host}}This needs to be applied to all the .hbs files in the integration. Suggest the following commit message:
gcp: use escape_string for credentials_json in templates
The Handlebars templates wrap credentials_json in literal single
quotes ('{{credentials_json}}'). When the value contains newlines,
the rendered YAML has literal newlines inside a single-quoted flow
scalar, which eemeli/yaml rejects during parse:
Missing closing 'quote at line 14, column 51
Fleet provides an escape_string helper that detects newlines and
switches to double-quoted form with \n escapes. Replace the manual
single-quote wrapping with {{escape_string credentials_json}} in
all 24 affected templates across gcp, gcp_pubsub, gcp_metrics,
gcp_vertexai, and kubernetes/audit_logs.
Fixes #18722
Fixes #18723
Fixes #18724
Fixes #18725
Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co>
This comment has been minimized.
This comment has been minimized.
TL;DRThis failed in Buildkite’s pipeline-upload bootstrap step, not in package/test code from this PR. The Remediation
Investigation detailsRoot CauseThe only failing job is No failing assertion, compile error, or package-level test output was produced, so this does not currently point to a source-code regression in the PR diff. Evidence
Verification
Follow-upIf the retry fails with the same message, capture the full agent bootstrap context (queue/agent assignment and env for that step) to confirm whether this is an agent provisioning/config issue specific to this pipeline. Note 🔒 Integrity filter blocked 2 itemsThe following items were blocked because they don't meet the GitHub integrity level.
To allow these resources, lower tools:
github:
min-integrity: approved # merged | approved | unapproved | noneWhat is this? | From workflow: PR Buildkite Detective Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
🚀 Benchmarks reportTo see the full report comment with |
|
@stefans-elastic Please address #18819 (review). |
sorry, somehow I messed the original comment. |
|
@stefans-elastic Please make sure you paste in commit message along the lines of what is in #18819 (review) (it doesn't have to be exactly that, but it should be prose and explain the issue and change as that does). |
good note (I would have forgotten), thanks |
|
pinging @elastic/obs-ds-hosted-services and @elastic/obs-infraobs-integrations for code owner review |
💚 Build Succeeded
History
|
|
Package gcp - 2.50.1 containing this change is available at https://epr.elastic.co/package/gcp/2.50.1/ |
Proposed commit message
gcp: fix credentials_json quoting in Handlebars templates
GCP package templates wrapped credentials_json in literal single quotes
('{{credentials_json}}'). When the credentials JSON value contains
embedded newlines — as PEM-encoded private keys do — the rendered
Agent-policy YAML places those newlines inside a single-quoted flow
scalar, which the eemeli/yaml parser Fleet now uses rejects:
Replace the manual single-quote wrapping with the Fleet-provided
{{escape_string credentials_json}} helper across all 18 affected
templates (gcp-pubsub.yml.hbs and stream.yml.hbs variants). The helper
inspects the value at render time: safe scalars are left unquoted;
values containing newlines or special characters are emitted as
double-quoted strings with \n escapes.
Checklist
changelog.ymlfile.Author's Checklist
How to test this PR locally
Related issues
Screenshots