diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-09-01 14:03:43 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-09-01 14:04:08 +0300 |
commit | fc4fb6e4d212d5cf406a08c96ba8c423477a5408 (patch) | |
tree | 058147ce1ca9636defb733d076a4c25be4995fd1 | |
parent | 73d0cafbe4acf5a14ec196c3cfb38be4e84b67d9 (diff) |
Change CI/CD kubernetes policy keyword to `active`
-rw-r--r-- | lib/gitlab/ci/config/entry/policy.rb | 2 | ||||
-rw-r--r-- | spec/lib/ci/gitlab_ci_yaml_processor_spec.rb | 12 | ||||
-rw-r--r-- | spec/lib/gitlab/ci/config/entry/policy_spec.rb | 8 | ||||
-rw-r--r-- | spec/models/ci/pipeline_spec.rb | 4 |
4 files changed, 10 insertions, 16 deletions
diff --git a/lib/gitlab/ci/config/entry/policy.rb b/lib/gitlab/ci/config/entry/policy.rb index 922d568f0ab..0027e9ec8c5 100644 --- a/lib/gitlab/ci/config/entry/policy.rb +++ b/lib/gitlab/ci/config/entry/policy.rb @@ -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 diff --git a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb index e8908ebec8d..c25800206b8 100644 --- a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb +++ b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb @@ -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) diff --git a/spec/lib/gitlab/ci/config/entry/policy_spec.rb b/spec/lib/gitlab/ci/config/entry/policy_spec.rb index a5c2e3f1989..5e83abf645b 100644 --- a/spec/lib/gitlab/ci/config/entry/policy_spec.rb +++ b/spec/lib/gitlab/ci/config/entry/policy_spec.rb @@ -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 diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb index cf4896ff188..84656ffe0b9 100644 --- a/spec/models/ci/pipeline_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -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 |