Fix trailing comma in session server address extraction
Summary
When the GitLab Runner Helm chart is deployed on AWS EKS with an ELB LoadBalancer, the Kubernetes Service JSON populates the hostname field (not ip) in the LoadBalancer ingress status. The existing grep/cut/xargs pipeline in the set-session-server-address script captures a trailing comma from the raw JSON output, resulting in DNS lookup failures like:
tcp: lookup k8s-gitlabru-gitlabyay-cexample-1dhgdfhjkgbd5b.elb.us-gov-east-1.amazonaws.com,: no such host
Changes
- Replace the
grep/cut/xargspipelines for bothSERVICEHOSTNAMEandSERVICEIPwithsedcapture groups that extract only the value inside JSON double quotes - Consolidate the two redundant
curlcalls into a single call stored insvc_json
Test plan
- Deploy on AWS EKS with an ELB LoadBalancer and verify the session server address no longer includes a trailing comma
-
Verify session server still works when
ipfield is populated (non-AWS environments)
Edited by Ross Fisher