summaryrefslogtreecommitdiff
path: root/app/models/clusters/applications/knative.rb
diff options
context:
space:
mode:
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