Skip to content

Commit

Permalink
🐛SQLite: fix Ironic container restarting issue
Browse files Browse the repository at this point in the history
In case of SQLite implementation Ironic container fails to restart.
create_schema will be called only when required.

fix #562

Signed-off-by: LALLAU Bertrand <blallau@github.com>
  • Loading branch information
LALLAU Bertrand authored and metal3-io-bot committed Sep 20, 2024
1 parent b2f3765 commit c31d51f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/ironic-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,11 @@ run_ironic_dbsync()
done
else
# SQLite does not support some statements. Fortunately, we can just create
# the schema in one go instead of going through an upgrade.
ironic-dbsync --config-file /etc/ironic/ironic.conf create_schema
# the schema in one go if not already created, instead of going through an upgrade
DB_VERSION="$(ironic-dbsync --config-file /etc/ironic/ironic.conf version)"
if [[ "${DB_VERSION}" == "None" ]]; then
ironic-dbsync --config-file /etc/ironic/ironic.conf create_schema
fi
fi
}

Expand Down

0 comments on commit c31d51f

Please sign in to comment.