Azure / Azure/azure-functions-core-tools
Kubernetes Deploy - Invalid URI exception when only hostname populated in LoadBalancer
- Dominant language
- C#
- Stars
- 1.5k
- Forks
- 498
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 14
Description
When deploying using the `func kubernetes deploy` command on local k8s (Docker Desktop), an `Invalid URI: The hostname could not be parsed` exception is thrown due to a null LoadBalancer Ingress IP address here: https://github.com/Azure/azure-functions-core-tools/blob/v4.x/src/Azure.Functions.Cli/Kubernetes/KubernetesHelpers.cs#L440
This occurs because only hostname is populated, and not the expected IP address.
```yaml
status:
loadBalancer:
ingress:
- hostname: localhost
```
A fix to allow either IP address or hostname appears to have been made for the KNative platform, but was not ported to `KubernetesHelpers`. See https://github.com/Azure/azure-functions-core-tools/pull/1222
Contributor guide
Research direction
Start in src/Azure.Functions.Cli/Kubernetes/KubernetesHelpers.cs around line 440 and compare the existing KNative handling referenced in pull request 1222. Reproduce the local Kubernetes deployment case with a LoadBalancer ingress containing only hostname: localhost, then verify that func kubernetes deploy accepts either a hostname or an IP address without throwing the Invalid URI exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, kubernetes
- Domain
- cli, devops
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100