Skip to content

Commit 38acf16

Browse files
authored
Fix BYOK endpoint (#209)
1 parent ae5dd23 commit 38acf16

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/command/deploy_image.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def call # rubocop:disable Metrics/MethodLength
3535
container_name = container["name"]
3636
step("Deploying image '#{image}' for workload '#{container_name}'") do
3737
cp.workload_set_image_ref(workload, container: container_name, image: image)
38-
deployed_endpoints[container_name] = workload_data.dig("status", "endpoint")
38+
deployed_endpoints[container_name] = endpoint_for_workload(workload_data)
3939
end
4040
end
4141
end
@@ -48,6 +48,15 @@ def call # rubocop:disable Metrics/MethodLength
4848

4949
private
5050

51+
def endpoint_for_workload(workload_data)
52+
endpoint = workload_data.dig("status", "endpoint")
53+
Resolv.getaddress(endpoint.split("/").last)
54+
endpoint
55+
rescue Resolv::ResolvError
56+
deployments = cp.fetch_workload_deployments(workload_data["name"])
57+
deployments.dig("items", 0, "status", "endpoint")
58+
end
59+
5160
def run_release_script
5261
release_script = config[:release_script]
5362
run_command_in_latest_image(release_script, title: "release script")

0 commit comments

Comments
 (0)