Skip to content

Commit

Permalink
Don't check for td-agent when installing without fluentd (#394)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyc-splunk authored May 12, 2021
1 parent b795e50 commit 2f0f309
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions internal/buildscripts/packaging/installer/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -336,11 +336,11 @@ if (service_installed -name "$service_name") {
throw "The $service_name service is already installed. Remove/Uninstall the collector and re-run this script."
}

if (service_installed -name "$fluentd_service_name") {
if ($with_fluentd -And (service_installed -name "$fluentd_service_name")) {
throw "The $fluentd_service_name service is already installed. Remove/Uninstall fluentd and re-run this script."
}

if (Test-Path -Path "$fluentd_base_dir\bin\fluentd") {
if ($with_fluentd -And (Test-Path -Path "$fluentd_base_dir\bin\fluentd")) {
throw "$fluentd_base_dir\bin\fluentd is already installed. Remove/Uninstall fluentd and re-run this script."
}

Expand Down
11 changes: 9 additions & 2 deletions internal/buildscripts/packaging/installer/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,14 @@ install_yum_package() {
}

ensure_not_installed() {
for agent in otelcol td-agent; do
local with_fluentd="$1"
local agents="otelcol"

if [ "$with_fluentd" = "true" ]; then
agents="$agents td-agent"
fi

for agent in $agents; do
if command -v $agent >/dev/null 2>&1; then
echo "An agent binary already exists at $( command -v $agent ) which implies that the agent has already been installed." >&2
echo "Please uninstall the agent and re-run this script." >&2
Expand Down Expand Up @@ -658,7 +665,7 @@ parse_args_and_install() {
exit 0
fi

ensure_not_installed
ensure_not_installed "$with_fluentd"

if [ -z "$access_token" ]; then
access_token=$(request_access_token)
Expand Down

0 comments on commit 2f0f309

Please sign in to comment.