Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic when receiving Cloud without IPAM provider #1387

Open
jduepmeier opened this issue Mar 12, 2024 · 1 comment
Open

Panic when receiving Cloud without IPAM provider #1387

jduepmeier opened this issue Mar 12, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@jduepmeier
Copy link

Describe the bug

If the cloud configuration does not define an ipam provider a panic occurs.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x1741002]
 
goroutine 1 [running]:
github.com/vmware/load-balancer-and-ingress-services-for-kubernetes/ako-infra/avirest.AviCloudCachePopulate(0x0?, {0x1b83ff7, 0xd})
        /build/mts/release/bora-21883866/cayman_load-balancer-and-ingress-services-for-kubernetes/build/release/lin64/load-balancer-and-ingress-services-for-kubernetes/build/src/ako-infra/avirest/handle_netinfo.go:398 +0x3c2
github.com/vmware/load-balancer-and-ingress-services-for-kubernetes/ako-infra/avirest.getAviCloudFromCache(...)
        /build/mts/release/bora-21883866/cayman_load-balancer-and-ingress-services-for-kubernetes/build/release/lin64/load-balancer-and-ingress-services-for-kubernetes/build/src/ako-infra/avirest/handle_netinfo.go:345
github.com/vmware/load-balancer-and-ingress-services-for-kubernetes/ako-infra/avirest.SyncLSLRNetwork()
        /build/mts/release/bora-21883866/cayman_load-balancer-and-ingress-services-for-kubernetes/build/release/lin64/load-balancer-and-ingress-services-for-kubernetes/build/src/ako-infra/avirest/handle_netinfo.go:51 +0x110
main.InitializeAKOInfra()
        /build/mts/release/bora-21883866/cayman_load-balancer-and-ingress-services-for-kubernetes/build/release/lin64/load-balancer-and-ingress-services-for-kubernetes/build/src/cmd/infra-main/main.go:114 +0x86a
main.main()
        /build/mts/release/bora-21883866/cayman_load-balancer-and-ingress-services-for-kubernetes/build/release/lin64/load-balancer-and-ingress-services-for-kubernetes/build/src/cmd/infra-main/main.go:39 +0x17

Reproduction steps

  1. Setup a cloud without IPAM provider
  2. Run ako pod
  3. Panic occurs

Expected behavior

No panic should occur.

Additional context

I think the problem is this line:
https://github.com/vmware/load-balancer-and-ingress-services-for-kubernetes/blob/master/ako-infra/avirest/handle_netinfo.go#L399

It deferences the CloudCache.IPAMProviderRef without checking for nil.

@jduepmeier jduepmeier added the bug Something isn't working label Mar 12, 2024
@akshayhavile
Copy link
Contributor

@jduepmeier Thanks. We will look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants