Skip to content

Commit

Permalink
Add feature flag for backup agent type of binding
Browse files Browse the repository at this point in the history
[finishes #171725367]
  • Loading branch information
Derik Evangelista committed Mar 24, 2020
1 parent 57b62ab commit 0741ffb
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 2 deletions.
6 changes: 5 additions & 1 deletion jobs/broker/spec
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ properties:
service_catalog.maintenance_info.description:
description: maintenance information description of the impact of the maintenance update for all plans. See https://github.com/openservicebrokerapi/servicebroker/blob/master/spec.md#maintenance-info-object
default:

service_catalog.maintenance_info.public:
description: maintenance information to be returned as plain text in the service catalog for all plans
default: {}
Expand All @@ -312,3 +312,7 @@ properties:

startup_banner:
default: false

support_backup_agent_binding:
description: If the service adapter supports backup agent URL bindings, set this flag to true
default: false
1 change: 1 addition & 0 deletions jobs/broker/templates/broker.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ config = {
"use_stdin" => p('use_stdin'),
"enable_secure_manifests" => p('enable_secure_manifests'),
"enable_telemetry" => p('enable_telemetry'),
"support_backup_agent_binding" => p('support_backup_agent_binding'),
}.merge(tls_config),
"bosh" => bosh_config,
"cf" => cf_config,
Expand Down
40 changes: 40 additions & 0 deletions spec/broker_config_template_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1539,6 +1539,46 @@
end
end
end

describe 'backup agent URL binding support' do
context 'when not set' do
let(:manifest_file) do
generate_test_manifest do |yaml|
yaml['instance_groups'][0]['jobs'][0]['properties'].delete('support_backup_agent_binding')
end
end

it 'defaults to false' do
expect(rendered_template).to include 'support_backup_agent_binding: false'
end
end

context 'when disabled' do
let(:manifest_file) do
generate_test_manifest do |yaml|
yaml['instance_groups'][0]['jobs'][0]['properties']['support_backup_agent_binding'] = false
end
end

it 'is set to false' do
config = YAML.safe_load(rendered_template)
expect(config.dig('broker', 'support_backup_agent_binding')).to eq(false)
end
end

context 'when enabled' do
let(:manifest_file) do
generate_test_manifest do |yaml|
yaml['instance_groups'][0]['jobs'][0]['properties']['support_backup_agent_binding'] = true
end
end

it 'is set to trie' do
config = YAML.safe_load(rendered_template)
expect(config.dig('broker', 'support_backup_agent_binding')).to eq(true)
end
end
end
end

def generate_test_manifest
Expand Down

0 comments on commit 0741ffb

Please sign in to comment.