Skip to content

Recreate telemetry app install stanza fix from #1724#1729

Merged
vivekr-splunk merged 1 commit intorevert-pr-1724-telemetry-workflow-guardsfrom
recreate-pr-1724-telemetry-fix-only
Feb 26, 2026
Merged

Recreate telemetry app install stanza fix from #1724#1729
vivekr-splunk merged 1 commit intorevert-pr-1724-telemetry-workflow-guardsfrom
recreate-pr-1724-telemetry-fix-only

Conversation

@vivekr-splunk
Copy link
Collaborator

This PR recreates only the intended telemetry app fix from #1724:

  • pkg/splunk/enterprise/names.go

It intentionally excludes the workflow secret-guard edits that caused workflow startup failures on develop.

Base is set to revert-pr-1724-telemetry-workflow-guards so this can be reviewed in sequence with the revert PR #1728.
After #1728 merges, retarget this PR to develop and merge.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 -e with printf when writing telemetry app config files for both non-SHC and SHC scenarios.
  • Preserve exact multiline content output for app.conf and default.meta generation.

💡 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"
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.

// 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"
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
@vivekr-splunk vivekr-splunk merged commit 4879080 into revert-pr-1724-telemetry-workflow-guards Feb 26, 2026
44 of 52 checks passed
@vivekr-splunk vivekr-splunk deleted the recreate-pr-1724-telemetry-fix-only branch February 26, 2026 21:09
@github-actions github-actions bot locked and limited conversation to collaborators Feb 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants