Skip to content

Commit

Permalink
Remove support for authentication by static kubeconfig file
Browse files Browse the repository at this point in the history
  • Loading branch information
damianavila committed Sep 17, 2021
1 parent 4584f5e commit 3759763
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions deployer/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ def auth(self):
yield from self.auth_gcp()
elif self.spec['provider'] == 'aws':
yield from self.auth_aws()
elif self.spec['provider'] == 'kubeconfig':
yield from self.auth_kubeconfig()
else:
raise ValueError(f'Provider {self.spec["provider"]} not supported')

Expand Down Expand Up @@ -125,23 +123,6 @@ def deploy_support(self):
])
print("Done!")

def auth_kubeconfig(self):
"""
Context manager for authenticating with just a kubeconfig file
For the duration of the contextmanager, we:
1. Decrypt the file specified in kubeconfig.file with sops
2. Set `KUBECONFIG` env var to our decrypted file path, so applications
we call (primarily helm) will use that as config
"""
config = self.spec['kubeconfig']
config_path = config['file']

with decrypt_file(config_path) as decrypted_key_path:
# FIXME: Unset this after our yield
os.environ['KUBECONFIG'] = decrypted_key_path
yield

def auth_aws(self):
"""
Reads `aws` nested config and temporarily sets environment variables
Expand Down

0 comments on commit 3759763

Please sign in to comment.