Sha256: 43ee143f5d3373b01362258f8930096b196afba747fc69d94a4ec726059d5629

Contents?: true

Size: 524 Bytes

Versions: 5

Compression:

Stored size: 524 Bytes

Contents

module Kontena::Cli::Registry
  class RemoveCommand < Kontena::Command
    include Kontena::Cli::Common

    option "--force", :flag, "Force remove", default: false, attribute_name: :forced

    def execute
      require_api_url
      token = require_token
      confirm unless forced?

      registry = client(token).get("services/#{current_grid}/registry") rescue nil
      abort("Docker Registry service does not exist") if registry.nil?

      client(token).delete("services/#{current_grid}/registry")
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
kontena-cli-0.16.0.pre5 lib/kontena/cli/registry/remove_command.rb
kontena-cli-0.16.0.pre4 lib/kontena/cli/registry/remove_command.rb
kontena-cli-0.16.0.pre3 lib/kontena/cli/registry/remove_command.rb
kontena-cli-0.16.0.pre2 lib/kontena/cli/registry/remove_command.rb
kontena-cli-0.16.0.pre1 lib/kontena/cli/registry/remove_command.rb