vscode-kubernetes-tools: targetPort does not accept integer as valid
targetPort can be an integer, but VSCode reports a linting error that it expected a “string.”
apiVersion: v1
kind: Service
metadata:
name: hello
spec:
selector:
app: hello
type: ClusterIP
ports:
- protocol: TCP
port: 80
targetPort: 8080
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 20 (3 by maintainers)
The difference between the fallback schema (which behaves correctly) and the schema given by Kubernetes itself is that in the fallback schema we have:
whereas live clusters tell us to use:
The latter feels semantically less correct, though arguably Red Hat YAML mishandled it by requiring the quotation marks; I wonder if we should raise an issue against upstream k8s to represent it using the
oneOf
form.In any case, we can massage it when we retrieve it from the cluster. And now I have a repro I can actually confirm the massaging works.
Thanks everyone for your patience. Hopefully I’ll have a fix for you soon.