jerrypeng commented on a change in pull request #8098:
URL: https://github.com/apache/pulsar/pull/8098#discussion_r493209515



##########
File path: 
pulsar-functions/secrets/src/main/java/org/apache/pulsar/functions/secretsproviderconfigurator/NameAndConfigBasedSecretsProviderConfigurator.java
##########
@@ -0,0 +1,66 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pulsar.functions.secretsproviderconfigurator;
+
+import com.google.gson.reflect.TypeToken;
+import io.kubernetes.client.openapi.models.V1PodSpec;
+import org.apache.pulsar.functions.proto.Function;
+
+import java.lang.reflect.Type;
+import java.util.Map;
+
+/**
+ * This is a very simple secrets provider which wires in a given secrets 
provider classname/config
+ * to the function instances/containers. This does not do any special 
kubernetes specific wiring.

Review comment:
       nit not sure why we mention kubernetes here in the comment.  
SecretsProviderConfigurator are not kubernetes specific

##########
File path: 
pulsar-functions/secrets/src/main/java/org/apache/pulsar/functions/secretsproviderconfigurator/NameAndConfigBasedSecretsProviderConfigurator.java
##########
@@ -0,0 +1,66 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pulsar.functions.secretsproviderconfigurator;
+
+import com.google.gson.reflect.TypeToken;
+import io.kubernetes.client.openapi.models.V1PodSpec;
+import org.apache.pulsar.functions.proto.Function;
+
+import java.lang.reflect.Type;
+import java.util.Map;
+
+/**
+ * This is a very simple secrets provider which wires in a given secrets 
provider classname/config
+ * to the function instances/containers. This does not do any special 
kubernetes specific wiring.
+ */
+public class NameAndConfigBasedSecretsProviderConfigurator implements 
SecretsProviderConfigurator {
+    private String className;
+    private Map<String, String> config;
+    public NameAndConfigBasedSecretsProviderConfigurator(String className, 
Map<String, String> config) {
+        this.className = className;
+        this.config = config;
+    }
+    @Override
+    public String getSecretsProviderClassName(Function.FunctionDetails 
functionDetails) {
+        return className;
+    }
+
+    @Override
+    public Map<String, String> 
getSecretsProviderConfig(Function.FunctionDetails functionDetails) {
+        return config;
+    }
+
+    // Kubernetes secrets can be exposed as volume mounts or as environment 
variables in the pods. We are currently using the

Review comment:
       nit remove this comment




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


Reply via email to