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
99a816a1
Commit
99a816a1
authored
Nov 13, 2018
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-11-13
parents
435d2595
9cebb1e4
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
78 additions
and
12 deletions
+78
-12
app/assets/stylesheets/pages/issuable.scss
app/assets/stylesheets/pages/issuable.scss
+0
-6
app/models/clusters/kubernetes_namespace.rb
app/models/clusters/kubernetes_namespace.rb
+2
-0
app/models/clusters/platforms/kubernetes.rb
app/models/clusters/platforms/kubernetes.rb
+1
-1
app/views/admin/background_jobs/show.html.haml
app/views/admin/background_jobs/show.html.haml
+4
-1
changelogs/unreleased/53879-kube-token-nil.yml
changelogs/unreleased/53879-kube-token-nil.yml
+5
-0
doc/development/fe_guide/vue.md
doc/development/fe_guide/vue.md
+8
-0
doc/integration/google.md
doc/integration/google.md
+1
-1
spec/factories/clusters/kubernetes_namespaces.rb
spec/factories/clusters/kubernetes_namespaces.rb
+1
-1
spec/models/clusters/kubernetes_namespace_spec.rb
spec/models/clusters/kubernetes_namespace_spec.rb
+16
-0
spec/models/clusters/platforms/kubernetes_spec.rb
spec/models/clusters/platforms/kubernetes_spec.rb
+39
-1
spec/models/project_spec.rb
spec/models/project_spec.rb
+1
-1
No files found.
app/assets/stylesheets/pages/issuable.scss
View file @
99a816a1
...
...
@@ -47,12 +47,6 @@
@extend
.fixed-width-container
;
}
}
.diffs
{
.mr-version-controls
{
@extend
.fixed-width-container
;
}
}
}
.issuable-details
{
...
...
app/models/clusters/kubernetes_namespace.rb
View file @
99a816a1
...
...
@@ -22,6 +22,8 @@ module Clusters
key:
Settings
.
attr_encrypted_db_key_base_truncated
,
algorithm:
'aes-256-cbc'
scope
:has_service_account_token
,
->
{
where
.
not
(
encrypted_service_account_token:
nil
)
}
def
token_name
"
#{
namespace
}
-token"
end
...
...
app/models/clusters/platforms/kubernetes.rb
View file @
99a816a1
...
...
@@ -85,7 +85,7 @@ module Clusters
.
append
(
key:
'KUBE_CA_PEM_FILE'
,
value:
ca_pem
,
file:
true
)
end
if
kubernetes_namespace
=
cluster
.
kubernetes_namespaces
.
find_by
(
project:
project
)
if
kubernetes_namespace
=
cluster
.
kubernetes_namespaces
.
has_service_account_token
.
find_by
(
project:
project
)
variables
.
concat
(
kubernetes_namespace
.
predefined_variables
)
else
# From 11.5, every Clusters::Project should have at least one
...
...
app/views/admin/background_jobs/show.html.haml
View file @
99a816a1
...
...
@@ -34,10 +34,13 @@
.clearfix
%p
%i
.fa.fa-exclamation-circle
If '[
#{
@concurrency
}
of
#{
@concurrency
}
busy]' is shown, restart GitLab with 'sudo service gitlab reload'.
If '[
#{
@concurrency
}
of
#{
@concurrency
}
busy]' is shown, restart GitLab.
=
link_to
sprite_icon
(
'question'
,
size:
16
),
help_page_path
(
'administration/restart_gitlab'
)
%p
%i
.fa.fa-exclamation-circle
If more than one sidekiq process is listed, stop GitLab, kill the remaining sidekiq processes (sudo pkill -u
#{
gitlab_config
.
user
}
-f sidekiq) and restart GitLab.
=
link_to
sprite_icon
(
'question'
,
size:
16
),
help_page_path
(
'administration/restart_gitlab'
)
...
...
changelogs/unreleased/53879-kube-token-nil.yml
0 → 100644
View file @
99a816a1
---
title
:
Fix deployment jobs using nil KUBE_TOKEN due to migration issue
merge_request
:
23009
author
:
type
:
fixed
doc/development/fe_guide/vue.md
View file @
99a816a1
...
...
@@ -221,6 +221,14 @@ const vm = mountComponent(Component, data);
The main return value of a Vue component is the rendered output. In order to test the component we
need to test the rendered output.
[
Vue
][
vue-test
]
guide's to unit test show us exactly that:
## Vue.js Expert Role
One should apply to be a Vue.js expert by opening an MR when the Merge Request's they create and review show:
-
Deep understanding of Vue and Vuex reactivy
-
Vue and Vuex code are structured according to both official and our guidelines
-
Full understanding of testing a Vue and Vuex application
-
Vuex code follows the
[
documented pattern
](
./vuex.md#actions-pattern-request-and-receive-namespaces
)
-
Knowledge about the existing Vue and Vuex applications and existing reusable components
[
vue-docs
]:
http://vuejs.org/guide/index.html
[
issue-boards
]:
https://gitlab.com/gitlab-org/gitlab-ce/tree/master/app/assets/javascripts/boards
...
...
doc/integration/google.md
View file @
99a816a1
...
...
@@ -35,7 +35,7 @@ In Google's side:
1.
You should now be able to see a Client ID and Client secret. Note them down
or keep this page open as you will need them later.
1.
From the
**Dashboard**
select
**ENABLE APIS AND SERVICES >
Compute
> Google+ API > Enable**
1.
From the
**Dashboard**
select
**ENABLE APIS AND SERVICES >
Social
> Google+ API > Enable**
1.
To enable projects to access
[
Google Kubernetes Engine
](
../user/project/clusters/index.md
)
, you must also
enable these APIs:
-
Google Kubernetes Engine API
...
...
spec/factories/clusters/kubernetes_namespaces.rb
View file @
99a816a1
...
...
@@ -13,7 +13,7 @@ FactoryBot.define do
end
trait
:with_token
do
service_account_token
{
Faker
::
Lorem
.
characters
(
10
)
}
service_account_token
{
F
F
aker
::
Lorem
.
characters
(
10
)
}
end
end
end
spec/models/clusters/kubernetes_namespace_spec.rb
View file @
99a816a1
...
...
@@ -8,6 +8,22 @@ RSpec.describe Clusters::KubernetesNamespace, type: :model do
it
{
is_expected
.
to
belong_to
(
:cluster
)
}
it
{
is_expected
.
to
have_one
(
:platform_kubernetes
)
}
describe
'has_service_account_token'
do
subject
{
described_class
.
has_service_account_token
}
context
'namespace has service_account_token'
do
let!
(
:namespace
)
{
create
(
:cluster_kubernetes_namespace
,
:with_token
)
}
it
{
is_expected
.
to
include
(
namespace
)
}
end
context
'namespace has no service_account_token'
do
let!
(
:namespace
)
{
create
(
:cluster_kubernetes_namespace
)
}
it
{
is_expected
.
not_to
include
(
namespace
)
}
end
end
describe
'namespace uniqueness validation'
do
let
(
:cluster_project
)
{
create
(
:cluster_project
)
}
let
(
:kubernetes_namespace
)
{
build
(
:cluster_kubernetes_namespace
,
namespace:
'my-namespace'
)
}
...
...
spec/models/clusters/platforms/kubernetes_spec.rb
View file @
99a816a1
...
...
@@ -210,9 +210,11 @@ describe Clusters::Platforms::Kubernetes, :use_clean_rails_memory_store_caching
let
(
:api_url
)
{
'https://kube.domain.com'
}
let
(
:ca_pem
)
{
'CA PEM DATA'
}
subject
{
kubernetes
.
predefined_variables
(
project:
cluster
.
project
)
}
shared_examples
'setting variables'
do
it
'sets the variables'
do
expect
(
kubernetes
.
predefined_variables
(
project:
cluster
.
project
)
).
to
include
(
expect
(
subject
).
to
include
(
{
key:
'KUBE_URL'
,
value:
api_url
,
public:
true
},
{
key:
'KUBE_CA_PEM'
,
value:
ca_pem
,
public:
true
},
{
key:
'KUBE_CA_PEM_FILE'
,
value:
ca_pem
,
public:
true
,
file:
true
}
...
...
@@ -220,6 +222,30 @@ describe Clusters::Platforms::Kubernetes, :use_clean_rails_memory_store_caching
end
end
context
'kubernetes namespace is created with no service account token'
do
let!
(
:kubernetes_namespace
)
{
create
(
:cluster_kubernetes_namespace
,
cluster:
cluster
)
}
it_behaves_like
'setting variables'
it
'sets KUBE_TOKEN'
do
expect
(
subject
).
to
include
(
{
key:
'KUBE_TOKEN'
,
value:
kubernetes
.
token
,
public:
false
}
)
end
end
context
'kubernetes namespace is created with no service account token'
do
let!
(
:kubernetes_namespace
)
{
create
(
:cluster_kubernetes_namespace
,
:with_token
,
cluster:
cluster
)
}
it_behaves_like
'setting variables'
it
'sets KUBE_TOKEN'
do
expect
(
subject
).
to
include
(
{
key:
'KUBE_TOKEN'
,
value:
kubernetes_namespace
.
service_account_token
,
public:
false
}
)
end
end
context
'namespace is provided'
do
let
(
:namespace
)
{
'my-project'
}
...
...
@@ -228,12 +254,24 @@ describe Clusters::Platforms::Kubernetes, :use_clean_rails_memory_store_caching
end
it_behaves_like
'setting variables'
it
'sets KUBE_TOKEN'
do
expect
(
subject
).
to
include
(
{
key:
'KUBE_TOKEN'
,
value:
kubernetes
.
token
,
public:
false
}
)
end
end
context
'no namespace provided'
do
let
(
:namespace
)
{
kubernetes
.
actual_namespace
}
it_behaves_like
'setting variables'
it
'sets KUBE_TOKEN'
do
expect
(
subject
).
to
include
(
{
key:
'KUBE_TOKEN'
,
value:
kubernetes
.
token
,
public:
false
}
)
end
end
end
...
...
spec/models/project_spec.rb
View file @
99a816a1
...
...
@@ -2696,7 +2696,7 @@ describe Project do
end
context
'when user configured kubernetes from CI/CD > Clusters and KubernetesNamespace migration has been executed'
do
let!
(
:kubernetes_namespace
)
{
create
(
:cluster_kubernetes_namespace
)
}
let!
(
:kubernetes_namespace
)
{
create
(
:cluster_kubernetes_namespace
,
:with_token
)
}
let!
(
:cluster
)
{
kubernetes_namespace
.
cluster
}
let
(
:project
)
{
kubernetes_namespace
.
project
}
...
...
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