-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing tolerations in seeder-job (#116)
* Add missing tolerations in seeder-job * Add spec * Add changeset --------- Co-authored-by: Oliver Günther <[email protected]>
- Loading branch information
1 parent
6be6b9c
commit a0fd7c3
Showing
4 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@openproject/helm-charts": minor | ||
--- | ||
|
||
Allow tolerations on seeder job |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.2.3 | ||
3.3.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# frozen_string_literal: true | ||
require 'spec_helper' | ||
|
||
describe 'tolerations' do | ||
let(:template) { HelmTemplate.new(default_values) } | ||
|
||
let(:definitions) { | ||
{ | ||
/optest-openproject-seeder/ => 'seeder' | ||
} | ||
} | ||
|
||
context 'when setting tolerations' do | ||
let(:default_values) do | ||
HelmTemplate.with_defaults(<<~YAML | ||
tolerations: | ||
- key: "key1" | ||
operator: "Equal" | ||
value: "value1" | ||
effect: "NoSchedule" | ||
YAML | ||
) | ||
end | ||
|
||
it 'adds that secret ref to relevant deployments', :aggregate_failures do | ||
definitions.each do |item, _| | ||
spec = template.template_spec(item) | ||
expect(spec['tolerations']).to be_a(Array) | ||
expect(spec['tolerations'].first['key']).to eq 'key1' | ||
end | ||
end | ||
end | ||
|
||
context 'when setting no tolerations' do | ||
let(:default_values) do | ||
{} | ||
end | ||
|
||
it 'adds the default secrets', :aggregate_failures do | ||
definitions.each do |item, _| | ||
spec = template.template_spec(item) | ||
expect(spec['tolerations']).to be_nil | ||
end | ||
end | ||
end | ||
end |