@@ -6,35 +6,15 @@ kubectl_cmd = "kubectl"
66if str (local ("command -v " + kubectl_cmd + " || true" , quiet = True )) == "" :
77 fail ("Required command '" + kubectl_cmd + "' not found in PATH" )
88
9- # set defaults
10- settings = {
11- "root_certificate_secret" : {
12- "enable" : True ,
13- "name" : "registry-certs" ,
14- },
15- }
16-
17- # global settings
18- tilt_file = "./tilt-settings.yaml" if os .path .exists ("./tilt-settings.yaml" ) else "./tilt-settings.json"
19- settings .update (read_yaml (
20- tilt_file ,
21- default = {},
22- ))
23-
249# Use kustomize to build the install yaml files
2510install = kustomize ('config/default' )
2611
2712# Update the root security group. Tilt requires root access to update the
2813# running process.
2914objects = decode_yaml_stream (install )
30- root_certificate = settings .get ("root_certificate_secret" )
3115for o in objects :
3216 if o .get ('kind' ) == 'Deployment' and o .get ('metadata' ).get ('name' ) == 'git-controller' :
3317 o ['spec' ]['template' ]['spec' ]['securityContext' ]['runAsNonRoot' ] = False
34- if root_certificate .get ("enable" ):
35- print ('updating git-controller deployment to add generated certificates' )
36- o ['spec' ]['template' ]['spec' ]['volumes' ] = [{'name' : 'root-certificate' , 'secret' : {'secretName' : root_certificate .get ("name" ), 'items' : [{'key' : 'caFile' , 'path' : 'ca.pem' }]}}]
37- o ['spec' ]['template' ]['spec' ]['containers' ][0 ]['volumeMounts' ] = [{'mountPath' : '/certs' , 'name' : 'root-certificate' }]
3818 break
3919
4020updated_install = encode_yaml_stream (objects )
@@ -62,7 +42,6 @@ local_resource(
6242 "apis" ,
6343 "controllers" ,
6444 "pkg" ,
65- "hack/entrypoint.sh" ,
6645 ],
6746)
6847
@@ -72,7 +51,7 @@ local_resource(
7251# on _any_ file change. We only want to monitor the binary.
7352# If debugging is enabled, we switch to a different docker file using
7453# the delve port.
75- entrypoint = ['/entrypoint.sh' , '/ manager' ]
54+ entrypoint = ['/manager' ]
7655dockerfile = 'tilt.dockerfile'
7756docker_build_with_restart (
7857 'ghcr.io/open-component-model/git-controller' ,
@@ -81,10 +60,8 @@ docker_build_with_restart(
8160 entrypoint = entrypoint ,
8261 only = [
8362 './bin' ,
84- './hack/entrypoint.sh' ,
8563 ],
8664 live_update = [
8765 sync ('./bin/manager' , '/manager' ),
88- sync ('./hack/entrypoint.sh' , '/entrypoint.sh' ),
8966 ],
9067)
0 commit comments