@@ -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" : [
@@ -160,7 +162,7 @@ providers = {
160
162
# }
161
163
# }
162
164
163
- def load_provider_tiltfiles ():
165
+ def load_provider_tilt_files ():
164
166
provider_repos = settings .get ("provider_repos" , [])
165
167
166
168
for repo in provider_repos :
@@ -405,8 +407,8 @@ def find_all_objects_names(objs):
405
407
# Users may define their own Tilt customizations in tilt.d. This directory is excluded from git and these files will
406
408
# not be checked in to version control.
407
409
def include_user_tilt_files ():
408
- user_tiltfiles = listdir ("tilt.d" )
409
- for f in user_tiltfiles :
410
+ user_tilt_files = listdir ("tilt.d" )
411
+ for f in user_tilt_files :
410
412
include (f )
411
413
412
414
# Enable core cluster-api plus everything listed in 'enable_providers' in tilt-settings.json
@@ -416,7 +418,10 @@ def enable_providers():
416
418
417
419
def get_providers ():
418
420
user_enable_providers = settings .get ("enable_providers" , [])
419
- return {k : "" for k in user_enable_providers + always_enable_providers }.keys ()
421
+ all_providers = set (user_enable_providers ) | set (default_enable_providers )
422
+ if not settings .get ("enable_core_provider" , True ):
423
+ return all_providers - set ([core_provider_name ])
424
+ return all_providers
420
425
421
426
def deploy_provider_crds ():
422
427
# NOTE: we are applying raw yaml for clusterctl resources (vs delegating this to clusterctl methods) because
@@ -566,7 +571,7 @@ def deploy_clusterclass(clusterclass_name, label, filename, substitutions):
566
571
cmd_button (
567
572
clusterclass_name + ":apply" ,
568
573
argv = ["bash" , "-c" , apply_clusterclass_cmd ],
569
- env = dictonary_to_list_of_string (substitutions ),
574
+ env = dictionary_to_list_of_string (substitutions ),
570
575
resource = clusterclass_name ,
571
576
icon_name = "note_add" ,
572
577
text = "Apply `" + clusterclass_name + "` ClusterClass" ,
@@ -578,7 +583,7 @@ def deploy_clusterclass(clusterclass_name, label, filename, substitutions):
578
583
cmd_button (
579
584
clusterclass_name + ":delete" ,
580
585
argv = ["bash" , "-c" , delete_clusterclass_cmd ],
581
- env = dictonary_to_list_of_string (substitutions ),
586
+ env = dictionary_to_list_of_string (substitutions ),
582
587
resource = clusterclass_name ,
583
588
icon_name = "delete_forever" ,
584
589
text = "Delete `" + clusterclass_name + "` ClusterClass" ,
@@ -603,7 +608,7 @@ def deploy_cluster_template(template_name, label, filename, substitutions):
603
608
cmd_button (
604
609
template_name + ":apply" ,
605
610
argv = ["bash" , "-c" , apply_cluster_template_cmd ],
606
- env = dictonary_to_list_of_string (substitutions ),
611
+ env = dictionary_to_list_of_string (substitutions ),
607
612
resource = template_name ,
608
613
icon_name = "add_box" ,
609
614
text = "Create `" + template_name + "` cluster" ,
@@ -618,7 +623,7 @@ def deploy_cluster_template(template_name, label, filename, substitutions):
618
623
cmd_button (
619
624
template_name + ":delete" ,
620
625
argv = ["bash" , "-c" , delete_clusters_cmd ],
621
- env = dictonary_to_list_of_string (substitutions ),
626
+ env = dictionary_to_list_of_string (substitutions ),
622
627
resource = template_name ,
623
628
icon_name = "delete_forever" ,
624
629
text = "Delete `" + template_name + "` clusters" ,
@@ -630,14 +635,14 @@ def deploy_cluster_template(template_name, label, filename, substitutions):
630
635
cmd_button (
631
636
template_name + ":delete-all" ,
632
637
argv = ["bash" , "-c" , kubectl_cmd + " delete clusters --all --wait=false" ],
633
- env = dictonary_to_list_of_string (substitutions ),
638
+ env = dictionary_to_list_of_string (substitutions ),
634
639
resource = template_name ,
635
640
icon_name = "delete_sweep" ,
636
641
text = "Delete all workload clusters" ,
637
642
)
638
643
639
- # A function to convert dictonary to list of strings in a format of "name=value"
640
- def dictonary_to_list_of_string (substitutions ):
644
+ # A function to convert dictionary to list of strings in a format of "name=value"
645
+ def dictionary_to_list_of_string (substitutions ):
641
646
substitutions_list = []
642
647
for name , value in substitutions .items ():
643
648
substitutions_list .append (name + "=" + value )
@@ -649,7 +654,7 @@ def dictonary_to_list_of_string(substitutions):
649
654
650
655
include_user_tilt_files ()
651
656
652
- load_provider_tiltfiles ()
657
+ load_provider_tilt_files ()
653
658
654
659
prepare_all ()
655
660
0 commit comments