wangyang0918 commented on a change in pull request #93:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/93#discussion_r832341172



##########
File path: 
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/IngressUtils.java
##########
@@ -122,4 +154,27 @@ public static void setOwnerReference(HasMetadata owner, 
List<HasMetadata> resour
                         resource.getMetadata()
                                 
.setOwnerReferences(Collections.singletonList(ownerReference)));
     }
+
+    public static URL getIngressUrl(String ingressTemplate, String name, 
String namespace) {
+        String template = addProtocol(ingressTemplate);
+        template = NAME_PTN.matcher(template).replaceAll(name);
+        template = NAMESPACE_PTN.matcher(template).replaceAll(namespace);
+        try {
+            return new URL(template);
+        } catch (MalformedURLException e) {
+            LOG.error(e.getMessage());
+            throw new ReconciliationException(
+                    String.format(
+                            "Unable to process the Ingress template(%s). 
Error: %s",
+                            ingressTemplate, e.getMessage()));
+        }
+    }
+
+    private static String addProtocol(String url) {

Review comment:
       It seems we do not use the protocol when creating the ingress. Why do we 
need this?




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to