summaryrefslogtreecommitdiff
path: root/app/models/clusters/applications/knative.rb
diff options
context:
space:
mode:
authorChris Baumbauer <cab@cabnetworks.net>2018-11-03 10:48:48 -0700
committerChris Baumbauer <cab@cabnetworks.net>2018-11-03 10:48:48 -0700
commitc10452d285134b7eac63551f5a09606fb5d4f5e0 (patch)
treead88609384b75b54cef8df28c794333189b9ab8b /app/models/clusters/applications/knative.rb
parentaa44393e8f6e428bb7159ac8815a143a9e3e1047 (diff)
downloadgitlab-ce-c10452d285134b7eac63551f5a09606fb5d4f5e0.tar.gz
Resolve issues raised by Kamil
Diffstat (limited to 'app/models/clusters/applications/knative.rb')
-rw-r--r--app/models/clusters/applications/knative.rb26
1 files changed, 17 insertions, 9 deletions
diff --git a/app/models/clusters/applications/knative.rb b/app/models/clusters/applications/knative.rb
index 76d23870f4c..ecb42f6011e 100644
--- a/app/models/clusters/applications/knative.rb
+++ b/app/models/clusters/applications/knative.rb
@@ -18,18 +18,19 @@ module Clusters
include ::Clusters::Concerns::ApplicationData
default_value_for :version, VERSION
- default_value_for :hostname, ''
+ default_value_for :hostname, nil
+
+ validates :hostname, presence: true
def chart
'knative/knative'
end
- def install_command
- args = []
- if !hostname.nil? && !hostname.eql?('')
- args = ["domain=" + hostname]
- end
+ def values
+ content_values.to_yaml
+ end
+ def install_command
Gitlab::Kubernetes::Helm::InstallCommand.new(
name: name,
version: VERSION,
@@ -37,7 +38,6 @@ module Clusters
chart: chart,
files: files,
repository: REPOSITORY,
- setargs: args,
script: install_script
)
end
@@ -46,8 +46,16 @@ module Clusters
['/usr/bin/kubectl', 'apply', '-f', ISTIO_CRDS]
end
- def client
- cluster&.platform_kubernetes&.kubeclient&.core_client
+ private
+
+ def content_values
+ YAML.load_file(chart_values_file).deep_merge!(knative_configs)
+ end
+
+ def knative_configs
+ {
+ "domain" => hostname
+ }
end
end
end