You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/08/09 07:23:19 UTC

[GitHub] [airflow] uranusjr commented on a change in pull request #17474: Add support for configs, secrets, networks and replicas for DockerSwarmOperator

uranusjr commented on a change in pull request #17474:
URL: https://github.com/apache/airflow/pull/17474#discussion_r684965401



##########
File path: airflow/providers/docker/operators/docker_swarm.py
##########
@@ -93,13 +94,44 @@ class DockerSwarmOperator(DockerOperator):
         Supported only if the Docker engine is using json-file or journald logging drivers.
         The `tty` parameter should be set to use this with Python applications.
     :type enable_logging: bool
+    :param configs: List of docker configs to be exposed to the containers of the swarm service.
+        The configs are ConfigReference objects as per the docker api
+        [https://docker-py.readthedocs.io/en/stable/services.html#docker.models.services.ServiceCollection.create]_
+    :type configs: list[ConfigReference]
+    :param secrets: List of docker secrets to be exposed to the containers of the swarm service.
+        The secrets are SecretReference objects as per the docker create_service api.
+        [https://docker-py.readthedocs.io/en/stable/services.html#docker.models.services.ServiceCollection.create]_
+    :type secrets: list[SecretReference]
+    :param mode: Indicate whether a service should be deployed as a replicated or global service.
+        Can be either `replicated` or `global`
+    :type mode: str
+    :param replicas: Number of replicas. For replicated services only.
+    :type replicas: int
+    :param networks: List of network names or IDs or NetworkAttachmentConfig to attach the service to.
+    :type networks: List[Union[str, NetworkAttachmentConfig]]
     """
 
-    def __init__(self, *, image: str, enable_logging: bool = True, **kwargs) -> None:
+    def __init__(
+        self,
+        *,
+        image: str,
+        enable_logging: bool = True,
+        configs: List[ConfigReference] = None,
+        secrets: List[SecretReference] = None,
+        mode: str = "replicated",
+        replicas: int = 1,
+        networks: List[Union[str, NetworkAttachmentConfig]] = None,

Review comment:
       ```suggestion
           configs: Optional[List[ConfigReference]] = None,
           secrets: Optional[List[SecretReference]] = None,
           mode: str = "replicated",
           replicas: int = 1,
           networks: Optional[List[Union[str, NetworkAttachmentConfig]]] = None,
   ```




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org