File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
bash/artifacts/opt/jboss/container/java/s2i Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,12 @@ function maven_s2i_custom_binary_build() {
28
28
binary_dir="${S2I_SOURCE_DIR}"
29
29
fi
30
30
log_info "Copying binaries from ${binary_dir} to ${S2I_TARGET_DEPLOYMENTS_DIR} ..."
31
- rsync --archive --out-format='%n' "${binary_dir}"/ "${S2I_TARGET_DEPLOYMENTS_DIR}"
31
+
32
+ ( # OPENJDK-2850: use glob (dotglob to match hidden files) to stop rsync altering
33
+ # timestamps of S2I_TARGET_DEPLOYMENTS_DIR. Don't alter parent shell's dotglob.
34
+ shopt -s dotglob
35
+ rsync --archive --out-format='%n' "${binary_dir}"/* "${S2I_TARGET_DEPLOYMENTS_DIR}"
36
+ )
32
37
}
33
38
34
39
function maven_s2i_deploy_artifacts_override() {
Original file line number Diff line number Diff line change @@ -7,3 +7,14 @@ Feature: Openshift S2I tests
7
7
Scenario : run an s2i build and check that /tmp/src has been removed afterwards
8
8
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from spring-boot-sample-simple
9
9
Then run stat /tmp/src in container and immediately check its output does not contain File:
10
+
11
+ # OPENJDK-2824 - ensure binary-only s2i doesn't try to change timestamps of
12
+ # S2I_TARGET_DEPLOYMENTS_DIR. Use /var/tmp as a directory where attempting to
13
+ # will fail. This simulates the s2i process running as a random UID, which can't
14
+ # change timestamps on the default directory, /deployments.
15
+ Scenario : Ensure binary-only build doesn't fail trying to set timestamp of S2I_TARGET_DEPLOYMENTS_DIR (OPENJDK-2850)
16
+ Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from OPENJDK-2408-bin-custom-s2i-assemble with env
17
+ | variable | value |
18
+ | S2I_TARGET_DEPLOYMENTS_DIR | /var /tmp |
19
+ Then s2i build log should not contain rsync: [generator] failed to set permissions on "/var/tmp/." : Operation not permitted
20
+ And run stat /var/tmp/spring-boot-sample-simple-1.5.0.BUILD-SNAPSHOT.jar in container and check its output for Access:
You can’t perform that action at this time.
0 commit comments