Skip to content

Commit 4372638

Browse files
committed
feat: working mirror config
Signed-off-by: Chris Butler <chris.butler@redhat.com>
1 parent b7e5418 commit 4372638

4 files changed

Lines changed: 45 additions & 21 deletions

File tree

rhdp-isolated/bastion/imageset-config.yaml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,22 @@ mirror:
2323
# OpenShift Sandboxed Containers (CoCo runtime)
2424
- name: sandboxed-containers-operator
2525
channels:
26-
- name: stable-1.10
26+
- name: stable
2727

2828
# OpenShift GitOps (ArgoCD for patterns)
2929
- name: openshift-gitops-operator
3030
channels:
3131
- name: latest
3232

33-
# Advanced Cluster Management
33+
# Advanced Cluster Management (using latest stable channel)
3434
- name: advanced-cluster-management
3535
channels:
36-
- name: release-2.12
36+
- name: release-2.14
3737

38-
# Multicluster Engine
38+
# Multicluster Engine (compatible with ACM 2.14)
3939
- name: multicluster-engine
4040
channels:
41-
- name: stable-2.7
41+
- name: stable-2.9
4242

4343
# Cert Manager (for certificate management)
4444
- name: cert-manager
@@ -63,6 +63,7 @@ mirror:
6363
# Base images
6464
- name: registry.redhat.io/ubi9/ubi-minimal:latest
6565
- name: registry.redhat.io/ubi9/ubi:latest
66+
- name: registry.access.redhat.com/ubi9/ubi:latest
6667
- name: registry.redhat.io/ubi8/ubi-minimal:latest
6768
- name: registry.access.redhat.com/ubi8/httpd-24:1-226
6869

@@ -75,24 +76,21 @@ mirror:
7576
# Ansible Automation Platform (for imperative jobs)
7677
- name: registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel9:latest
7778

78-
# Validated Patterns Helm Charts (explicit versions)
79+
# Validated Patterns Helm Charts and Container Images
7980
- name: quay.io/hybridcloudpatterns/acm:0.1.4
8081
- name: quay.io/hybridcloudpatterns/clustergroup:0.9.6
8182
- name: quay.io/hybridcloudpatterns/gitea:0.0.3
8283
- name: quay.io/hybridcloudpatterns/golang-external-secrets:0.1.4
8384
- name: quay.io/hybridcloudpatterns/hashicorp-vault:0.1.4
84-
- name: quay.io/hybridcloudpatterns/utility-container:v0.2.0
85-
- name: quay.io/hybridcloudpatterns/imperative-container:v1.0.0
85+
- name: quay.io/hybridcloudpatterns/utility-container:latest
86+
- name: quay.io/hybridcloudpatterns/imperative-container:latest
8687
- name: quay.io/hybridcloudpatterns/pattern-install:0.0.4
8788

8889
# Gitea (internal git server for patterns)
8990
- name: docker.io/gitea/gitea:1.21.11-rootless
9091

91-
# Trustee (Key Broker Service for CoCo)
92-
# Note: These are approximate image references, adjust based on actual trustee release
93-
- name: quay.io/confidential-containers/staged-images/kbs:latest
94-
- name: quay.io/confidential-containers/staged-images/kbs-client:latest
95-
- name: quay.io/confidential-containers/staged-images/attestation-agent:latest
92+
# CoCo/KBS Application Images (for pattern testing)
93+
- name: ghcr.io/butler54/kbs-access-app:latest
9694

9795
# CoCo Images from quay.io
9896
- name: quay.io/confidential-containers/peer-pods-webhook:latest

rhdp-isolated/bastion/mirror.sh

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,24 @@ fi
8181

8282
log_info "oc-mirror found: $(oc-mirror version 2>&1 | head -n1 || echo 'v2')"
8383

