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 @@ -286,9 +286,17 @@ func tiltResources(ctx context.Context, ts *tiltSettings) error {
286
286
// NOTE: strictly speaking cert-manager is not a resource, however it is a dependency for most of the actual resources
287
287
// 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.
288
288
if ts .DeployCertManager == nil || * ts .DeployCertManager {
289
- tasks ["cert-manager-cainjector" ] = preLoadImageTask (fmt .Sprintf ("quay.io/jetstack/cert-manager-cainjector:%s" , config .CertManagerDefaultVersion ))
290
- tasks ["cert-manager-webhook" ] = preLoadImageTask (fmt .Sprintf ("quay.io/jetstack/cert-manager-webhook:%s" , config .CertManagerDefaultVersion ))
291
- tasks ["cert-manager-controller" ] = preLoadImageTask (fmt .Sprintf ("quay.io/jetstack/cert-manager-controller:%s" , config .CertManagerDefaultVersion ))
289
+ cfg , err := clientcmd .NewDefaultClientConfigLoadingRules ().Load ()
290
+ if err != nil {
291
+ return errors .Wrap (err , "failed to load KubeConfig file" )
292
+ }
293
+ // The images can only be preloaded when the cluster is a kind cluster.
294
+ // Note: Not repeating the validation on the config already done in allowK8sConfig here.
295
+ if strings .HasPrefix (cfg .Contexts [cfg .CurrentContext ].Cluster , "kind-" ) {
296
+ tasks ["cert-manager-cainjector" ] = preLoadImageTask (fmt .Sprintf ("quay.io/jetstack/cert-manager-cainjector:%s" , config .CertManagerDefaultVersion ))
297
+ tasks ["cert-manager-webhook" ] = preLoadImageTask (fmt .Sprintf ("quay.io/jetstack/cert-manager-webhook:%s" , config .CertManagerDefaultVersion ))
298
+ tasks ["cert-manager-controller" ] = preLoadImageTask (fmt .Sprintf ("quay.io/jetstack/cert-manager-controller:%s" , config .CertManagerDefaultVersion ))
299
+ }
292
300
tasks ["cert-manager" ] = certManagerTask ()
293
301
}
294
302
You can’t perform that action at this time.
0 commit comments