'admin' client name is hardcoded

Bug #1975826 reported by Przemyslaw Hausman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
charms.ceph
Triaged
Low
Unassigned

Bug Description

'admin' client name is hardcoded here (`svc = 'admin'`):
https://opendev.org/openstack/charms.ceph/src/branch/master/charms_ceph/broker.py#L852

This creates a problem when a ceph charm (e.g. ceph-radosgw) is related with ceph-proxy (instead of ceph-mon) and ceph-proxy charm is configured with `admin-user` different than 'client.admin'.

As a result, ceph commands run on ceph-proxy unit fail, because ceph-proxy is using different client than 'admin', e.g. 'my-ceph-proxy-admin'. See example error message from ceph-proxy:

unit-ceph-proxy-1: 12:27:47 ERROR unit.ceph-proxy/1.juju-log radosgw:9: Command '['ceph', '--id', 'admin', 'config-key', 'put', 'cephx.groups.objects', '{"pools": ["demo-15658.rgw.buckets.data"], "services": []}']' returned non-zero exit status 1.

Steps to reproduce:

```
# Deploy ceph-radosgw and ceph-proxy
juju deploy ceph-radosgw \
  --config source='cloud:focal-yoga' --channel quincy/edge
juju deploy ceph-proxy \
  --config source='cloud:focal-yoga' --channel quincy/edge

# Configure ceph-proxy with custom admin-user
juju config ceph-proxy \
  fsid=4d6ef0f6-dc23-11ec-a706-294ff47d2a61 \
  admin-user=client.my-ceph-proxy-admin \
  admin-key='AQD/J49ifTrqJBAAe5vxsTxWcedzKrRZPnMyhw==' \
  monitor-hosts="172.27.80.175:6789"

# Relate ceph-radosgw and ceph-proxy
juju add-relation ceph-proxy:radosgw ceph-radosgw:mon
```

ceph-radosgw unit will be stuck in blocked workload state with message "Services not running that should be: <email address hidden>". And in the debug-log for ceph-proxy unit you'll see the error message mentioned earlier.

Changed in charms.ceph:
status: New → Triaged
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.