cluster/lib/cluster/runner.rb in sct-0.1.22 vs cluster/lib/cluster/runner.rb in sct-0.1.23

- old
+ new

@@ -9,30 +9,30 @@ post_start end def start_cluster if SctCore::Helper.operatingSystem == SctCore::Helper::MAC_OS - run_command "#{minikube} start --cpus=$(sysctl -n hw.ncpu) --memory=8G" + run_command "#{SctCore::Helper.minikube} start --cpus=$(sysctl -n hw.ncpu) --memory=8G" else - run_command "#{minikube} start --cpus=$(cat /proc/cpuinfo | grep processor | wc -l) --memory=10G" + run_command "#{SctCore::Helper.minikube} start --cpus=$(cat /proc/cpuinfo | grep processor | wc -l) --memory=10G" end - run_command "#{minikube} ssh -- 'sudo su -c \"echo 10048576 > /proc/sys/fs/inotify/max_user_watches\"'" + run_command "#{SctCore::Helper.minikube} ssh -- 'sudo su -c \"echo 10048576 > /proc/sys/fs/inotify/max_user_watches\"'" update_config end def post_start wait_for_pods run_command "sudo sct hostfile" UI.success("\nāœ”ļø You can visit your environment at šŸ‘‰ https://spend-cloud.spend.cloud.local šŸ‘Œ") end def down - run_command "#{minikube} stop" + run_command "#{SctCore::Helper.minikube} stop" end def reset - run_command "#{minikube} delete" + run_command "#{SctCore::Helper.minikube} delete" start_cluster create_secrets enable_addons wait_for_gcr_secret run_command "kubectl apply -f ~/development/spend-cloud/k8s/ingress.yml" @@ -47,11 +47,11 @@ enable_addon "registry-creds" enable_addon "ingress" end def enable_addon(addon) - run_command "#{minikube} addons enable #{addon}" + run_command "#{SctCore::Helper.minikube} addons enable #{addon}" deployment = deployments("kube-system").find { |deployment| deployment[:name].include? addon } run_command "kubectl rollout status -n kube-system deployment/#{deployment[:name]}" end @@ -226,11 +226,11 @@ puts Terminal::Table.new title: "Minikube status".green, headings: ['Name', 'Status'], rows: get_minikube_status end def get_minikube_status - output = `#{minikube} status` + output = `#{SctCore::Helper.minikube} status` lines = output.split "\n" rows = lines.map do |line| columns = line.split(" ") @@ -258,17 +258,9 @@ end def run_command command if ! system command raise command.red - end - end - - def minikube - if SctCore::Helper.operatingSystem == SctCore::Helper::WINDOWS - return "minikube.exe" - else - return "minikube" end end end end