Skip to content

Commit

Permalink
hack/observability: skip preload images on non-kind clusters
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Büringer buringerst@vmware.com
  • Loading branch information
sbueringer committed Jun 28, 2023
1 parent 4920e6e commit 598a10b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions hack/tools/tilt-prepare/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,17 @@ func tiltResources(ctx context.Context, ts *tiltSettings) error {
// NOTE: strictly speaking cert-manager is not a resource, however it is a dependency for most of the actual resources
// 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.
if ts.DeployCertManager == nil || *ts.DeployCertManager {
tasks["cert-manager-cainjector"] = preLoadImageTask(fmt.Sprintf("quay.io/jetstack/cert-manager-cainjector:%s", config.CertManagerDefaultVersion))
tasks["cert-manager-webhook"] = preLoadImageTask(fmt.Sprintf("quay.io/jetstack/cert-manager-webhook:%s", config.CertManagerDefaultVersion))
tasks["cert-manager-controller"] = preLoadImageTask(fmt.Sprintf("quay.io/jetstack/cert-manager-controller:%s", config.CertManagerDefaultVersion))
cfg, err := clientcmd.NewDefaultClientConfigLoadingRules().Load()
if err != nil {
return errors.Wrap(err, "failed to load KubeConfig file")
}
// The images can only be preloaded when the cluster is a kind cluster.
// Note: Not repeating the validation on the config already done in allowK8sConfig here.
if strings.HasPrefix(cfg.Contexts[cfg.CurrentContext].Cluster, "kind-") {
tasks["cert-manager-cainjector"] = preLoadImageTask(fmt.Sprintf("quay.io/jetstack/cert-manager-cainjector:%s", config.CertManagerDefaultVersion))
tasks["cert-manager-webhook"] = preLoadImageTask(fmt.Sprintf("quay.io/jetstack/cert-manager-webhook:%s", config.CertManagerDefaultVersion))
tasks["cert-manager-controller"] = preLoadImageTask(fmt.Sprintf("quay.io/jetstack/cert-manager-controller:%s", config.CertManagerDefaultVersion))
}
tasks["cert-manager"] = certManagerTask()
}

Expand Down

0 comments on commit 598a10b

Please sign in to comment.