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