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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
fc4fb6e4
Commit
fc4fb6e4
authored
Sep 01, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change CI/CD kubernetes policy keyword to `active`
parent
73d0cafb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
16 deletions
+10
-16
lib/gitlab/ci/config/entry/policy.rb
lib/gitlab/ci/config/entry/policy.rb
+1
-1
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
+3
-9
spec/lib/gitlab/ci/config/entry/policy_spec.rb
spec/lib/gitlab/ci/config/entry/policy_spec.rb
+4
-4
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+2
-2
No files found.
lib/gitlab/ci/config/entry/policy.rb
View file @
fc4fb6e4
...
...
@@ -33,7 +33,7 @@ module Gitlab
with_options
allow_nil:
true
do
validates
:refs
,
array_of_strings_or_regexps:
true
validates
:kubernetes
,
allowed_values:
%w[
configured
]
validates
:kubernetes
,
allowed_values:
%w[
active
]
end
end
end
...
...
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
View file @
fc4fb6e4
...
...
@@ -172,20 +172,14 @@ module Ci
YAML
.
dump
(
spinach:
{
stage:
'test'
,
script:
'spinach'
},
production:
{
stage:
'deploy'
,
script:
'cap'
,
only:
{
kubernetes:
'
configured
'
}
}
kubernetes:
'
active
'
}
}
)
end
context
'when kubernetes is
configured
'
do
context
'when kubernetes is
active
'
do
let
(
:project
)
{
create
(
:kubernetes_project
)
}
let
(
:pipeline
)
{
create
(
:ci_empty_pipeline
,
project:
project
)
}
before
do
create
(
:ci_variable
,
key:
'KUBE_DOMAIN'
,
protected:
false
,
project:
project
)
end
it
'returns seeds for kubernetes dependent job'
do
seeds
=
subject
.
stage_seeds
(
pipeline
)
...
...
@@ -195,7 +189,7 @@ module Ci
end
end
context
'when kubernetes is not
configured
'
do
context
'when kubernetes is not
active
'
do
it
'does not return seeds for kubernetes dependent job'
do
seeds
=
subject
.
stage_seeds
(
pipeline
)
...
...
spec/lib/gitlab/ci/config/entry/policy_spec.rb
View file @
fc4fb6e4
...
...
@@ -67,19 +67,19 @@ describe Gitlab::Ci::Config::Entry::Policy do
end
context
'when specifying kubernetes policy'
do
let
(
:config
)
{
{
kubernetes:
'
configured
'
}
}
let
(
:config
)
{
{
kubernetes:
'
active
'
}
}
it
'is a correct configuraton'
do
expect
(
entry
).
to
be_valid
expect
(
entry
.
value
).
to
eq
(
kubernetes:
'
configured
'
)
expect
(
entry
.
value
).
to
eq
(
kubernetes:
'
active
'
)
end
end
context
'when specifying invalid kubernetes policy'
do
let
(
:config
)
{
{
kubernetes:
'
active
'
}
}
let
(
:config
)
{
{
kubernetes:
'
something
'
}
}
it
'reports an error about invalid policy'
do
expect
(
entry
.
errors
).
to
include
/unknown value:
active
/
expect
(
entry
.
errors
).
to
include
/unknown value:
something
/
end
end
...
...
spec/models/ci/pipeline_spec.rb
View file @
fc4fb6e4
...
...
@@ -547,7 +547,7 @@ describe Ci::Pipeline, :mailer do
end
describe
'#has_kubernetes_active?'
do
context
'when kubernetes is
configured
'
do
context
'when kubernetes is
active
'
do
let
(
:project
)
{
create
(
:kubernetes_project
)
}
it
'returns true'
do
...
...
@@ -555,7 +555,7 @@ describe Ci::Pipeline, :mailer do
end
end
context
'when kubernetes is not
configured
'
do
context
'when kubernetes is not
active
'
do
it
'returns false'
do
expect
(
pipeline
).
not_to
have_kubernetes_active
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