Open
Description
Trying to run kubectl apply
on:
apiVersion: v1
kind: Service
metadata:
name: foo
spec:
type: ClusterIP
selector:
app: foo
results in the following error: The Service "foo" is invalid: spec.ports: Required value
. Putting ports: []
results in the same error.
The ports
field in ServiceSpec
is an Optional (List ServicePort.Type)
only because of ExternalName
Services (example taken from linked documentation):
apiVersion: v1
kind: Service
metadata:
name: my-service
namespace: prod
spec:
type: ExternalName
externalName: my.database.example.com
Similarly, externalName
is a required field for an ExternalName
ServiceSpec
but should not be specified at all for other kinds of ServiceSpec
.
Ran into this issue when the super-configuration that was generating a Kubernetes.Service.Type
had an optional field that was being mapped to the Kubernetes Service's .spec.ports
, where the field wasn't specified and the default was an empty optional.
Related: dhall-lang/dhall-lang#691
Metadata
Metadata
Assignees
Labels
No labels