Skip to content
This repository has been archived by the owner on Oct 3, 2020. It is now read-only.

Commit

Permalink
Merge 5422060 into 288de13
Browse files Browse the repository at this point in the history
  • Loading branch information
hjacobs committed Mar 8, 2019
2 parents 288de13 + 5422060 commit 0f7f17f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions pykube/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import code

import pykube

config = pykube.KubeConfig.from_file()
print(f'KubeConfig: {config.filename}, current context: {config.current_context}')
api = pykube.HTTPClient(config)

context = {
'__name__': '__console__',
'pykube': pykube,
'config': config,
'api': api
}
for k, v in vars(pykube).items():
if k[0] != '_' and k[0] == k[0].upper():
context[k] = v

console = code.InteractiveConsole(locals=context)
console.interact(f'Pykube v{pykube.__version__}\nUse Ctrl-D to exit\n{", ".join(sorted(context.keys()))}')

0 comments on commit 0f7f17f

Please sign in to comment.