Skip to content

Commit fc38e36

Browse files
Merge pull request #20 from OutSystems/RDSHDT-1980-support-pegasus-flag
RDSHDT-1980: Support Pegasus Flag
2 parents e7963eb + 9457fa8 commit fc38e36

File tree

3 files changed

+81
-4
lines changed

3 files changed

+81
-4
lines changed

scripts/linux-installer.sh

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ IMAGE_NAME="self-hosted-operator"
1313
DEFAULT_ENV="ea" # Default environment as per the release state. Change this value as release progress.
1414
DEFAULT_OPERATION="install"
1515
DEFAULT_USE_ACR="false" # Temporary backward compatibility for Azure ACR
16+
DEFAULT_PEGASUS_ENABLED="false" # Enable Pegasus features
1617

1718
# Environment-specific settings
1819
ECR_ALIAS_GA="j0s5s8b0/ga" # GA ECR alias
@@ -26,6 +27,7 @@ SHO_VERSION=""
2627
ENV="$DEFAULT_ENV"
2728
OPERATION="$DEFAULT_OPERATION"
2829
USE_ACR="$DEFAULT_USE_ACR"
30+
PEGASUS_ENABLED="$DEFAULT_PEGASUS_ENABLED"
2931

3032
# Derived configuration (set by setup_environment)
3133
ECR_ALIAS=""
@@ -72,6 +74,8 @@ OPTIONS:
7274
--operation=OPERATION Operation: install, uninstall, get-console-url (default: install)
7375
--use-acr=BOOLEAN Use ACR registry: true, false (default: false)
7476
[TEMPORARY: Backward compatibility for Azure ACR]
77+
--pegasus-enabled=BOOLEAN Enable Pegasus features: true, false (default: false)
78+
Note: Only supported in test environment
7579
--help, -h Show this help message
7680
7781
OPERATIONS:
@@ -146,6 +150,13 @@ validate_arguments() {
146150
log_success "Version '$SHO_VERSION' format is valid"
147151
fi
148152

153+
# Validate Pegasus configuration
154+
if [[ "$PEGASUS_ENABLED" == "true" && "$ENV" != "test" ]]; then
155+
log_error "Pegasus features (--pegasus-enabled=true) are only supported in 'test' environment"
156+
log_info "Current environment: $ENV"
157+
return 1
158+
fi
159+
149160
# Validate ACR configuration only for install operation
150161
if [[ "$USE_ACR" == "true" ]]; then
151162
if [[ "$OPERATION" == "install" ]]; then
@@ -215,6 +226,23 @@ parse_arguments() {
215226
USE_ACR="true"
216227
log_info "ACR registry mode enabled"
217228
;;
229+
--pegasus-enabled=*)
230+
PEGASUS_ENABLED="${1#*=}"
231+
# Normalize boolean values
232+
case "$(echo "${PEGASUS_ENABLED}" | tr '[:upper:]' '[:lower:]')" in
233+
true|1|yes|on)
234+
PEGASUS_ENABLED="true"
235+
log_info "Pegasus features enabled"
236+
;;
237+
false|0|no|off)
238+
PEGASUS_ENABLED="false"
239+
;;
240+
*)
241+
log_error "Invalid value for --pegasus-enabled: '$PEGASUS_ENABLED'. Must be true or false"
242+
exit 1
243+
;;
244+
esac
245+
;;
218246
--help|-h)
219247
show_usage
220248
exit 0
@@ -539,7 +567,8 @@ sho_install() {
539567
--set "registry.url=${SH_REGISTRY}" \
540568
--set "registry.username=${SP_ID}" \
541569
--set "registry.password=${SP_SECRET}" \
542-
--set "enableECR.enabled=false" 2>&1)
570+
--set "enableECR.enabled=false" \
571+
--set "pegasusEnabled=$PEGASUS_ENABLED" 2>&1)
543572
else
544573
install_output=$(helm upgrade --install "${CHART_NAME}" "${chart_file}" \
545574
--namespace "$NAMESPACE" \
@@ -548,7 +577,8 @@ sho_install() {
548577
--set "image.repository=${IMAGE_NAME}" \
549578
--set "image.tag=v${SHO_VERSION}" \
550579
--set-string "podAnnotations.timestamp=$timestamp" \
551-
--set "ring=$ENV" 2>&1)
580+
--set "ring=$ENV" \
581+
--set "pegasusEnabled=$PEGASUS_ENABLED" 2>&1)
552582
fi
553583

554584
if [[ $? -eq 0 ]]; then

scripts/macos-installer.sh

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ IMAGE_NAME="self-hosted-operator"
1313
DEFAULT_ENV="ea" # Default environment as per the release state. Change this value as release progress.
1414
DEFAULT_OPERATION="install"
1515
DEFAULT_USE_ACR="false" # Temporary backward compatibility for Azure ACR
16+
DEFAULT_PEGASUS_ENABLED="false" # Enable Pegasus features
1617

1718
# Environment-specific settings
1819
ECR_ALIAS_GA="j0s5s8b0/ga" # GA ECR alias
@@ -26,6 +27,7 @@ SHO_VERSION=""
2627
ENV="$DEFAULT_ENV"
2728
OPERATION="$DEFAULT_OPERATION"
2829
USE_ACR="$DEFAULT_USE_ACR"
30+
PEGASUS_ENABLED="$DEFAULT_PEGASUS_ENABLED"
2931

