Skip to content

Commit b864b7d

Browse files
committed
Add custom root links
1 parent 58ab34a commit b864b7d

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

app/controllers/runtime/root_controller.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,13 @@ def read
6060
oauth_client: config.get(:info, :app_ssh_oauth_client)
6161
}
6262
}
63-
6463
}
6564
}
6665

6766
response[:links].merge!(cloud_controller_v2(api_url_builder)) if config.get(:temporary_enable_v2)
6867

68+
response[:links].merge!(custom_links(config.get(:custom_root_links))) if config.get(:custom_root_links)
69+
6970
[200, Oj.dump(response, mode: :compat)]
7071
end
7172

@@ -98,5 +99,13 @@ def cloud_controller_v2(api_url_builder)
9899
}
99100
}
100101
end
102+
103+
def custom_links(links)
104+
hash = {}
105+
links.each do |value|
106+
hash[value['name']] = { href: value['href'] }
107+
end
108+
hash
109+
end
101110
end
102111
end

lib/cloud_controller/config_schemas/base/api_schema.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class ApiSchema < VCAP::Config
3030
optional(:app_ssh_host_key_fingerprint) => String,
3131
optional(:custom) => Hash
3232
},
33+
optional(:custom_root_links) => Array,
3334

3435
system_domain: String,
3536
optional(:system_domain_organization) => enum(String, NilClass),

0 commit comments

Comments
 (0)