Skip to content

Commit

Permalink
Suppress downloading binaries when --disable-kube* is specified
Browse files Browse the repository at this point in the history
  • Loading branch information
Huang-Wei committed Apr 26, 2023
1 parent 22b704c commit def68e2
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions pkg/kwokctl/runtime/binary/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,20 @@ func (c *Cluster) download(ctx context.Context) error {
return err
}

kubeControllerManagerPath := c.GetBinPath("kube-controller-manager" + conf.BinSuffix)
err = file.DownloadWithCache(ctx, conf.CacheDir, conf.KubeControllerManagerBinary, kubeControllerManagerPath, 0750, conf.QuietPull)
if err != nil {
return err
if !conf.DisableKubeControllerManager {
kubeControllerManagerPath := c.GetBinPath("kube-controller-manager" + conf.BinSuffix)
err = file.DownloadWithCache(ctx, conf.CacheDir, conf.KubeControllerManagerBinary, kubeControllerManagerPath, 0750, conf.QuietPull)
if err != nil {
return err
}
}

kubeSchedulerPath := c.GetBinPath("kube-scheduler" + conf.BinSuffix)
err = file.DownloadWithCache(ctx, conf.CacheDir, conf.KubeSchedulerBinary, kubeSchedulerPath, 0750, conf.QuietPull)
if err != nil {
return err
if !conf.DisableKubeScheduler {
kubeSchedulerPath := c.GetBinPath("kube-scheduler" + conf.BinSuffix)
err = file.DownloadWithCache(ctx, conf.CacheDir, conf.KubeSchedulerBinary, kubeSchedulerPath, 0750, conf.QuietPull)
if err != nil {
return err
}
}

kwokControllerPath := c.GetBinPath("kwok-controller" + conf.BinSuffix)
Expand Down

0 comments on commit def68e2

Please sign in to comment.