HyukjinKwon commented on a change in pull request #30735:
URL: https://github.com/apache/spark/pull/30735#discussion_r542922506



##########
File path: 
resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/Utils.scala
##########
@@ -153,22 +153,27 @@ object Utils extends Logging {
   }
 
   def createTarGzFile(inFile: String, outFile: String): Unit = {
+    val oFile = new File(outFile)
     val fileToTarGz = new File(inFile)
     Utils.tryWithResource(
       new FileInputStream(fileToTarGz)
     ) { fis =>
       Utils.tryWithResource(
         new TarArchiveOutputStream(
           new GzipCompressorOutputStream(
-            new FileOutputStream(
-              new File(outFile))))
+            new FileOutputStream(oFile)))
       ) { tOut =>
         val tarEntry = new TarArchiveEntry(fileToTarGz, fileToTarGz.getName)
+        // Each entry does not keep the file permission from the input file.
+        // Setting permissions in the input file do not work. Just simply set
+        // to 777.
+        tarEntry.setMode(0x81ff)

Review comment:
       Its slightly orthogonal but related to the current PR. The custom python 
in the tests should have executable permission and tgz should keep the 
permission. Without this change, the test fails because it loses executable 
permission and cannot be used as a python alone later. FWIW this util is for 
test-only, and this PR adds the first case in the test where it needs to keep 
the file permissions.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to