Skip to content

Commit

Permalink
Fix BYOK endpoint (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzirtusss authored Jul 11, 2024
1 parent ae5dd23 commit 38acf16
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/command/deploy_image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def call # rubocop:disable Metrics/MethodLength
container_name = container["name"]
step("Deploying image '#{image}' for workload '#{container_name}'") do
cp.workload_set_image_ref(workload, container: container_name, image: image)
deployed_endpoints[container_name] = workload_data.dig("status", "endpoint")
deployed_endpoints[container_name] = endpoint_for_workload(workload_data)
end
end
end
Expand All @@ -48,6 +48,15 @@ def call # rubocop:disable Metrics/MethodLength

private

def endpoint_for_workload(workload_data)
endpoint = workload_data.dig("status", "endpoint")
Resolv.getaddress(endpoint.split("/").last)
endpoint
rescue Resolv::ResolvError
deployments = cp.fetch_workload_deployments(workload_data["name"])
deployments.dig("items", 0, "status", "endpoint")
end

def run_release_script
release_script = config[:release_script]
run_command_in_latest_image(release_script, title: "release script")
Expand Down

0 comments on commit 38acf16

Please sign in to comment.