heat: generate config for heat.conf - #137
Conversation
For the heat-engine image, heat-manage db_sync requires the default heat.conf, otherwise it fails with the error: ERROR: No 'script_location' key found in configuration during heat db sync which comes from alembic. For the heat-api iamge, the keystone certificate can't be verified without the default heat.conf in place. Signed-off-by: James Slagle <jslagle@redhat.com>
|
Are we sure it's not some packaging issue, as I'm pretty convinced we don't need default heat.conf?
That key is in the package bundled ini https://github.com/openstack/heat/blob/master/heat/db/alembic.ini#L3 and it's looked from there https://github.com/openstack/heat/blob/master/heat/db/migration.py#L59-L62 not from heat.conf AFAIK. Also db_sync runs with explicit --config-dir https://github.com/openstack-k8s-operators/heat-operator/blob/main/internal/heat/dbsync.go#L32, so there won't be any need for default heat.conf.
heat-api can always read configuration from heat.conf.d https://github.com/openstack/heat/blob/81fc6092fee459fbfe659f2b8f70dcc0c4ba09b9/heat/api/openstack/wsgi.py#L4. Default generated heat.conf would not have any certificates etc. Do you've the built images somewhere that I can check? |
|
I did build the images from s2i main and the deployed with openstack-k8s-operators/openstack-operator#2042 and did not see any issues. Am I missing something? Note: I tagged heat-api image as heat-api-cfn after build though it was not required |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fmount The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
I had the same issue with glance and I ended up doing #155 to create the required files that were present in the old RPM spec. This allows to not introduce changes in the operator and keep within s2i what was expected in the tcib context. |
dd8aa5b
into
openstack-k8s-operators:main
I don't think what has been mentioned in the linked PR is correct i.e Also, would it be fair to ask for leaving for teams that own the components to decide whether they need it or not? [1] https://github.com/openstack/glance/blob/master/glance/common/wsgi_app.py#L116 |
|
Apologies, I'll revert this. I should have closed it once the actual issues were identified, which were specific to the downstream builds. |
@rabi apologies as well. I think the glance error was different from the issue you saw in heat, I might have waited more before landing. and only after generating that file we passed that point and we were able to see the configured backend defined under /etc/glance/glance.conf.d. |
The issue is that glance is passing default_config_files=config_files to https://github.com/openstack/glance/blame/master/glance/common/wsgi_app.py#L116 instead of relying on native auto-discovery. Because glance explicitly requests these files, oslo.config enforces that they must exist, throwing ConfigFilesNotFoundError if they don't. There is a hack in https://github.com/openstack/glance/blame/master/glance/common/wsgi_app.py#L49-L50 that manually searches for ['glance-image-import.conf', 'glance-api.conf'] in /etc/glance. This manual search is only necessary because oslo.config auto-discovery won't automatically pick up glance-image-import.conf if it's placed directly in /etc/glance. However, if glance-image-import.conf is placed inside glance.conf.d (or if its contents are merged into the main config), oslo.config will automatically pick it up. We actually already merged the import configs Therefore, the upstream code needs to be patched. Instead of dropping the manual search entirely (which would break backward compatibility for non-rhoso deployments still relying on The upstream fix in glance/common/wsgi_app.py would look like this: def _get_config_files(env=None):
if env is None:
env = os.environ
dirname = env.get('OS_GLANCE_CONFIG_DIR', '/etc/glance').strip()
config_files = []
for config_file in CONFIG_FILES:
cfg_file = os.path.join(dirname, config_file)
if os.path.exists(cfg_file):
config_files.append(cfg_file)
return config_files
```" |
For the heat-engine image, heat-manage db_sync requires the default
heat.conf, otherwise it fails with the error: ERROR: No
'script_location' key found in configuration during heat db sync which
comes from alembic.
For the heat-api iamge, the keystone certificate can't be verified
without the default heat.conf in place.
Signed-off-by: James Slagle jslagle@redhat.com