You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/12/29 01:01:55 UTC

[GitHub] [pulsar] zymap commented on a change in pull request #8973: Make function supports to use package command

zymap commented on a change in pull request #8973:
URL: https://github.com/apache/pulsar/pull/8973#discussion_r549532388



##########
File path: pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/kubernetes/KubernetesRuntime.java
##########
@@ -868,6 +876,39 @@ public void deleteService() throws InterruptedException {
                 userCodeFilePath);
     }
 
+    private List<String> getPackageDownloadCommand(String packageName, String userCodeFilePath) {
+        // add auth plugin and parameters if necessary
+        if (authenticationEnabled && authConfig != null) {
+            if (isNotBlank(authConfig.getClientAuthenticationPlugin())
+                && isNotBlank(authConfig.getClientAuthenticationParameters())
+                && instanceConfig.getFunctionAuthenticationSpec() != null) {
+                return Arrays.asList(
+                    pulsarRootDir + configAdminCLI,
+                    "--auth-plugin",
+                    authConfig.getClientAuthenticationPlugin(),
+                    "--auth-params",
+                    authConfig.getClientAuthenticationParameters(),
+                    "--admin-url",
+                    pulsarAdminUrl,
+                    "packages",
+                    "download",
+                    packageName,
+                    "--path",
+                    userCodeFilePath);
+            }
+        }
+
+        return Arrays.asList(

Review comment:
       Yes. We need. Already add auth plugin at line 879.




----------------------------------------------------------------
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:
users@infra.apache.org