What is the correct way to pass Private Key information to Sftp Connection ? #14474
Unanswered
abhishekshenoy
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Airflow Version : 2.0
Kubernetes version (if you are using kubernetes) (use kubectl version):v1.18.2
I am trying to make use of GCSToSFTPOperator , wanted to understand what is the correct way to pass the private-key information while creating the Sftp Connection from Admin options.
The current approach i am taking is i am passing the rsa generated private key in the extra json , but the connection parser fails with exception
I have tried passing the rsa-ssh-key separately to
paramiko.RSAKey.from_private_key
and it works .On checking the connection.py code i see that extra json is parsed using the below which fails
json.loads(self.extra)
On parsing the extra using the below additional parameter i am able to pass the key as well as get it initialised
json.loads(self.extra,strict=False)
We are running airflow on kubernetes , passing key file location would mean each pod needs to have that key file on creation so have taken this approach of providing key file information in json.
Can some one please guide me on what is the right way to solve this issue ?
Beta Was this translation helpful? Give feedback.
All reactions