Commit c2097ed7 authored by Chris Baumbauer's avatar Chris Baumbauer

Fix style with clusters_store.js and remove workaround for namespace role issue

parent 26673cc8
...@@ -102,8 +102,8 @@ export default class ClusterStore { ...@@ -102,8 +102,8 @@ export default class ClusterStore {
? `jupyter.${this.state.applications.ingress.externalIp}.nip.io` ? `jupyter.${this.state.applications.ingress.externalIp}.nip.io`
: ''); : '');
} else if (appId === KNATIVE) { } else if (appId === KNATIVE) {
this.state.applications.knative.hostname = serverAppEntry.hostname || this.state.applications.knative.hostname =
this.state.applications.knative.hostname; serverAppEntry.hostname || this.state.applications.knative.hostname;
} }
}); });
} }
......
...@@ -19,7 +19,7 @@ module Clusters ...@@ -19,7 +19,7 @@ module Clusters
default_value_for :version, VERSION default_value_for :version, VERSION
validates :hostname, presence: true validates :hostname, presence: true, hostname: true
def chart def chart
'knative/knative' 'knative/knative'
...@@ -37,8 +37,7 @@ module Clusters ...@@ -37,8 +37,7 @@ module Clusters
chart: chart, chart: chart,
files: files, files: files,
repository: REPOSITORY, repository: REPOSITORY,
preinstall: install_script, preinstall: install_script
postinstall: setup_knative_role
) )
end end
...@@ -47,50 +46,6 @@ module Clusters ...@@ -47,50 +46,6 @@ module Clusters
def install_script def install_script
["/usr/bin/kubectl apply -f #{ISTIO_CRDS} >/dev/null"] ["/usr/bin/kubectl apply -f #{ISTIO_CRDS} >/dev/null"]
end end
def setup_knative_role
if !cluster.kubernetes_namespace.nil?
[
"echo \'#{create_rolebinding.to_yaml}\' > /tmp/rolebinding.yaml\n",
"/usr/bin/kubectl apply -f /tmp/rolebinding.yaml > /dev/null"
]
else
nil
end
end
def create_rolebinding
{
"apiVersion" => "rbac.authorization.k8s.io/v1",
"kind" => "ClusterRoleBinding",
"metadata" => {
"name" => create_role_binding_name,
"namespace" => namespace
},
"roleRef" => {
"apiGroup" => "rbac.authorization.k8s.io",
"kind" => "ClusterRole",
"name" => "knative-serving-admin"
},
"subjects" => role_subject
}
end
def create_role_binding_name
"#{namespace}-knative-binding"
end
def service_account_name
cluster.kubernetes_namespace.service_account_name
end
def role_subject
[{ "kind" => 'ServiceAccount', "name" => service_account_name, "namespace" => namespace }]
end
def namespace
cluster.kubernetes_namespace.namespace
end
end end
end end
end end
...@@ -70,4 +70,8 @@ describe Clusters::Applications::Knative do ...@@ -70,4 +70,8 @@ describe Clusters::Applications::Knative do
expect(values).to include('domain') expect(values).to include('domain')
end end
end end
describe 'validations' do
it { is_expected.to validate_presence_of(:hostname) }
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment