#!/bin/bash

# Get just the port numbers
portGetServicePortsOnly()
{
    local app_name="$1"
    local service_name="${2:-main}"
    
    portGetServicePorts "$app_name" "$service_name"
    local ports_result="$service_ports"
    
    if [[ -n "$ports_result" ]]; then
        # Extract just port numbers from "80:public:tcp,443:public:tcp" format
        local ports_only=""
        for port_entry in ${ports_result//,/ }; do
            local port="${port_entry%%:*}"
            if [[ -z "$ports_only" ]]; then
                ports_only="$port"
            else
                ports_only="$ports_only,$port"
            fi
        done
        service_ports_only="$ports_only"
    fi
}
