Skip to content

Commit

Permalink
set go function executable when download to local (apache#4743)
Browse files Browse the repository at this point in the history
### Motivation

Currently golang function needs to be compiled before deploy to pulsar, so the executable permission is required when function package is downloaded to local node from bookkeeper. This PR is intent to make golang function package executable after download from bookkeeper, to make sure the function is ok to run.
  • Loading branch information
freeznet authored and sijie committed Jul 21, 2019
1 parent 5162393 commit bf58c8e
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,11 @@ private void downloadFile(File pkgFile, boolean isPkgUrlProvided, FunctionMetaDa
} finally {
tempPkgFile.delete();
}

if(details.getRuntime() == Function.FunctionDetails.Runtime.GO && !pkgFile.canExecute()) {
pkgFile.setExecutable(true);
log.info("Golang function package file {} is set to executable", pkgFile);
}
}

private void cleanupFunctionFiles(FunctionRuntimeInfo functionRuntimeInfo) {
Expand Down

0 comments on commit bf58c8e

Please sign in to comment.