require 'sct/command_interface' require 'sct/command_option' require "sct/config" require "sct/setup/helpers" module Sct class Mysql_proxyCommand DEFAULT_SECRET_NAME = "gcloud-credentials" IS_PUBLIC_COMMAND = true SYNTAX = 'sct mysql_proxy' SUMMARY = 'adds a secret for the mysql proxy' DESCRIPTION = "" EXAMPLE = "" EXAMPLE_DESCRIPTION = "" OPTIONS = [] def execute(args, options) return puts "SCT has not been initialized. Run 'sct init' first.".red unless Sct::Config.exists path = Sct::Config.get('cloud-proxy-path') system("kubectl delete secret gcloud-credentials") system("kubectl create secret generic gcloud-credentials --from-file=#{path}") puts "Authenticated with secret-name: '#{DEFAULT_SECRET_NAME}'".green return true end implements CommandInterface end end