Class: Orchparty::Services::Label

Inherits:
Context
  • Object
show all
Defined in:
lib/orchparty/kubernetes_application.rb

Instance Attribute Summary

Attributes inherited from Context

#app_config, #cluster_name, #dir_path, #namespace

Instance Method Summary collapse

Methods inherited from Context

#initialize, #template

Constructor Details

This class inherits a constructor from Orchparty::Services::Context

Instance Method Details

#install(label) ⇒ Object



128
129
130
# File 'lib/orchparty/kubernetes_application.rb', line 128

def install(label)
  puts system(install_cmd(label))
end

#install_cmd(label) ⇒ Object



136
137
138
# File 'lib/orchparty/kubernetes_application.rb', line 136

def install_cmd(label)
  "kubectl --namespace #{namespace} --context #{cluster_name} label --overwrite #{label[:resource]} #{label[:name]} #{label["value"]}"
end


114
115
116
117
# File 'lib/orchparty/kubernetes_application.rb', line 114

def print_install(label)
  puts "---"
  puts install_cmd(label)
end


119
120
121
122
# File 'lib/orchparty/kubernetes_application.rb', line 119

def print_upgrade(label)
  puts "---"
  puts upgrade_cmd(label)
end

#upgrade(label) ⇒ Object



124
125
126
# File 'lib/orchparty/kubernetes_application.rb', line 124

def upgrade(label)
  puts system(upgrade_cmd(label))
end

#upgrade_cmd(label) ⇒ Object



132
133
134
# File 'lib/orchparty/kubernetes_application.rb', line 132

def upgrade_cmd(label)
  "kubectl --namespace #{namespace} --context #{cluster_name} label --overwrite #{label[:resource]} #{label[:name]} #{label["value"]}"
end