Skip to content

Commit 8b1da0c

Browse files
Merge pull request #93 from openstack-k8s-operators/fix/bootc-statusType-check
Fix: bootc.fact returning nil after using rpm-ostree
2 parents 69dd4e1 + 76dc034 commit 8b1da0c

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

bootc/ansible-facts/bootc.fact

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ is_bootc() {
1414
BOOTC_STATUS=$(sudo bootc status --json | jq .status.type)
1515
if [[ "$BOOTC_STATUS" == \"bootcHost\" ]]; then
1616
BOOTC_SYSTEM="true"
17+
return
18+
fi
19+
20+
# Fallback: if bootc status type is set to nil for some reasons like
21+
# rpm-ostree install, or bootc is not able to confirm that the system is
22+
# not bootc anymore
23+
# NOTE: rpm-ostree install should not be allowed in production systems.
24+
if [[ -d /sysroot/ostree/bootc ]] || [[ -d /ostree/bootc ]]; then
25+
BOOTC_SYSTEM="true"
1726
fi
1827
}
1928

0 commit comments

Comments
 (0)