84-
# Login to ACR using podman
84+
# Create merged auth file in XDG_RUNTIME_DIR for oc-mirror v2
85+
log_step "Setting up authentication for oc-mirror v2"
86+
87+
# oc-mirror v2 expects auth in standard locations: ${XDG_RUNTIME_DIR}/containers/auth.json
88+
# Create the directory structure
89+
AUTH_DIR="${HOME}/.docker"
90+
mkdir -p "${AUTH_DIR}"
91+
MERGED_AUTH_FILE="${AUTH_DIR}/config.json"
92+
93+
# Start with the Red Hat pull secret
94+
cp "${PULL_SECRET}" "${MERGED_AUTH_FILE}"
95+
96+
# Login to ACR using podman with the merged auth file
8597
log_step "Authenticating to ACR: ${ACR_LOGIN_SERVER}"
86-
echo "${ACR_PASSWORD}" | podman login "${ACR_LOGIN_SERVER}" --username "${ACR_USERNAME}" --password-stdin
98+
echo "${ACR_PASSWORD}" | podman login "${ACR_LOGIN_SERVER}" \
99+
--username "${ACR_USERNAME}" \
100+
--password-stdin \
101+
--authfile="${MERGED_AUTH_FILE}"
87102

88103
if [ $? -eq 0 ]; then
89104
log_info "Successfully authenticated to ACR"
@@ -94,19 +109,21 @@ fi
94109

95110
# Test connectivity
96111
log_info "Testing ACR connectivity..."
97-
if podman search "${ACR_LOGIN_SERVER}/test" --limit 1 &>/dev/null; then
112+
if podman search "${ACR_LOGIN_SERVER}/test" --limit 1 --authfile="${MERGED_AUTH_FILE}" &>/dev/null; then
98113
log_info "ACR is accessible"
99114
else
100115
log_warn "ACR search test returned non-zero, but this may be normal for empty registry"
101116
fi
102117

103118
# Verify Red Hat registry access
104119
log_step "Verifying Red Hat registry access with pull secret"
105-
if ! podman login registry.redhat.io --authfile="${PULL_SECRET}" --get-login &>/dev/null; then
120+
if ! podman login registry.redhat.io --authfile="${MERGED_AUTH_FILE}" --get-login &>/dev/null; then
106121
log_warn "Could not verify registry.redhat.io access"
107122
log_warn "Continuing anyway, oc-mirror will use the pull secret"
108123
fi
109124

125+
log_info "Authentication configured at: ${MERGED_AUTH_FILE}"
126+
110127
# Display disk space
111128
log_info "Available disk space:"
112129
df -h "${MIRROR_WORKSPACE}"
@@ -128,8 +145,9 @@ log_info "Source: Red Hat registries (quay.io, registry.redhat.io)"
128145
log_info "Destination: ${ACR_LOGIN_SERVER}"
129146
log_info "Workspace: ${MIRROR_WORKSPACE}"
130147

131-
# Set registry credentials for oc-mirror
132-
export REGISTRY_AUTH_FILE="${PULL_SECRET}"
148+
# Note: oc-mirror v2 uses standard Docker/Podman auth locations automatically
149+
# We don't set REGISTRY_AUTH_FILE as it causes parsing errors in v2
150+
log_info "oc-mirror will use auth from: ${MERGED_AUTH_FILE}"
133151

134152
# Run oc-mirror with v2 flag
135153
START_TIME=$(date +%s)

rhdp-isolated/configure-bastion.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ export ACR_NAME="${ACR_NAME}"
169169
export ACR_USERNAME="${ACR_USERNAME}"
170170
export ACR_PASSWORD="${ACR_PASSWORD}"
171171
172-
# Ensure local bin is in PATH
173-
export PATH="\${HOME}/.local/bin:\${PATH}"
172+
# Add OpenShift tools from data disk to PATH
173+
export PATH="/var/cache/oc-mirror/bin:\${PATH}"
174174
EOF
175175
)
176176

rhdp-isolated/provision.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ done
4646

4747
log_info "All required environment variables are set"
4848

49+
# Export ARM_ variables for Terraform Azure provider
50+
export ARM_CLIENT_ID="${CLIENT_ID}"
51+
export ARM_CLIENT_SECRET="${PASSWORD}"
52+
export ARM_TENANT_ID="${TENANT}"
53+
export ARM_SUBSCRIPTION_ID="${SUBSCRIPTION}"
54+
55+
log_info "Azure authentication configured for Terraform"
56+
4957
# Check for SSH key
5058
SSH_KEY_PATH="${HOME}/.ssh/id_rsa"
5159
SSH_PUB_KEY_PATH="${HOME}/.ssh/id_rsa.pub"

0 commit comments

Comments
 (0)