k8snetworkplumbingwg / net-attach-def-admission-controller

An admission controller to check resources as defined by the NPWG spec
Apache License 2.0
4 stars 15 forks source link

Default route selection annotation will require update to admission controller #29

Open dougbtv opened 5 years ago

dougbtv commented 5 years ago

While testing updates to Multus, I encountered this one:

[centos@kube-singlehost-master multus-cni]$ cat <<EOF | kubectl create -f -
> apiVersion: v1
> kind: Pod
> metadata:
>   name: samplepod
>   annotations:
>     k8s.v1.cni.cncf.io/networks: '{
>       "name": "macvlan-conf",
>       "default-route": ["192.168.2.1"]
>     }'
> spec:
>   containers:
>   - name: samplepod
>     command: ["/bin/bash", "-c", "trap : TERM INT; sleep infinity & wait"]
>     image: dougbtv/centos-network
> EOF
Error from server: error when creating "STDIN": admission webhook "net-attach-def-admission-controller-isolating-config.k8s.io" denied the request: parsePodNetworkAnnotation: failed to parse pod Network Attachment Selection Annotation JSON format: json: cannot unmarshal object into Go value of type []*types.NetworkSelectionElement

Looks like we'll need to update this to account for that field.