diff options
author | Thong Kuah <tkuah@gitlab.com> | 2018-10-01 00:32:09 +0300 |
---|---|---|
committer | Thong Kuah <tkuah@gitlab.com> | 2018-10-01 01:16:07 +0300 |
commit | f6ff32d9bd7a9817bb74379a1f28954aa378559c (patch) | |
tree | 8ab1683c75fe0117b573f8754591c546fd103711 /lib/gitlab/kubernetes | |
parent | f03eb2332682c9419103df905045bf33f04a5158 (diff) |
Port Helm::Api EE extensions to CE
We will need these utility level code in the future to help upgrade all
helm applications.
Diffstat (limited to 'lib/gitlab/kubernetes')
-rw-r--r-- | lib/gitlab/kubernetes/helm/api.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/gitlab/kubernetes/helm/api.rb b/lib/gitlab/kubernetes/helm/api.rb index 2dd74c68075..e21bc531444 100644 --- a/lib/gitlab/kubernetes/helm/api.rb +++ b/lib/gitlab/kubernetes/helm/api.rb @@ -17,6 +17,12 @@ module Gitlab kubeclient.create_pod(command.pod_resource) end + def update(command) + namespace.ensure_exists! + update_config_map(command) + kubeclient.create_pod(command.pod_resource) + end + ## # Returns Pod phase # @@ -36,6 +42,12 @@ module Gitlab kubeclient.delete_pod(pod_name, namespace.name) end + def get_config_map(config_map_name) + namespace.ensure_exists! + + kubeclient.get_config_map(config_map_name, namespace.name) + end + private attr_reader :kubeclient, :namespace @@ -46,6 +58,12 @@ module Gitlab end end + def update_config_map(command) + command.config_map_resource.tap do |config_map_resource| + kubeclient.update_config_map(config_map_resource) + end + end + def create_service_account(command) command.service_account_resource.tap do |service_account_resource| break unless service_account_resource |