Skip to content

[GPTEINFRA-16720] Fix showroom failure on no-bastion labs (DevSpaces, OCP Virt)#157

Merged
treddy08 merged 2 commits into
mainfrom
GPTEINFRA-16720-showroom-no-bastion-fix
Jun 28, 2026
Merged

[GPTEINFRA-16720] Fix showroom failure on no-bastion labs (DevSpaces, OCP Virt)#157
treddy08 merged 2 commits into
mainfrom
GPTEINFRA-16720-showroom-no-bastion-fix

Conversation

@prakhar1985

Copy link
Copy Markdown
Contributor

Problem

Labs without a bastion (LB2236 Ansible Dev Tools DevSpaces, LB2391 Modernize OCP Virt) fail with:

'dict object' has no attribute 'bastion_public_hostname'

Root Cause

The bridge role's set_fact: _showroom_user_data: {} reset wipes the showroom role's vars/main.yml default (bastion_public_hostname: 'test_hostname'). set_fact has higher precedence than role vars — once reset to {}, the default is gone. Labs WITH a bastion work because provision-user-data.yaml supplies the value. Labs WITHOUT a bastion crash when the helm chart values are rendered.

Fix

Strip only the users key instead of full reset. Three guards per council + external model review:

  • _showroom_user_data is defined — safe skip on first iteration
  • _showroom_user_data is mapping — guard against non-dict edge case
  • _showroom_user_data.users is defined — only strip when fact is dirty

Preserves bastion_public_hostname and all other role defaults while preventing multi-user mode trigger.

Validated

  • LB2863 (with bastion): multi-user fix confirmed working
  • LB2236/LB2391 (no bastion): fix for regression from {} reset

Jira: GPTEINFRA-16720

andrew-jones
andrew-jones previously approved these changes Jun 28, 2026
prakhar added 2 commits June 28, 2026 18:08
…ulti-user mode trigger

The agnosticd.core.agnosticd_user_data lookup in the showroom role's
prepare_variables.yaml reads provision-user-data.yaml, not user-info.yaml.
If user1's Phase 1 writes users.user1 into that file, user2's showroom
role sees _showroom_user_data.users defined and enters multi-user mode,
creating namespace user2-showroom-user1 instead of user2-showroom.

Two-part fix:
1. Strip the users key from provision-user-data.yaml before each user's
   Phase 1 — preserves global keys (cluster credentials) but removes
   per-user entries so the showroom lookup stays in single-user mode.
2. Reset _showroom_user_data: {} fact before Phase 1 — set_fact persists
   across include_role calls in the same play, so combine() in
   prepare_variables.yaml merges onto dirty in-memory data even if the
   file is clean. The fact reset ensures a clean slate per iteration.

Also scopes user-info.yaml (display messages) and strips Phase 1 msgs
from merge-back to prevent duplicate portal messages.

Validated in LB2863 combined CI test order.
Jira: GPTEINFRA-16720
…ot full reset

Resetting _showroom_user_data to {} wiped the showroom role vars/main.yml
default (bastion_public_hostname: 'test_hostname'), breaking labs with no
bastion (LB2236 Ansible Dev Tools DevSpaces, LB2391 Modernize OCP Virt).

Labs WITH a bastion still work because provision-user-data.yaml has the value.
Labs WITHOUT a bastion depended on the role default — wiped by our {} reset.

Strip only the users key instead using dict2items|rejectattr|items2dict.
Guards:
  - _showroom_user_data is defined   (skip on first user iteration)
  - _showroom_user_data is mapping   (guard against non-dict type edge case)
  - _showroom_user_data.users is defined  (only strip when actually dirty)

This preserves bastion_public_hostname and all other role defaults while
still preventing multi-user mode trigger on subsequent user iterations.
@prakhar1985 prakhar1985 force-pushed the GPTEINFRA-16720-showroom-no-bastion-fix branch from f5fc7c8 to 5546759 Compare June 28, 2026 08:09
@treddy08 treddy08 merged commit d4582bc into main Jun 28, 2026
1 check passed
@treddy08 treddy08 deleted the GPTEINFRA-16720-showroom-no-bastion-fix branch June 28, 2026 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants