cluster/lib/cluster/runner.rb in sct-0.1.29 vs cluster/lib/cluster/runner.rb in sct-0.1.30

- old
+ new

@@ -96,10 +96,11 @@ update_config end def post_start wait_for_pods + copy_proactive_accounts_file run_command "sudo sct hostfile" run_command "minikube tunnel &", { out: "/dev/null", err: "/dev/null" } if SctCore::Helper::is_windows? # leave this running detached forever in the background UI.success("\nāœ”ļø You can visit your environment at šŸ‘‰ https://spend-cloud.spend.cloud.local šŸ‘Œ") end @@ -288,9 +289,25 @@ if rows.empty? return end return Terminal::Table.new title: "Pods (namespace: #{namespace})".green, headings: ['Name', 'Status', 'Replicas ready'], rows: rows + end + + def copy_proactive_accounts_file + pod_id = pods().select {|pod| pod[:name].start_with?("proactive-config")}.first[:name] + + begin + UI.important("Checking ProActive accounts file...") + run_command "kubectl exec #{pod_id} -- test -e /data/proactive_accounts.ini", [:out, :err] => File::NULL + rescue => e + UI.important("Copying ProActive accounts file to deployments...") + src_path = "#{Dir.home()}/development/spend-cloud/k8s/conf/proactive_accounts.ini" + command = "kubectl cp #{src_path} #{pod_id}:/data/proactive_accounts.ini" + run_command command + end + + UI.success("ProActive accounts file is available") end def run_command command, options = {} if ! system command, options raise command.red