-
Notifications
You must be signed in to change notification settings - Fork 742
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
Kubernetes Extensibility core/Service@v1
has incorrect type for targetPort
in VS Code extension
#9704
Comments
@shenglol / @anthony-c-martin / @rynowak -- is this because the type definitions we get from kubernetes is incorrect? If so, what would the process be for correcting that? |
This is actually a gap in either Bicep or the tools to extract the types and put them in Bicep. I don't remember which, I think I mentioned it in this issue: Azure/bicep-types#153 The actual type is |
ints are more common than strings for this usecase so if someone is blocked, we should tweak the definition to mandate an int. However both are valid. |
Where can I read more about this kubernetes import? Is this publicly available? |
@justinmchase We'll announce public preview for the k8s provider next week. Documentations will be published. Stay tuned 🙂. |
I was just wondering if it would be possible to put kubernetes resources in via bicep, came here looking for some clues only to find you're literally about to release it. You're like a mind reader! gj |
Unfortunately, the current limitations of the OpenAPI spec v2 and Bicep prevent us from resolving the issue with the IntOrString problem at this time. The union type int | string cannot be directly expressed in the OpenAPI spec v2, and it is also not allowed in Bicep. |
Bicep version
Bicep VSCode extension:
v0.13.1
Bicep binary:
Bicep CLI version 0.13.1 (e3ac80d678)
Describe the bug
spec.ports.targetPort
has an incorrect type. It expects a string, however it should be an int instead.Here's a valid template that deploys correctly:
However I get the following warning:
When a string is used for deployment as suggested by the tooling, the following error is returned:
To Reproduce
Paste the above Bicep into VSCode and see the warning
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: