Class: Orchparty::Services::SecretGeneric
- 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
- #install_cmd(secret, fix_file_path = nil) ⇒ Object
- #upgrade_cmd(secret, fix_file_path = nil) ⇒ Object
- #value_path(secret) ⇒ Object
Methods inherited from Context
#initialize, #install, #print_install, #print_upgrade, #template, #upgrade
Constructor Details
This class inherits a constructor from Orchparty::Services::Context
Instance Method Details
#install_cmd(secret, fix_file_path = nil) ⇒ Object
107 108 109 |
# File 'lib/orchparty/kubernetes_application.rb', line 107 def install_cmd(secret, fix_file_path=nil) "kubectl --namespace #{namespace} --context #{cluster_name} create secret generic --dry-run -o yaml #{secret[:name]} #{template(value_path(secret), secret, flag: "--from-file=", fix_file_path: fix_file_path)} | kubectl apply -f -" end |
#upgrade_cmd(secret, fix_file_path = nil) ⇒ Object
103 104 105 |
# File 'lib/orchparty/kubernetes_application.rb', line 103 def upgrade_cmd(secret, fix_file_path=nil) "kubectl --namespace #{namespace} --context #{cluster_name} create secret generic --dry-run -o yaml #{secret[:name]} #{template(value_path(secret), secret, flag: "--from-file=", fix_file_path: fix_file_path)} | kubectl apply -f -" end |
#value_path(secret) ⇒ Object
99 100 101 |
# File 'lib/orchparty/kubernetes_application.rb', line 99 def value_path(secret) secret[:from_file] end |