diff options
| author | Michal Nasiadka <mnasiadka@gmail.com> | 2026-07-06 15:26:00 +0200 |
|---|---|---|
| committer | Michal Nasiadka <mnasiadka@gmail.com> | 2026-07-06 19:59:40 +0000 |
| commit | db35ac8d793506bc43b62e7e39d27a75de1043ed (patch) | |
| tree | feec28d13a43490f5fd4260374144a1abfc20331 /docker/cron | |
| parent | 1ae1850557e3b99902f73b32c9005618537a1f2d (diff) | |
| download | kolla-db35ac8d793506bc43b62e7e39d27a75de1043ed.tar.gz kolla-db35ac8d793506bc43b62e7e39d27a75de1043ed.zip | |
Migrate to pyproject.toml
[tool.setuptools.data-files] does not support recursive directory
installation. The old setup.cfg [files] worked because PBR's
FilesConfig.expand_globs() used os.walk() to expand docker/*, but
this hook is not triggered by the pbr.build PEP-517 backend.
Move docker/ into kolla/ and use [tool.setuptools.package-data]
instead. Update kolla_worker._get_images_dir() to check the kolla
package directory first so both editable and regular installs work.
Change-Id: I4fc452c03740ef22ebbb4e8d0d86c4f4783e2d09
Signed-off-by: Michal Nasiadka <mnasiadka@gmail.com>
Diffstat (limited to 'docker/cron')
| -rw-r--r-- | docker/cron/Dockerfile.j2 | 35 | ||||
| -rw-r--r-- | docker/cron/extend_start.sh | 21 | ||||
| -rwxr-xr-x | docker/cron/logrotate | 18 |
3 files changed, 0 insertions, 74 deletions
diff --git a/docker/cron/Dockerfile.j2 b/docker/cron/Dockerfile.j2 deleted file mode 100644 index d3a9213ac..000000000 --- a/docker/cron/Dockerfile.j2 +++ /dev/null @@ -1,35 +0,0 @@ -FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }} -{% block labels %} -LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" -{% endblock %} - -{% block cron_header %}{% endblock %} - -{% import "macros.j2" as macros with context %} - -{% if base_package_type == 'rpm' %} - {% set cron_packages = [ - 'cronie', - 'logrotate' - ] %} - -# NOTE(hrw): In RHEL 9 family it is done by systemd timer, we want cron to -# handle it. -COPY logrotate /etc/cron.daily/logrotate - -{% elif base_package_type == 'deb' %} - {% set cron_packages = [ - 'cron', - 'logrotate' - ] %} -{% endif %} - -{{ macros.install_packages(cron_packages | customizable("packages")) }} - -COPY extend_start.sh /usr/local/bin/kolla_extend_start -RUN chmod 644 /usr/local/bin/kolla_extend_start - -{{ macros.kolla_patch_sources() }} - -{% block cron_footer %}{% endblock %} -{% block footer %}{% endblock %} diff --git a/docker/cron/extend_start.sh b/docker/cron/extend_start.sh deleted file mode 100644 index 3476302e1..000000000 --- a/docker/cron/extend_start.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -CRON_LOGROTATE_CURRENT_PATH="$(find /etc/cron* -name logrotate)" -CRON_LOGROTATE_CURRENT_SCHEDULE=$(echo "${CRON_LOGROTATE_CURRENT_PATH}" | sed -r 's/(.*)(hourly|daily|weekly|monthly)(.*)/\2/g') - -if [ -z $CRON_LOGROTATE_CURRENT_PATH ]; then - echo "logrotate is not handled by cron" -else - # Pass only for hourly|daily|weekly|monthly - if [[ "${KOLLA_LOGROTATE_SCHEDULE:-undefined}" =~ hourly|daily|weekly|monthly ]]; then - - CRON_LOGROTATE_DESIRED_PATH="/etc/cron.${KOLLA_LOGROTATE_SCHEDULE}/logrotate" - - if [[ "${CRON_LOGROTATE_CURRENT_PATH}" != "${CRON_LOGROTATE_DESIRED_PATH}" ]]; then - mv ${CRON_LOGROTATE_CURRENT_PATH} ${CRON_LOGROTATE_DESIRED_PATH} - CRON_LOGROTATE_CURRENT_SCHEDULE="${KOLLA_LOGROTATE_SCHEDULE}" - fi - fi - - echo "[i] Cron schedule for logrotate is currently set to: ${CRON_LOGROTATE_CURRENT_SCHEDULE}." -fi diff --git a/docker/cron/logrotate b/docker/cron/logrotate deleted file mode 100755 index 1ac157001..000000000 --- a/docker/cron/logrotate +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -# skip in favour of systemd timer -if [ -d /run/systemd/system ]; then - exit 0 -fi - -# this cronjob persists removals (but not purges) -if [ ! -x /usr/sbin/logrotate ]; then - exit 0 -fi - -/usr/sbin/logrotate /etc/logrotate.conf -EXITVALUE=$? -if [ $EXITVALUE != 0 ]; then - /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]" -fi -exit $EXITVALUE |
