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

Arrays of objects returned by xk6-kubernetes do not have the length property #64

Closed
pablochacin opened this issue Jul 19, 2022 · 0 comments · Fixed by #65
Closed

Arrays of objects returned by xk6-kubernetes do not have the length property #64

pablochacin opened this issue Jul 19, 2022 · 0 comments · Fixed by #65

Comments

@pablochacin
Copy link
Contributor

When developing a function that waits for a service to get its load balancer ip address, I found the array of ip addresses did not have a length property, making the code below to fail:

let svc = k8sClient.services.apply( ..... )
while (svc.status.load_balancer.ingress.lenght == 0) {       // length is 'undefined' which is != '0'
    sleep(1)
    svc = k8sClient.services.get("my-service", "my-namespace")
}
let svcIp = svc.status.load_balancer.ingress[0].ip

This is due to issues in the way goja defines the length property (thanks to @mstoykov for pointing to this) and is solved by bumping the k6 version used in xk6-kubernetes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant