Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c2097ed7
Commit
c2097ed7
authored
Nov 06, 2018
by
Chris Baumbauer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix style with clusters_store.js and remove workaround for namespace role issue
parent
26673cc8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
49 deletions
+8
-49
app/assets/javascripts/clusters/stores/clusters_store.js
app/assets/javascripts/clusters/stores/clusters_store.js
+2
-2
app/models/clusters/applications/knative.rb
app/models/clusters/applications/knative.rb
+2
-47
spec/models/clusters/applications/knative_spec.rb
spec/models/clusters/applications/knative_spec.rb
+4
-0
No files found.
app/assets/javascripts/clusters/stores/clusters_store.js
View file @
c2097ed7
...
@@ -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
;
}
}
});
});
}
}
...
...
app/models/clusters/applications/knative.rb
View file @
c2097ed7
...
@@ -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
spec/models/clusters/applications/knative_spec.rb
View file @
c2097ed7
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment