Bug 1868439
| Summary: | openstack UPI: scripts fail modifying the masters Ignition file | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Pierre Prinetti <pprinett> |
| Component: | Installer | Assignee: | Pierre Prinetti <pprinett> |
| Installer sub component: | OpenShift on OpenStack | QA Contact: | weiwei jiang <wjiang> |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | medium | ||
| Priority: | medium | CC: | jmalde, mbridges, mvardhan, rheinzma, wjiang |
| Version: | 4.6 | Keywords: | UpcomingSprint |
| Target Milestone: | --- | ||
| Target Release: | 4.6.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: |
Cause: A change in how Ignition files are generated in 4.6 removed an empty property from Ignition files.
Consequence: A Python 'KeyError' when running the steaps documented in UPI
Fix: The documentation is updated to create the missing key.
Result: The error is not happening any more.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2020-10-27 16:28:06 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
*** Bug 1876835 has been marked as a duplicate of this bug. *** Verified
$ python -c "import base64, json, sys;
ignition = json.load(sys.stdin);
storage = ignition.get('storage', {});
files = storage.get('files', []);
files.append({'path': '/etc/hostname', 'mode': 420, 'contents': {'source': 'data:text/plain;charset=utf-8;base64,' + base64.standard_b64encode(b'$MASTER_HOSTNAME').decode().strip()}});
storage['files'] = files;
ignition['storage'] = storage
json.dump(ignition, sys.stdout)" <master.ign
{"ignition": {"config": {"merge": [{"source": "https://192.168.0.5:22623/config/master"}]}, "security": {"tls": {"certificateAuthorities": [{"source": "data:text/plain;charset=utf-8;base64,xxxxxxxxx"}]}}, "version": "3.1.0"}, "storage": {"files": [{"path": "/etc/hostname", "mode": 420, "contents": {"source": "data:text/plain;charset=utf-8;base64,"}}]}}
@wjiang Can you verify this downstream, too? https://github.com/openshift/openshift-docs/pull/25605 *** Bug 1876843 has been marked as a duplicate of this bug. *** Moving to QE again, as this needs to be verified in the downstream docs, too. https://github.com/openshift/openshift-docs/pull/25605 The Doc look good from the QE perspective, so move to verified. Change merged into 4.6 release + master branches. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (OpenShift Container Platform 4.6 GA Images), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:4196 |
Description of problem: While applying this script: ``` python -c "import base64, json, sys; python -c "import base64, json, sys; ignition = json.load(sys.stdin); ignition = json.load(sys.stdin); files = ignition['storage'].get('files', []); storage = ignition.get('storage', {}); files.append({'path': '/etc/hostname', 'mode': 420, 'contents': {'source': 'data:text/plain;charset=utf-8;base64,' + base64.standard_b64encode(b'$MASTER_HOSTNAME').decode().strip()}}); files = storage.get('files', []); ignition['storage']['files'] = files; files.append({'path': '/etc/hostname', 'mode': 420, 'contents': {'source': 'data:text/plain;charset=utf-8;base64,' + base64.standard_b64encode(b'$MASTER_HOSTNAME').decode().strip(), 'verification': {}}, 'filesystem': 'root'}); storage['files'] = files; ignition['storage'] = storage json.dump(ignition, sys.stdout)" <master.ign ``` Python fails with: ``` Traceback (most recent call last): File "<string>", line 3, in <module> KeyError: 'storage' ``` The 'storage' property does not seem to be present any more in the master ignition file.