Skip to content

Commit df54276

Browse files
committed
fix: add override behaviour
Signed-off-by: Chris Butler <chris.butler@redhat.com>
1 parent 4372638 commit df54276

2 files changed

Lines changed: 57 additions & 14 deletions

File tree

rhdp-isolated/bastion/wrapper-disconnected.sh

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -168,25 +168,51 @@ sleep 30
168168
log_info "Checking catalog source status:"
169169
oc get catalogsources -n openshift-marketplace
170170

171-
log_step "Setting up pattern secrets"
172-
bash ./scripts/gen-secrets.sh
173-
174171
log_info "Waiting for cluster to stabilize..."
175172
sleep 60
176173

174+
log_step "Setting up pattern secrets"
175+
bash ./scripts/gen-secrets.sh
176+
177177
log_step "Installing CoCo pattern with disconnected configuration"
178178

179179
# Set environment variable to point to mirrored helm charts
180180
export PATTERN_DISCONNECTED_HOME="${ACR_LOGIN_SERVER}/hybridcloudpatterns"
181181

182182
log_info "Using mirrored Helm repository: ${PATTERN_DISCONNECTED_HOME}"
183183

184-
# Create or update values-disconnected.yaml if it doesn't exist
184+
# Validate values-disconnected.yaml exists
185185
if [ ! -f "values-disconnected.yaml" ]; then
186-
log_warn "values-disconnected.yaml not found, using values-simple.yaml as base"
187-
log_warn "Note: You may need to update operator sources to match mirrored catalogs"
186+
log_error "values-disconnected.yaml not found"
187+
log_error "This file is required for disconnected installation"
188+
exit 1
188189
fi
189190

191+
# IMPORTANT: Do NOT patch values-disconnected.yaml on the bastion!
192+
# ArgoCD will read values files from Git, so any local patches are lost.
193+
# Instead, we use --set to override values at install time.
194+
195+
# Build EXTRA_HELM_OPTS with both the values file AND runtime overrides
196+
# The --set flag takes precedence over values files (per Makefile comment)
197+
export EXTRA_HELM_OPTS="-f values-disconnected.yaml \
198+
--set main.multiSourceConfig.helmRepoUrl=${ACR_LOGIN_SERVER}/hybridcloudpatterns"
199+
200+
log_info "Helm options configured:"
201+
log_info " Base values: values-global.yaml (always loaded)"
202+
log_info " Cluster group: values-simple.yaml (from clusterGroupName)"
203+
log_info " Overlay: values-disconnected.yaml (catalog sources, operators)"
204+
log_info " Runtime override: --set main.multiSourceConfig.helmRepoUrl"
205+
log_info ""
206+
log_info "Disconnected configuration:"
207+
log_info " helmRepoUrl: ${ACR_LOGIN_SERVER}/hybridcloudpatterns (via --set)"
208+
log_info " Operator sources: cs-*-v4-20 (from values-disconnected.yaml)"
209+
log_info ""
210+
log_info "Why this approach:"
211+
log_info " 1. ArgoCD reads values files from Git (not bastion)"
212+
log_info " 2. --set overrides are baked into ArgoCD Application at install time"
213+
log_info " 3. No need to modify files that ArgoCD syncs from Git"
214+
log_info " 4. Avoids race conditions with helmRepoUrl availability"
215+
190216
# Install pattern
191217
log_info "Running pattern installation..."
192218
./pattern.sh make install
@@ -204,15 +230,23 @@ log_info "Credentials:"
204230
log_info " Username: kubeadmin"
205231
log_info " Password: $(cat ./openshift-install-disconnected/auth/kubeadmin-password)"
206232
log_info ""
207-
log_info "Pattern installed in disconnected mode"
208-
log_info "Images sourced from: ${ACR_LOGIN_SERVER}"
233+
log_info "Disconnected Configuration:"
234+
log_info " Container Registry: ${ACR_LOGIN_SERVER}"
235+
log_info " Helm Repository: ${ACR_LOGIN_SERVER}/hybridcloudpatterns"
236+
log_info " Catalog Sources: cs-redhat-operator-index-v4-20, cs-community-operator-index-v4-20"
209237
log_info ""
210238
log_info "To access the cluster from this bastion:"
211239
log_info " export KUBECONFIG=$(pwd)/openshift-install-disconnected/auth/kubeconfig"
212240
log_info " oc get nodes"
241+
log_info " oc get clusterversion"
213242
log_info ""
214243
log_info "Monitor pattern deployment:"
215244
log_info " oc get applications -A"
216245
log_info " oc get pods -n openshift-gitops"
246+
log_info " oc get subscriptions -A"
247+
log_info ""
248+
log_info "Check CoCo/Sandboxed Containers:"
249+
log_info " oc get pods -n openshift-sandboxed-containers-operator"
250+
log_info " oc get kataconfig"
217251
log_info ""
218252

values-disconnected.yaml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,26 @@
22
# This file should be used in addition to values-simple.yaml or your chosen cluster group
33
#
44
# Usage:
5-
# Ensure this file is committed to your repository before installation
6-
# The pattern will use catalog sources generated by oc-mirror
5+
# This file is read by ArgoCD from Git during pattern deployment.
6+
# The helmRepoUrl below is a PLACEHOLDER and should NOT be manually updated.
7+
#
8+
# The wrapper-disconnected.sh script will override this value at install time using:
9+
# --set main.multiSourceConfig.helmRepoUrl=<actual-acr-url>/hybridcloudpatterns
10+
#
11+
# This approach ensures:
12+
# - No need to commit ACR-specific URLs to Git
13+
# - ArgoCD gets the correct URL (baked in at install time)
14+
# - Pattern works in both connected and disconnected modes
715

816
# Global overrides for disconnected operation
917
global:
1018
main:
1119
multiSourceConfig:
1220
enabled: true
1321
clusterGroupChartVersion: "0.9.6"
14-
# IMPORTANT: Update this to match your ACR URL after mirroring
15-
# Example: acrcocod<guid><suffix>.azurecr.io/hybridcloudpatterns
16-
helmRepoUrl: CHANGE_ME_ACR_URL/hybridcloudpatterns
22+
# PLACEHOLDER: This will be overridden at install time via --set
23+
# The actual ACR URL is provided by the wrapper-disconnected.sh script
24+
helmRepoUrl: oci://quay.io/hybridcloudpatterns
1725

1826
# Patterns operator source - matches oc-mirror generated catalog
1927
patternsOperator:
@@ -58,8 +66,9 @@ clusterGroup:
5866

5967
# Notes:
6068
# 1. The catalog source names (cs-*-v4-20) are generated by oc-mirror
61-
# 2. Update helmRepoUrl after running mirror.sh with your actual ACR URL
69+
# 2. helmRepoUrl is overridden at install time via --set (not manually updated)
6270
# 3. CatalogSource names can be verified with:
6371
# oc get catalogsources -n openshift-marketplace
6472
# 4. This file should be updated if mirroring to OpenShift 4.21 or later
73+
# 5. For disconnected installation, use: ./rhdp-isolated/bastion/wrapper-disconnected.sh
6574

0 commit comments

Comments
 (0)