lucperkins commented on a change in pull request #1528: Fix for FQFN flag
URL: https://github.com/apache/incubator-pulsar/pull/1528#discussion_r180251671
 
 

 ##########
 File path: 
pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java
 ##########
 @@ -117,9 +115,31 @@ void processArguments() throws Exception {}
      * Function level command
      */
     @Getter
-    abstract class FunctionCommand extends NamespaceCommand {
-        @Parameter(names = "--name", description = "The function's name", 
required = true)
+    abstract class FunctionCommand extends BaseCommand {
+        @Parameter(names = "--fqfn", description = "The Fully Qualified 
Function Name (FQFN) for the function")
+        protected String fqfn;
+
+        @Parameter(names = "--tenant", description = "The function's tenant")
+        protected String tenant;
+
+        @Parameter(names = "--namespace", description = "The function's 
namespace")
+        protected String namespace;
+
+        @Parameter(names = "--name", description = "The function's name")
         protected String functionName;
+
+        @Override
+        void processArguments() throws Exception {
+            if (null != fqfn) {
+                String[] fqfnArray = fqfn.split("/");
+                if (fqfnArray.length != 3) {
+                    throw new IllegalArgumentException("Fully qualified 
function names (FQFNs) must be of the form tenant/namespace/name");
+                }
+                tenant = fqfnArray[0];
 
 Review comment:
   Well, in this case you can *either* set a FQFN *or* tenant + namespace + 
name. So I think that I'll change this to make sure users don't attempt to 
apply both systems.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to