[
https://issues.apache.org/jira/browse/AIRFLOW-4330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16824944#comment-16824944
]
Thomas Elvey commented on AIRFLOW-4330:
---------------------------------------
[~sharp_n] Maybe as simple as updating
[kubernetes_executor.py#L661|https://github.com/apache/airflow/blob/master/airflow/contrib/executors/kubernetes_executor.py#L661]
{code}
open(secret_path, 'r') # Open for reading, default mode as text{code}
to
{code}
open(secret_path, 'rb') # Open for reading, force mode to binary{code}
forcing the file to be read as bytes, which is what _b64encode_ is expecting
Python 3. I don't think this would be backwards compatible but _do we want to
be?_
Reference(s):
* https://docs.python.org/3/library/functions.html#open
* https://docs.python.org/2/library/base64.html#base64.b64encode
* https://docs.python.org/3/library/base64.html#base64.b64encode
> kubernetes executor _create_or_update_secret does not work with python3
> -----------------------------------------------------------------------
>
> Key: AIRFLOW-4330
> URL: https://issues.apache.org/jira/browse/AIRFLOW-4330
> Project: Apache Airflow
> Issue Type: Bug
> Components: kubernetes
> Affects Versions: 1.10.3
> Reporter: Nick Sharp
> Assignee: Nick Sharp
> Priority: Minor
> Labels: pull-request-available
>
> There seems to have been some changes in the way that the base64 encoder
> works in python 3 so that the encoding of secrets from gcp_service_accounts
> fails.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)