Skip to content

Add default('') to discovered image vars - #3799

Merged
openshift-merge-bot[bot] merged 1 commit into
openstack-k8s-operators:mainfrom
fultonj:fix/va-hci-image-defaults
Apr 30, 2026
Merged

openshift-merge-bot[bot] merged 1 commit into
openstack-k8s-operators:mainfrom
fultonj:fix/va-hci-image-defaults

Conversation

@fultonj

@fultonj fultonj commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

cifmw_discovered_image_url and cifmw_discovered_hash are set dynamically by the discover_latest_image role. When networking_mapper serializes hostvars early in the play, these variables are not yet defined, causing a fatal undefined variable error. Add | default('') so serialization succeeds; the real values are populated later when discover_latest_image runs.

Assisted-By: Claude Sonnet 4.6 noreply@anthropic.com

@fultonj

fultonj commented Mar 25, 2026

Copy link
Copy Markdown
Contributor Author

My deployment fails without this patch when I use the following ansible:

$ ansible --version
ansible [core 2.20.3]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/johfulto/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/johfulto/test-python/lib64/python3.14/site-packages/ansible
  ansible collection location = /home/johfulto/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/johfulto/test-python/bin/ansible
  python version = 3.14.3 (main, Feb  4 2026, 00:00:00) [GCC 15.2.1 20260123 (Red Hat 15.2.1-7)] (/home/johfulto/test-python/bin/python3)
  jinja version = 3.1.6
  pyyaml version = 6.0.3 (with libyaml v0.2.5)

@fultonj
fultonj force-pushed the fix/va-hci-image-defaults branch from e5dc773 to e1d015e Compare March 25, 2026 13:56
@softwarefactory-project-zuul

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/4eef9e51d577495f8c7e676d45ac837e

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 22m 04s
❌ podified-multinode-edpm-deployment-crc RETRY_LIMIT in 5m 26s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 20m 45s
✔️ cifmw-crc-podified-edpm-baremetal-minor-update SUCCESS in 2h 08m 13s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 9m 37s
✔️ cifmw-pod-pre-commit SUCCESS in 10m 40s

cifmw_discovered_image_url and cifmw_discovered_hash are set
dynamically by the discover_latest_image role. When networking_mapper
serializes hostvars early in the play, these variables are not yet
defined, causing a fatal undefined variable error. Add | default('')
so serialization succeeds; the real values are populated later when
discover_latest_image runs.

Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: John Fulton <fulton@redhat.com>
@fultonj
fultonj force-pushed the fix/va-hci-image-defaults branch from e1d015e to 2b92105 Compare March 30, 2026 18:45
@softwarefactory-project-zuul

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/ee78a6df760b438eb4c9869b1cfbb895

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 48m 30s
❌ podified-multinode-edpm-deployment-crc FAILURE in 1h 35m 41s
❌ cifmw-crc-podified-edpm-baremetal FAILURE in 1h 32m 00s
❌ cifmw-crc-podified-edpm-baremetal-minor-update FAILURE in 1h 35m 36s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 9m 20s
✔️ cifmw-pod-pre-commit SUCCESS in 8m 28s

@fultonj

fultonj commented Mar 31, 2026

Copy link
Copy Markdown
Contributor Author

recheck

@softwarefactory-project-zuul

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/ff13b2f73827423b8f1c0fef81073028

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 50m 23s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 30m 29s
❌ cifmw-crc-podified-edpm-baremetal FAILURE in 35m 21s
❌ cifmw-crc-podified-edpm-baremetal-minor-update FAILURE in 43m 24s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 9m 39s
✔️ cifmw-pod-pre-commit SUCCESS in 8m 40s

@fultonj

fultonj commented Apr 3, 2026

Copy link
Copy Markdown
Contributor Author

recheck

@michburk michburk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the motivation for the changes and they lgtm, but is there a reason to only apply these changes to va-hci.yml? If this is an issue for other scenarios, we should consider a more widespread fix.

@fultonj

fultonj commented Apr 10, 2026

Copy link
Copy Markdown
Contributor Author

recheck

@github-actions

Copy link
Copy Markdown

This PR is stale because it has been for over 15 days with no activity.
Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions Bot added the Stale label Apr 26, 2026
@fultonj

fultonj commented Apr 27, 2026

Copy link
Copy Markdown
Contributor Author

I understand the motivation for the changes and they lgtm, but is there a reason to only apply these changes to va-hci.yml? If this is an issue for other scenarios, we should consider a more widespread fix.

I was trying to reproduce va-hci.yml in my environment and encountered the problem this patch fixes.

I didn't try to fix it for other scenarios because I was not testing them.

@fultonj fultonj removed the Stale label Apr 27, 2026
@evallesp

Copy link
Copy Markdown
Contributor

cifmw_discovered_image_url and cifmw_discovered_hash are set dynamically by the discover_latest_image role. When networking_mapper serializes hostvars early in the play, these variables are not yet defined, causing a fatal undefined variable error. Add | default('') so serialization succeeds; the real values are populated later when discover_latest_image runs.

Created: https://redhat.atlassian.net/browse/OSPCIFMW-105
Let's merge this as it-is now.

@evallesp evallesp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@openshift-ci

openshift-ci Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: evallesp

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot
openshift-merge-bot Bot merged commit cb17c52 into openstack-k8s-operators:main Apr 30, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants