From 9589e54047716e8ee1b727c27202386141de7c88 Mon Sep 17 00:00:00 2001 From: Jonathan Dowland Date: Tue, 7 Nov 2023 13:58:47 +0000 Subject: [PATCH] [OPENJDK-2427] s2i: use --archive flag for rsync Switch from '-rl' to '--archive' which attempts to preserve as much metadata from the source files as possible, including timestamps, the motivation behind OPENJDK-2427. https://issues.redhat.com/browse/OPENJDK-2427 Signed-off-by: Jonathan Dowland --- .../opt/jboss/container/java/s2i/maven-s2i-overrides | 2 +- .../core/bash/artifacts/opt/jboss/container/s2i/core/s2i-core | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/s2i/bash/artifacts/opt/jboss/container/java/s2i/maven-s2i-overrides b/modules/s2i/bash/artifacts/opt/jboss/container/java/s2i/maven-s2i-overrides index 136cdfbc..74c4147f 100644 --- a/modules/s2i/bash/artifacts/opt/jboss/container/java/s2i/maven-s2i-overrides +++ b/modules/s2i/bash/artifacts/opt/jboss/container/java/s2i/maven-s2i-overrides @@ -28,7 +28,7 @@ function maven_s2i_custom_binary_build() { binary_dir="${S2I_SOURCE_DIR}" fi log_info "Copying binaries from ${binary_dir} to ${S2I_TARGET_DEPLOYMENTS_DIR} ..." - rsync -rl --out-format='%n' "${binary_dir}"/ "${S2I_TARGET_DEPLOYMENTS_DIR}" + rsync --archive --out-format='%n' "${binary_dir}"/ "${S2I_TARGET_DEPLOYMENTS_DIR}" } function maven_s2i_deploy_artifacts_override() { diff --git a/modules/s2i/core/bash/artifacts/opt/jboss/container/s2i/core/s2i-core b/modules/s2i/core/bash/artifacts/opt/jboss/container/s2i/core/s2i-core index 962fb3f8..e9bb651f 100644 --- a/modules/s2i/core/bash/artifacts/opt/jboss/container/s2i/core/s2i-core +++ b/modules/s2i/core/bash/artifacts/opt/jboss/container/s2i/core/s2i-core @@ -64,7 +64,7 @@ function s2i_core_copy_configuration() { mkdir -pm 775 "${S2I_TARGET_CONFIGURATION_DIR}" fi log_info "Copying configuration from $(realpath --relative-to ${S2I_SOURCE_DIR} ${1}/${S2I_SOURCE_CONFIGURATION_DIR}) to ${S2I_TARGET_CONFIGURATION_DIR}..." - rsync -rl --out-format='%n' "${1}/${S2I_SOURCE_CONFIGURATION_DIR}"/ "${S2I_TARGET_CONFIGURATION_DIR}" + rsync --archive --out-format='%n' "${1}/${S2I_SOURCE_CONFIGURATION_DIR}"/ "${S2I_TARGET_CONFIGURATION_DIR}" fi fi } @@ -81,7 +81,7 @@ function s2i_core_copy_data() { mkdir -pm 775 "${S2I_TARGET_DATA_DIR}" fi log_info "Copying app data from $(realpath --relative-to ${S2I_SOURCE_DIR} ${1}/${S2I_SOURCE_DATA_DIR}) to ${S2I_TARGET_DATA_DIR}..." - rsync -rl --out-format='%n' "${1}/${S2I_SOURCE_DATA_DIR}"/ "${S2I_TARGET_DATA_DIR}" + rsync --archive --out-format='%n' "${1}/${S2I_SOURCE_DATA_DIR}"/ "${S2I_TARGET_DATA_DIR}" # s2i used to be more forgiving, but the build will fail if this call # fails. emit a warning and allow the build to succeed chmod -R g+rwX "${S2I_TARGET_DATA_DIR}" || log_warning "Errors occurred while adding read/write permissions to S2I_TARGET_DATA_DIR ($S2I_TARGET_DATA_DIR)."