File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -283,9 +283,17 @@ func tiltResources(ctx context.Context, ts *tiltSettings) error {
283
283
// NOTE: strictly speaking cert-manager is not a resource, however it is a dependency for most of the actual resources
284
284
// and running this is the same task group of the kustomize/provider tasks gives the maximum benefits in terms of reducing the total elapsed time.
285
285
if ts .DeployCertManager == nil || * ts .DeployCertManager {
286
- tasks ["cert-manager-cainjector" ] = preLoadImageTask (fmt .Sprintf ("quay.io/jetstack/cert-manager-cainjector:%s" , config .CertManagerDefaultVersion ))
287
- tasks ["cert-manager-webhook" ] = preLoadImageTask (fmt .Sprintf ("quay.io/jetstack/cert-manager-webhook:%s" , config .CertManagerDefaultVersion ))
288
- tasks ["cert-manager-controller" ] = preLoadImageTask (fmt .Sprintf ("quay.io/jetstack/cert-manager-controller:%s" , config .CertManagerDefaultVersion ))
286
+ cfg , err := clientcmd .NewDefaultClientConfigLoadingRules ().Load ()
287
+ if err != nil {
288
+ return errors .Wrap (err , "failed to load KubeConfig file" )
289
+ }
290
+ // The images can only be preloaded when the cluster is a kind cluster.
291
+ // Note: Not repeating the validation on the config already done in allowK8sConfig here.
292
+ if strings .HasPrefix (cfg .Contexts [cfg .CurrentContext ].Cluster , "kind-" ) {
293
+ tasks ["cert-manager-cainjector" ] = preLoadImageTask (fmt .Sprintf ("quay.io/jetstack/cert-manager-cainjector:%s" , config .CertManagerDefaultVersion ))
294
+ tasks ["cert-manager-webhook" ] = preLoadImageTask (fmt .Sprintf ("quay.io/jetstack/cert-manager-webhook:%s" , config .CertManagerDefaultVersion ))
295
+ tasks ["cert-manager-controller" ] = preLoadImageTask (fmt .Sprintf ("quay.io/jetstack/cert-manager-controller:%s" , config .CertManagerDefaultVersion ))
296
+ }
289
297
tasks ["cert-manager" ] = certManagerTask ()
290
298
}
291
299
You can’t perform that action at this time.
0 commit comments