-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscripts.py
37 lines (22 loc) · 799 Bytes
/
scripts.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"""
Here are some sample scripts, feel free to change or delete them.
"""
from core.script import Script
class PortForward(Script):
def body(self):
namespace = self.namespace
internal_port = int(input('Internal PORT: '))
external_port = int(input('Extenal PORT: '))
pod = namespace.get_pod()
pod.make_port_forward(internal_port, external_port)
print('Port forward completed!')
class Meta:
description = 'Forward a local port to a port on the Pod'
class GetEnvironmentVariables(Script):
def body(self):
namespace = self.namespace
pod = namespace.get_pod()
result = pod.execute('printenv')
print(result)
class Meta:
description = 'Forward a local port to a port on the Pod'