3032
# Derived configuration (set by setup_environment)
3133
ECR_ALIAS=""
@@ -75,6 +77,8 @@ OPTIONS:
7577
--operation=OPERATION Operation: install, uninstall, get-console-url (default: install)
7678
--use-acr=BOOLEAN Use ACR registry: true, false (default: false)
7779
[TEMPORARY: Backward compatibility for Azure ACR]
80+
--pegasus-enabled=BOOLEAN Enable Pegasus features: true, false (default: false)
81+
Note: Only supported in test environment
7882
--help, -h Show this help message
7983
8084
OPERATIONS:
@@ -150,6 +154,13 @@ validate_arguments() {
150154
log_success "Version '$SHO_VERSION' format is valid"
151155
fi
152156

157+
# Validate Pegasus configuration
158+
if [[ "$PEGASUS_ENABLED" == "true" && "$ENV" != "test" ]]; then
159+
log_error "Pegasus features (--pegasus-enabled=true) are only supported in 'test' environment"
160+
log_info "Current environment: $ENV"
161+
return 1
162+
fi
163+
153164
# Validate ACR configuration only for install operation
154165
if [[ "$USE_ACR" == "true" ]]; then
155166
if [[ "$OPERATION" == "install" ]]; then
@@ -219,6 +230,23 @@ parse_arguments() {
219230
USE_ACR="true"
220231
log_info "ACR registry mode enabled"
221232
;;
233+
--pegasus-enabled=*)
234+
PEGASUS_ENABLED="${1#*=}"
235+
# Normalize boolean values
236+
case "$(echo "${PEGASUS_ENABLED}" | tr '[:upper:]' '[:lower:]')" in
237+
true|1|yes|on)
238+
PEGASUS_ENABLED="true"
239+
log_info "Pegasus features enabled"
240+
;;
241+
false|0|no|off)
242+
PEGASUS_ENABLED="false"
243+
;;
244+
*)
245+
log_error "Invalid value for --pegasus-enabled: '$PEGASUS_ENABLED'. Must be true or false"
246+
exit 1
247+
;;
248+
esac
249+
;;
222250
--help|-h)
223251
show_usage
224252
exit 0
@@ -549,7 +577,8 @@ sho_install() {
549577
--set "registry.url=${SH_REGISTRY}" \
550578
--set "registry.username=${SP_ID}" \
551579
--set "registry.password=${SP_SECRET}" \
552-
--set "enableECR.enabled=false" 2>&1)
580+
--set "enableECR.enabled=false" \
581+
--set "pegasusEnabled=$PEGASUS_ENABLED" 2>&1)
553582
else
554583
install_output=$(helm upgrade --install "${CHART_NAME}" "${chart_file}" \
555584
--namespace "$NAMESPACE" \
@@ -558,7 +587,8 @@ sho_install() {
558587
--set "image.repository=${IMAGE_NAME}" \
559588
--set "image.tag=v${SHO_VERSION}" \
560589
--set-string "podAnnotations.timestamp=$timestamp" \
561-
--set "ring=$ENV" 2>&1)
590+
--set "ring=$ENV" \
591+
--set "pegasusEnabled=$PEGASUS_ENABLED" 2>&1)
562592
fi
563593

564594
if [[ $? -eq 0 ]]; then

scripts/windows-installer.ps1

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ param(
88
[string]$operation = "install",
99
[ValidateSet("true", "false")]
1010
[string]$use_acr = "false", # Temporary backward compatibility for Azure ACR
11+
[ValidateSet("true", "false")]
12+
[string]$pegasus_enabled = "false", # Enable Pegasus features
1113
[switch]$UseAcr,
1214
[Alias("h")]
1315
[switch]$help
@@ -38,6 +40,7 @@ $Script:ShoVersion = $version
3840
$Script:Env = $env
3941
$Script:Op = $operation
4042
$Script:UseAcr = if ($UseAcr.IsPresent) { $true } elseif ($use_acr -eq "true") { $true } else { $false }
43+
$Script:PegasusEnabled = if ($pegasus_enabled -eq "true") { $true } else { $false }
4144

4245
# Derived configuration
4346
$Script:EcrAlias = ""
@@ -95,6 +98,8 @@ OPTIONS:
9598
-operation OPERATION Operation: install, uninstall, get-console-url (default: install)
9699
-use-acr BOOLEAN Use ACR registry: true, false (default: true)
97100
[TEMPORARY: Backward compatibility for Azure ACR]
101+
-pegasus_enabled BOOLEAN Enable Pegasus features: true, false (default: false)
102+
Note: Only supported in test environment
98103
-help, -h Show this help message
99104
100105
OPERATIONS:
@@ -589,6 +594,13 @@ function Install-Sho {
589594
"--set", "ring=$Script:Env"
590595
)
591596

597+
# Validate Pegasus configuration
598+
if ($Script:PegasusEnabled -and $Script:Env -ne "test") {
599+
Write-LogError "Pegasus features (-pegasus_enabled true) are only supported in 'test' environment"
600+
Write-LogInfo "Current environment: $Script:Env"
601+
return $false
602+
}
603+
592604
if ($Script:UseAcr) {
593605
Write-LogInfo "Installing with ACR registry configuration"
594606
$helmArgs += @(
@@ -599,6 +611,11 @@ function Install-Sho {
599611
)
600612
}
601613

614+
# Add pegasusEnabled to helm arguments
615+
$helmArgs += @(
616+
"--set", "pegasusEnabled=$($Script:PegasusEnabled.ToString().ToLower())"
617+
)
618+
602619
$installOutput = & helm $helmArgs 2>&1
603620

604621
if ($LASTEXITCODE -eq 0) {

0 commit comments

Comments
 (0)