Skip to content

Commit 2120ce9

Browse files
authored
fix: enhance image replacement in ODH installer for cross-platform compatibility (opendatahub-io#210)
Updated the sed command in install-odh.sh to handle image replacement in manager.yaml with OS-specific syntax, ensuring compatibility between macOS and Linux environments.
1 parent b702d3c commit 2120ce9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

deployment/scripts/installers/install-odh.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,14 @@ EOF
5050
cp config/manager/kustomization.yaml.in config/manager/kustomization.yaml
5151
make manifests
5252
# Replace the image placeholder in manager.yaml after manifests are generated
53-
sed -i "s#REPLACE_IMAGE:latest#${ODH_OPERATOR_IMAGE}#g" config/manager/manager.yaml
53+
# Detect OS and use appropriate sed syntax
54+
if [[ "$OSTYPE" == "darwin"* ]]; then
55+
# macOS (BSD sed) - requires empty string after -i and different syntax
56+
sed -i '' "s#REPLACE_IMAGE:latest#${ODH_OPERATOR_IMAGE}#g" config/manager/manager.yaml
57+
else
58+
# Linux (GNU sed)
59+
sed -i "s#REPLACE_IMAGE:latest#${ODH_OPERATOR_IMAGE}#g" config/manager/manager.yaml
60+
fi
5461
if grep -q "REPLACE_IMAGE" config/manager/manager.yaml; then
5562
echo " Failed to update manager image in config/manager/manager.yaml"
5663
exit 1

0 commit comments

Comments
 (0)