galuszkak commented on a change in pull request #4772: [AIRFLOW-3937] 
KubernetesPodOperator support for envFrom configMapRef…
URL: https://github.com/apache/airflow/pull/4772#discussion_r265251095
 
 

 ##########
 File path: airflow/contrib/kubernetes/secret.py
 ##########
 @@ -14,28 +14,41 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+from airflow.exceptions import AirflowConfigException
 
 
 class Secret:
     """Defines Kubernetes Secret Volume"""
 
-    def __init__(self, deploy_type, deploy_target, secret, key):
+    def __init__(self, deploy_type, deploy_target, secret, key=None):
         """Initialize a Kubernetes Secret Object. Used to track requested 
secrets from
         the user.
         :param deploy_type: The type of secret deploy in Kubernetes, either 
`env` or
             `volume`
         :type deploy_type: str
         :param deploy_target: The environment variable when `deploy_type` 
`env` or
-            file path when `deploy_type` `volume` where expose secret
+            file path when `deploy_type` `volume` where expose secret.
+            If `key` is not provided deploy target should be None.
         :type deploy_target: str
         :param secret: Name of the secrets object in Kubernetes
         :type secret: str
-        :param key: Key of the secret within the Kubernetes Secret
+        :param key: (Optional) Key of the secret within the Kubernetes Secret
+            if not provided in `deploy_type` `env` it will mount all secrets 
in object
         :type key: str
 
 Review comment:
   @ashb fixed.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to