Sha256: 32fd4d2e795d472cc9dbfb5226a2275921594249172d61def4afdedc8ede2bad

Contents?: true

Size: 504 Bytes

Versions: 25

Compression:

Stored size: 504 Bytes

Contents

module Kontena::Cli::Nodes::Labels
  class RemoveCommand < Kontena::Command
    include Kontena::Cli::Common

    parameter "NODE", "Node name"
    parameter "LABEL ...", "Labels"

    requires_current_master
    requires_current_master_token
    requires_current_grid

    def execute
      node = client.get("nodes/#{current_grid}/#{self.node}")
      data = { labels: Array(node['labels']).reject {|label| label_list.include?(label) } }
      client.put("nodes/#{node['id']}", data)
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
kontena-cli-1.4.3 lib/kontena/cli/nodes/labels/remove_command.rb
kontena-cli-1.4.3.rc1 lib/kontena/cli/nodes/labels/remove_command.rb
kontena-cli-1.4.2 lib/kontena/cli/nodes/labels/remove_command.rb
kontena-cli-1.4.2.rc1 lib/kontena/cli/nodes/labels/remove_command.rb
kontena-cli-1.4.2.pre1 lib/kontena/cli/nodes/labels/remove_command.rb
kontena-cli-1.4.1 lib/kontena/cli/nodes/labels/remove_command.rb
kontena-cli-1.4.1.rc1 lib/kontena/cli/nodes/labels/remove_command.rb
kontena-cli-1.4.1.pre1 lib/kontena/cli/nodes/labels/remove_command.rb
kontena-cli-1.4.0 lib/kontena/cli/nodes/labels/remove_command.rb
kontena-cli-1.4.0.rc2 lib/kontena/cli/nodes/labels/remove_command.rb
kontena-cli-1.4.0.rc1 lib/kontena/cli/nodes/labels/remove_command.rb
kontena-cli-1.4.0.pre14 lib/kontena/cli/nodes/labels/remove_command.rb
kontena-cli-1.4.0.pre13 lib/kontena/cli/nodes/labels/remove_command.rb
kontena-cli-1.4.0.pre12 lib/kontena/cli/nodes/labels/remove_command.rb
kontena-cli-1.4.0.pre11 lib/kontena/cli/nodes/labels/remove_command.rb
kontena-cli-1.4.0.pre10 lib/kontena/cli/nodes/labels/remove_command.rb
kontena-cli-1.4.0.pre9 lib/kontena/cli/nodes/labels/remove_command.rb
kontena-cli-1.4.0.pre8 lib/kontena/cli/nodes/labels/remove_command.rb
kontena-cli-1.4.0.pre7 lib/kontena/cli/nodes/labels/remove_command.rb
kontena-cli-1.4.0.pre6 lib/kontena/cli/nodes/labels/remove_command.rb