11from pathlib import Path
22
3- from transpire .resources import Deployment , Ingress , Secret , Service
3+ from transpire .resources import Deployment
4+ from transpire .resources import Ingress
5+ from transpire .resources import Secret
6+ from transpire .resources import Service
47from transpire .types import Image
5- from transpire .utils import get_image_tag , get_revision
8+ from transpire .utils import get_image_tag
9+ from transpire .utils import get_revision
610
7- name = " ircbot"
11+ name = ' ircbot'
812auto_sync = True
913
14+
1015def dep_patches (dep ):
11- dep .obj .spec .template .spec .dns_policy = " ClusterFirst"
12- dep .obj .spec .template .spec .dns_config = {" searches" : [" ocf.berkeley.edu" ]}
16+ dep .obj .spec .template .spec .dns_policy = ' ClusterFirst'
17+ dep .obj .spec .template .spec .dns_config = {' searches' : [' ocf.berkeley.edu' ]}
1318
1419 dep .obj .spec .template .spec .volumes = [
15- {" name" : " config" , " secret" : {" secretName" : " ircbot" }},
20+ {' name' : ' config' , ' secret' : {' secretName' : ' ircbot' }},
1621 ]
1722
1823 dep .obj .spec .template .spec .containers [0 ].volume_mounts = [
19- {" name" : " config" , " mountPath" : " /etc/ocf-ircbot" },
24+ {' name' : ' config' , ' mountPath' : ' /etc/ocf-ircbot' },
2025 ]
2126
2227
2328def images ():
24- yield Image (name = " ircbot" , path = Path ("/" ))
29+ yield Image (name = ' ircbot' , path = Path ('/' ))
2530
2631
2732def objects ():
2833 secret = Secret (
29- name = " ircbot" ,
34+ name = ' ircbot' ,
3035 string_data = {
31- " ocf-ircbot.conf" : "" ,
36+ ' ocf-ircbot.conf' : '' ,
3237 },
3338 )
3439 yield secret .build ()
3540
3641 dep_bot = Deployment (
3742 name = name ,
38- image = get_image_tag (" ircbot" ),
43+ image = get_image_tag (' ircbot' ),
3944 ports = [8888 ],
4045 )
4146 # TODO: Switch this to .patch() API.
@@ -52,7 +57,7 @@ def objects():
5257
5358 ing_bot = Ingress .from_svc (
5459 svc = svc_bot ,
55- host = " ircbot.ocf.berkeley.edu" ,
56- path_prefix = "/" ,
60+ host = ' ircbot.ocf.berkeley.edu' ,
61+ path_prefix = '/' ,
5762 )
58- yield ing_bot .build ()
63+ yield ing_bot .build ()
0 commit comments