Skip to content
This repository was archived by the owner on Jun 2, 2021. It is now read-only.

Commit 4b199d8

Browse files
Sannidhi Jalukartcdowney
andcommitted
use configurable port for task completion callbacks on K8s
[#174455375](https://www.pivotaltracker.com/story/show/174455375) Co-authored-by: Sannidhi Jalukar <sjalukar@pivotal.io> Co-authored-by: Tim Downey <tdowney@vmware.com>
1 parent 4a5ae0a commit 4b199d8

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

lib/cloud_controller/config_schemas/api_schema.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class ApiSchema < VCAP::Config
1313
tls_port: Integer,
1414
external_protocol: String,
1515
internal_service_hostname: String,
16+
optional(:internal_service_port) => Integer,
1617
info: {
1718
name: String,
1819
build: String,

lib/cloud_controller/diego/task_completion_callback_generator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def initialize(config=Config.config)
77

88
def generate(task)
99
if @config.kubernetes_api_configured?
10-
port = 80
10+
port = @config.get(:internal_service_port)
1111
schema = 'http'
1212
else
1313
port = @config.get(:tls_port)

spec/unit/lib/cloud_controller/diego/task_completion_callback_generator_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ module Diego
1212
let(:task_config) do
1313
{
1414
internal_service_hostname: 'google.com',
15+
internal_service_port: '9090',
1516
tls_port: '8888',
1617
kubernetes: kubernetes_config,
1718
}
@@ -38,7 +39,7 @@ module Diego
3839

3940
it 'configures the callback url with http and relies on Istio for mTLS' do
4041
expect(generator.generate(task)).to eq(
41-
"http://google.com:80/internal/v4/tasks/#{task.guid}/completed"
42+
"http://google.com:9090/internal/v4/tasks/#{task.guid}/completed"
4243
)
4344
end
4445
end

0 commit comments

Comments
 (0)