Skip to content

Commit

Permalink
osd: remove excess if-else for keyring file import in activate script
Browse files Browse the repository at this point in the history
Remove unnecessary if-else statement inside "if keyring file exists"
condition of osd activate script.

Resolves: rook#14825
Signed-off-by: Peter Razumovsky <[email protected]>
  • Loading branch information
prazumovsky committed Nov 12, 2024
1 parent 6eb2d11 commit 62ffcd4
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions pkg/operator/ceph/cluster/osd/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,9 @@ config['osd.$OSD_ID'] = {'key': config['osd.$OSD_ID']['key'], 'caps mon': '\"all
with open('$TMP_DIR/keyring', 'w') as configfile:
config.write(configfile)
"
if [ -f "$TMP_DIR"/keyring ]; then
cat "$TMP_DIR"/keyring
ceph -n client.admin auth import -i "$TMP_DIR"/keyring -k /etc/ceph/admin-keyring-store/keyring
else
# create new keyring if no keyring file found
ceph -n client.admin auth get-or-create osd."$OSD_ID" mon 'allow profile osd' mgr 'allow profile osd' osd 'allow *' -k /etc/ceph/admin-keyring-store/keyring
fi
cat "$TMP_DIR"/keyring
ceph -n client.admin auth import -i "$TMP_DIR"/keyring -k /etc/ceph/admin-keyring-store/keyring
rm --recursive --force "$TMP_DIR"
else
Expand Down

0 comments on commit 62ffcd4

Please sign in to comment.