class DockerRailsProxy::Kubectl::SetKubeconfig

Attributes

data[RW]
options[RW]

Public Instance Methods

process() click to toggle source
# File lib/docker_rails_proxy/commands/kubectl/set_kubeconfig.rb, line 60
def process
  File.write(KUBECONFIG_PATH, data.to_yaml)
  puts 'kubeconfig was set correctly'
end

Private Instance Methods

opt_parser() { |opts| ... } click to toggle source
# File lib/docker_rails_proxy/commands/kubectl/set_kubeconfig.rb, line 67
def opt_parser
  @opt_parser ||= OptionParser.new do |opts|
    opts.banner = "Usage: bin/#{APP_NAME} kubectl #{self.class.name.demodulize.parameterize} [options]"

    opts.on('--path PATH', 'kubeconfig file path') do |path|
      options[:path] = path
    end

    yield opts if block_given?

    opts.on('-h', '--help', 'Display this screen') do
      puts opts
      exit
    end
  end
end