jedcunningham commented on a change in pull request #19181:
URL: https://github.com/apache/airflow/pull/19181#discussion_r742021449



##########
File path: chart/values.schema.json
##########
@@ -2069,11 +2258,38 @@
                         "annotations": {
                             "description": "Annotations for the webserver 
Service.",
                             "type": "object",
-                            "default": {}
+                            "default": {},
+                            "additionalProperties": {
+                                "type": "string"
+                            }
                         },
                         "ports": {
                             "description": "Ports for the webserver Service.",
                             "type": "array",
+                            "items": {
+                                "type": "object",
+                                "additionalProperties": false,
+                                "properties": {
+                                    "name": {
+                                        "type": "string"
+                                    },
+                                    "port": {
+                                        "type": [
+                                            "string",
+                                            "integer"
+                                        ]
+                                    },
+                                    "targetPort": {
+                                        "type": [
+                                            "string",
+                                            "integer"
+                                        ]
+                                    },
+                                    "protocol": {
+                                        "type": "string"
+                                    }
+                                }
+                            },

Review comment:
       Ah, good catch.

##########
File path: chart/tests/test_flower.py
##########
@@ -358,18 +358,18 @@ def test_defaults(self):
         "ports, expected_ports",
         [
             (
-                [{"name": "{{ .Release.Name }}", "protocol": "UDP", "port": 
"{{ .Values.ports.flowerUI }}"}],
-                [{"name": "RELEASE-NAME", "protocol": "UDP", "port": 5555}],
+                [{"protocol": "UDP", "port": "{{ .Values.ports.flowerUI }}"}],
+                [{"protocol": "UDP", "port": 5555}],
             ),
-            ([{"name": "only_sidecar", "port": "sidecar"}], [{"name": 
"only_sidecar", "port": "sidecar"}]),
+            ([{"port": "sidecar"}], [{"port": "sidecar"}]),
             (
                 [
-                    {"name": "flower-ui", "port": "{{ .Values.ports.flowerUI 
}}"},
-                    {"name": "sidecar", "port": 80},
+                    {"port": "{{ .Values.ports.flowerUI }}"},
+                    {"port": 80},
                 ],
                 [
-                    {"name": "flower-ui", "port": 5555},
-                    {"name": "sidecar", "port": 80},
+                    {"port": 5555},
+                    {"port": 80},

Review comment:
       ```suggestion
                       {"name": "flower-ui", "port": 5555},
                       {"name": "sidecar-RELEASE-NAME", "port": 80},
   ```

##########
File path: chart/tests/test_flower.py
##########
@@ -358,18 +358,18 @@ def test_defaults(self):
         "ports, expected_ports",
         [
             (
-                [{"name": "{{ .Release.Name }}", "protocol": "UDP", "port": 
"{{ .Values.ports.flowerUI }}"}],
-                [{"name": "RELEASE-NAME", "protocol": "UDP", "port": 5555}],
+                [{"protocol": "UDP", "port": "{{ .Values.ports.flowerUI }}"}],
+                [{"protocol": "UDP", "port": 5555}],
             ),
-            ([{"name": "only_sidecar", "port": "sidecar"}], [{"name": 
"only_sidecar", "port": "sidecar"}]),
+            ([{"port": "sidecar"}], [{"port": "sidecar"}]),
             (
                 [
-                    {"name": "flower-ui", "port": "{{ .Values.ports.flowerUI 
}}"},
-                    {"name": "sidecar", "port": 80},
+                    {"port": "{{ .Values.ports.flowerUI }}"},
+                    {"port": 80},

Review comment:
       ```suggestion
                      {"name": "flower-ui", "port": "{{ .Values.ports.flowerUI 
}}"},
                      {"name": "sidecar-{{ .Release.Name }}", "port": 80},
   ```
   
   `name` is required if there is more than 1 ServicePort (sorry, deepest I can 
link you): 
https://kubernetes.io/docs/reference/kubernetes-api/service-resources/service-v1/#ServiceSpec
   
   Also add back a test that `name` is templated.

##########
File path: chart/tests/test_flower.py
##########
@@ -358,18 +358,18 @@ def test_defaults(self):
         "ports, expected_ports",
         [
             (
-                [{"name": "{{ .Release.Name }}", "protocol": "UDP", "port": 
"{{ .Values.ports.flowerUI }}"}],
-                [{"name": "RELEASE-NAME", "protocol": "UDP", "port": 5555}],
+                [{"protocol": "UDP", "port": "{{ .Values.ports.flowerUI }}"}],
+                [{"protocol": "UDP", "port": 5555}],
             ),
-            ([{"name": "only_sidecar", "port": "sidecar"}], [{"name": 
"only_sidecar", "port": "sidecar"}]),
+            ([{"port": "sidecar"}], [{"port": "sidecar"}]),
             (
                 [
-                    {"name": "flower-ui", "port": "{{ .Values.ports.flowerUI 
}}"},
-                    {"name": "sidecar", "port": 80},
+                    {"port": "{{ .Values.ports.flowerUI }}"},
+                    {"port": 80},

Review comment:
       Ah, whoops!




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