Bug 1877060

Summary: Whereabouts IPAM CNI IPv6 addresses with single colon aren't properly converted to DNS-1123 name in OCP 4.5
Product: OpenShift Container Platform Reporter: Douglas Smith <dosmith>
Component: NetworkingAssignee: Douglas Smith <dosmith>
Networking sub component: multus QA Contact: Weibin Liang <weliang>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high    
Version: 4.6   
Target Milestone: ---   
Target Release: 4.6.0   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1877065 (view as bug list) Environment:
Last Closed: 2020-10-27 16:38:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1877065    

Description Douglas Smith 2020-09-08 18:53:34 UTC
This particular problem was found and fixed in 4.6 during a feature enhancement, however, we didn't identify that this was still a problem in 4.5.

Basically, when using any IPv6 address with a single colon, the CR name wouldn't be properly converted from IPv6 address into DNS-1123 name for the CR.

---------------------- Original report

oc edit networks.operator.openshift.io cluster 

  - name: test-network-1
    namespace: dieter
    rawCNIConfig: '{ "cniVersion": "0.3.0", "name": "test-network-1", "type": "ipvlan",
      "master": "ens9", "mode": "l2", "ipam": { "type": "whereabouts", "range": "fd00:0:0:10:0:0:3:1-fd00:0:0:10:0:0:3:6/64"
      } , "log_file" : "/tmp/whereabouts.log", "log_level" : "debug"}'
    type: Raw

Creates the network-attachment-definition with the correct range, but when creating the pod, I get following error:

Error assigning IP: k8s create error: IPPool.whereabouts.cni.cncf.io "fd00:0:0:10--64" is invalid: metadata.name: Invalid value: "fd00:0:0:10--64": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

Comment 4 Weibin Liang 2020-09-10 14:20:12 UTC
Tested and verified in 4.6.0-0.nightly-2020-09-10-082657

[weliang@weliang ~]$ oc describe pod | grep fd00
  Normal  AddedInterface  3m56s      multus                                               Add net1 [fd00:dead:beef::1/64] from test/macvlan-bridge-whereabouts
  Normal  AddedInterface  2m34s      multus                                               Add net1 [fd00:dead:beef::2/64] from test/macvlan-bridge-whereabouts
  Normal  AddedInterface  2m28s      multus                                               Add net1 [fd00:dead:beef::3/64] from test/macvlan-bridge-whereabouts
  Normal  AddedInterface  2m23s      multus                                               Add net1 [fd00:dead:beef::4/64] from test/macvlan-bridge-whereabouts
  Normal  AddedInterface  2m17s      multus                                               Add net1 [fd00:dead:beef::5/64] from test/macvlan-bridge-whereabouts

Comment 6 errata-xmlrpc 2020-10-27 16:38:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (OpenShift Container Platform 4.6 GA Images), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.