addisonj commented on a change in pull request #5400: [functions] Allow 
functions to pass runtime specific options

 File path: 
 @@ -361,8 +376,26 @@ void 
validateMinResourcesRequired(Function.FunctionDetails functionDetails) {
+    KubernetesManifestCustomizer 
buildManifestCustomizer(Function.FunctionDetails funcDetails) {
+        KubernetesManifestCustomizer manifestCustomizer;
+        if (!isEmpty(manifestCustomizerClassName)) {
+            manifestCustomizer = (KubernetesManifestCustomizer) 
+        } else {
+            manifestCustomizer = new NoOpKubernetesManifestCustomizer();
+        }
+        manifestCustomizer.init(funcDetails, manifestCustomizerStaticConfig);
+        return manifestCustomizer;
+    }
-    public Optional<FunctionAuthProvider> getAuthProvider() {
-        return Optional.ofNullable(authProvider.orElse(null));
+    public Optional<FunctionAuthProvider> 
getAuthProvider(Function.FunctionDetails funcDetails) {
 Review comment:
   Yeah, so the problem is (or come up with an alternative) the issues is that 
we either:
   1. The `KubernetesFunctionAuthProvider` won't know the right namespace to 
create the secret in. Since secrets are per namespace, that will break for any 
functions that override the namespace they want to run in. Or
   2. We could call change the `KubernetesFunctionAuthProvider` such that it 
gets the namespace via some other means (instead of the initialize method, 
obviously, we don't want to have the initialize method called multiple times as 
that would be very strange for custom implementations). Looking at the API, I 
don't see any clean way to add the namespace into the `cacheAuthData` call of 
the FunctionAuthProvider. I spent a fair amount of time considering 
alternatives, but this seemed like the cleanest approach to simple delay the 
invocation of the AuthProvider and have it be scoped per function.

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:

With regards,
Apache Git Services

Reply via email to