@@ -52,10 +52,12 @@ if not usingLocalRegistry:
52
52
if settings .get ("default_registry" , "" ) != "" :
53
53
default_registry (settings .get ("default_registry" ))
54
54
55
- always_enable_providers = ["core" ]
55
+ core_provider_name = "core"
56
+
57
+ default_enable_providers = [core_provider_name ]
56
58
57
59
providers = {
58
- "core" : {
60
+ core_provider_name : {
59
61
"context" : "." , # NOTE: this should be kept in sync with corresponding setting in tilt-prepare
60
62
"image" : "gcr.io/k8s-staging-cluster-api/cluster-api-controller" ,
61
63
"live_reload_deps" : [
@@ -147,7 +149,7 @@ providers = {
147
149
# }
148
150
# }
149
151
150
- def load_provider_tiltfiles ():
152
+ def load_provider_tilt_files ():
151
153
provider_repos = settings .get ("provider_repos" , [])
152
154
153
155
for repo in provider_repos :
@@ -392,8 +394,8 @@ def find_all_objects_names(objs):
392
394
# Users may define their own Tilt customizations in tilt.d. This directory is excluded from git and these files will
393
395
# not be checked in to version control.
394
396
def include_user_tilt_files ():
395
- user_tiltfiles = listdir ("tilt.d" )
396
- for f in user_tiltfiles :
397
+ user_tilt_files = listdir ("tilt.d" )
398
+ for f in user_tilt_files :
397
399
include (f )
398
400
399
401
# Enable core cluster-api plus everything listed in 'enable_providers' in tilt-settings.json
@@ -403,7 +405,10 @@ def enable_providers():
403
405
404
406
def get_providers ():
405
407
user_enable_providers = settings .get ("enable_providers" , [])
406
- return {k : "" for k in user_enable_providers + always_enable_providers }.keys ()
408
+ all_providers = set (user_enable_providers ) | set (default_enable_providers )
409
+ if not settings .get ("enable_core_provider" , True ):
410
+ return all_providers - set ([core_provider_name ])
411
+ return all_providers
407
412
408
413
def deploy_provider_crds ():
409
414
# NOTE: we are applying raw yaml for clusterctl resources (vs delegating this to clusterctl methods) because
@@ -552,7 +557,7 @@ def deploy_clusterclass(clusterclass_name, label, filename, substitutions):
552
557
cmd_button (
553
558
clusterclass_name + ".clusterclass:apply" ,
554
559
argv = ["bash" , "-c" , apply_clusterclass_cmd ],
555
- env = dictonary_to_list_of_string (substitutions ),
560
+ env = dictionary_to_list_of_string (substitutions ),
556
561
resource = clusterclass_name ,
557
562
icon_name = "note_add" ,
558
563
text = "Apply `" + clusterclass_name + "` ClusterClass" ,
@@ -564,7 +569,7 @@ def deploy_clusterclass(clusterclass_name, label, filename, substitutions):
564
569
cmd_button (
565
570
clusterclass_name + ".clusterclass:delete" ,
566
571
argv = ["bash" , "-c" , delete_clusterclass_cmd ],
567
- env = dictonary_to_list_of_string (substitutions ),
572
+ env = dictionary_to_list_of_string (substitutions ),
568
573
resource = clusterclass_name ,
569
574
icon_name = "delete_forever" ,
570
575
text = "Delete `" + clusterclass_name + "` ClusterClass" ,
@@ -589,7 +594,7 @@ def deploy_cluster_template(template_name, label, filename, substitutions):
589
594
cmd_button (
590
595
template_name + ":apply" ,
591
596
argv = ["bash" , "-c" , apply_cluster_template_cmd ],
592
- env = dictonary_to_list_of_string (substitutions ),
597
+ env = dictionary_to_list_of_string (substitutions ),
593
598
resource = template_name ,
594
599
icon_name = "add_box" ,
595
600
text = "Create `" + template_name + "` cluster" ,
@@ -604,7 +609,7 @@ def deploy_cluster_template(template_name, label, filename, substitutions):
604
609
cmd_button (
605
610
template_name + ":delete" ,
606
611
argv = ["bash" , "-c" , delete_clusters_cmd ],
607
- env = dictonary_to_list_of_string (substitutions ),
612
+ env = dictionary_to_list_of_string (substitutions ),
608
613
resource = template_name ,
609
614
icon_name = "delete_forever" ,
610
615
text = "Delete `" + template_name + "` clusters" ,
@@ -616,14 +621,14 @@ def deploy_cluster_template(template_name, label, filename, substitutions):
616
621
cmd_button (
617
622
template_name + ":delete-all" ,
618
623
argv = ["bash" , "-c" , kubectl_cmd + " delete clusters --all --wait=false" ],
619
- env = dictonary_to_list_of_string (substitutions ),
624
+ env = dictionary_to_list_of_string (substitutions ),
620
625
resource = template_name ,
621
626
icon_name = "delete_sweep" ,
622
627
text = "Delete all workload clusters" ,
623
628
)
624
629
625
- # A function to convert dictonary to list of strings in a format of "name=value"
626
- def dictonary_to_list_of_string (substitutions ):
630
+ # A function to convert dictionary to list of strings in a format of "name=value"
631
+ def dictionary_to_list_of_string (substitutions ):
627
632
substitutions_list = []
628
633
for name , value in substitutions .items ():
629
634
substitutions_list .append (name + "=" + value )
@@ -635,7 +640,7 @@ def dictonary_to_list_of_string(substitutions):
635
640
636
641
include_user_tilt_files ()
637
642
638
- load_provider_tiltfiles ()
643
+ load_provider_tilt_files ()
639
644
640
645
prepare_all ()
641
646
0 commit comments