Class: Kdep::Commands::Env
- Inherits:
-
Object
- Object
- Kdep::Commands::Env
- Defined in:
- lib/kdep/commands/env.rb
Overview
Dispatcher for ‘kdep env <subcommand>`. Currently only `check` is wired.
Constant Summary collapse
- SUBCOMMANDS =
%w[check].freeze
Class Method Summary collapse
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(global_options:, command_options:, args:) ⇒ Env
constructor
A new instance of Env.
Constructor Details
Class Method Details
.option_parser ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/kdep/commands/env.rb', line 9 def self.option_parser OptionParser.new do |opts| opts. = "Usage: kdep env <subcommand> [options] [deploy] [env]" opts.separator "" opts.separator "Subcommands:" opts.separator " check Validate ConfigMap+Secret in cluster against env.spec" opts.separator "" opts.on("--env=ENV", "Environment scope (production|staging|dev)") end end |
Instance Method Details
#execute ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/kdep/commands/env.rb', line 27 def execute sub = @args.shift unless SUBCOMMANDS.include?(sub) @ui.error("Unknown subcommand: #{sub.inspect}. Available: #{SUBCOMMANDS.join(', ')}") exit 2 end case sub when "check" require "kdep/commands/env_check" Kdep::Commands::EnvCheck.new( global_options: @global_options, command_options: @command_options, args: @args ).execute end end |