runqi-zhao commented on code in PR #5054:
URL: https://github.com/apache/shenyu/pull/5054#discussion_r1304499968


##########
shenyu-kubernetes-controller/src/main/java/org/apache/shenyu/k8s/parser/DivideIngressParser.java:
##########
@@ -290,15 +292,15 @@ private List<DivideUpstream> parseUpstream(final 
V1IngressBackend backend, final
                     if (Objects.isNull(addresses) || addresses.isEmpty()) {
                         continue;
                     }
+                    int i = 0;
                     for (V1EndpointAddress address : addresses) {
                         String upstreamIp = address.getIp();
                         String defaultPort = parsePort(backend.getService());
                         if (Objects.nonNull(defaultPort)) {
                             DivideUpstream upstream = new DivideUpstream();
                             upstream.setUpstreamUrl(upstreamIp + ":" + 
defaultPort);
                             upstream.setWeight(100);
-                            // TODO support config protocol in annotation
-                            upstream.setProtocol("http://";);
+                            upstream.setProtocol(Objects.isNull(protocol) ? 
"http://"; : protocol.split(",")[i++]);

Review Comment:
   In the yaml file, we need to set up several different Upstreams at the same 
time, so we will set up the yaml file in the following form:
   ```yaml
   metadata.
     name: ...
     annotations.
       yourAnnotationKey:  value1,value2,value3
   ```
   Then read in value1,value2,value3, so it's good to use an array to iterate 
through each of these values



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