Recreate telemetry app install stanza fix from #1724#1729
Conversation
fdf2dd3 to
4c7bf51
Compare
a1e823b to
43529f5
Compare
There was a problem hiding this comment.
Pull request overview
This PR reintroduces the intended fix from #1724 to reliably generate the telemetry app’s app.conf/default.meta content without relying on echo -e, avoiding shells that emit a literal -e prefix.
Changes:
- Replace
echo -ewithprintfwhen writing telemetry app config files for both non-SHC and SHC scenarios. - Preserve exact multiline content output for
app.confanddefault.metageneration.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| // Command to create telemetry app on non SHC scenarios | ||
| createTelAppNonShcString = "mkdir -p /opt/splunk/etc/apps/app_tel_for_sok/default/; mkdir -p /opt/splunk/etc/apps/app_tel_for_sok/metadata/; echo -e \"%s\" > /opt/splunk/etc/apps/app_tel_for_sok/default/app.conf; echo -e \"%s\" > /opt/splunk/etc/apps/app_tel_for_sok/metadata/default.meta" | ||
| createTelAppNonShcString = "mkdir -p /opt/splunk/etc/apps/app_tel_for_sok/default/; mkdir -p /opt/splunk/etc/apps/app_tel_for_sok/metadata/; printf '%%s' \"%s\" > /opt/splunk/etc/apps/app_tel_for_sok/default/app.conf; printf '%%s' \"%s\" > /opt/splunk/etc/apps/app_tel_for_sok/metadata/default.meta" |
There was a problem hiding this comment.
These commands chain multiple steps with ;, so /bin/sh will return the exit code of only the last printf. If an earlier mkdir or the first file write fails but the last printf succeeds, runCustomCommandOnSplunkPods may treat the overall operation as successful. Consider switching separators to && (or prefixing with set -e) so failures propagate reliably.
|
|
||
| // Command to create telemetry app on SHC scenarios | ||
| createTelAppShcString = "mkdir -p %s/app_tel_for_sok/default/; mkdir -p %s/app_tel_for_sok/metadata/; echo -e \"%s\" > %s/app_tel_for_sok/default/app.conf; echo -e \"%s\" > %s/app_tel_for_sok/metadata/default.meta" | ||
| createTelAppShcString = "mkdir -p %s/app_tel_for_sok/default/; mkdir -p %s/app_tel_for_sok/metadata/; printf '%%s' \"%s\" > %s/app_tel_for_sok/default/app.conf; printf '%%s' \"%s\" > %s/app_tel_for_sok/metadata/default.meta" |
There was a problem hiding this comment.
Same issue as the non-SHC command: using ; between steps means the shell’s exit status is determined by the last printf, potentially masking failures in earlier mkdir/write operations. Use && (or set -e) to ensure the exec call fails when any step fails.
4879080
into
revert-pr-1724-telemetry-workflow-guards
This PR recreates only the intended telemetry app fix from #1724:
pkg/splunk/enterprise/names.goIt intentionally excludes the workflow secret-guard edits that caused workflow startup failures on
develop.Base is set to
revert-pr-1724-telemetry-workflow-guardsso this can be reviewed in sequence with the revert PR #1728.After #1728 merges, retarget this PR to
developand merge.