microsoft / mindaro

Bridge to Kubernetes - for Visual Studio and Visual Studio Code
MIT License
307 stars 106 forks source link

2 K8s Headless Services Causes a NullReferenceException On Start #237

Open lscpike opened 2 years ago

lscpike commented 2 years ago

Describe the bug When attempting to launch a debug session in a K8s namespace that contains 2 headless service (ClusterIP = None) b2k fails to start with the error message "Something went wrong"

To Reproduce Requires docker desktop with K8s enabled and helm installed.

helm repo add bitnami https://charts.bitnami.com/bitnami helm repo update helm install local-kafka bitnami/kafka --namespace mynamespace --create-namespace --wait

This will create 2 headless services.

Create a deployment of the service you want to debug in the same namespace. Try to debug the deployment from VS using b2k.

**Expected behavior** Bridge to kubernetes should work. **Logs** [bridge-library-2021-10-02-17-39-12-66080.txt](https://github.com/microsoft/mindaro/files/7271927/bridge-library-2021-10-02-17-39-12-66080.txt) **Environment Details** Microsoft Visual Studio Professional 2019 Version 16.10.4 Client's version: Bridge to Kubernetes 2.1.20210515.1 Operating System: Windows 10 21H1 19043.1237 **Additional context**
amsoedal commented 2 years ago

@lscpike thanks so much for reaching out. We've fixed a lot of bugs in this area with respect to headless services, but our VS releases are on a slower cadence and don't include all the fixes yet. I'll ask for an update on our next VS release, and in the meantime would it be possible for you to try this out in VS Code instead? Our latest bits should be available there.

lscpike commented 2 years ago

I just tried with VS Code and it does work! Bridge to Kubernetes initialization (VS Code v1.60.2 - Extension v1.0.120210803)

Ironically it didn't initially work due to a work around I had in place for the VS2019 version. I had modified the headless service selector labels so it did not find any endpoints. Obviously not a real work around, but enabled me to test things. This actually caused the VS Code extension to fail with a NullReferenceException.

Here's the log: bridge-library-2021-10-05-14-09-31-80660.txt

I would be grateful to know when the next VS extension release is expected. Many thanks @amsoedal.