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/02 22:28:39 UTC

[GitHub] [pulsar] flowchartsman commented on a change in pull request #8780: Fix single-quotes added to user-conf

flowchartsman commented on a change in pull request #8780:
URL: https://github.com/apache/pulsar/pull/8780#discussion_r534524426



##########
File path: pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/RuntimeUtils.java
##########
@@ -224,11 +226,13 @@
         ObjectMapper objectMapper = ObjectMapperFactory.getThreadLocal();
         String configContent = objectMapper.writeValueAsString(goInstanceConfig);
 
-        // Nit: at present, the implementation of go function depends on pulsar-client-go,
-        // pulsar-client-go uses cgo, so the currently uploaded executable doesn't support cross-compilation.
         args.add(originalCodeFileName);
         args.add("-instance-conf");
-        args.add("'" + configContent + "'");
+        if (k8sRuntime) {

Review comment:
       > Still, we have to be sure that a string like --user-config='{"foo": "bar"}' is propagated correctly when wrapped into single quotes.
   
   Why? As far as I understand it, `--user-config` must be JSON. Strings that begin with single quotes are invalid JSON, full stop. If you specify this on the command line, your shell will take care of this, and if you put it in that value on purpose, then your function will fail and it is your fault.




----------------------------------------------------------------
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