From a57ef1f29ff0e7418b987a445d15687e7bb57eea Mon Sep 17 00:00:00 2001 From: dougbtv Date: Tue, 10 May 2022 14:16:35 -0400 Subject: [PATCH] Removes requirement for version field for IPs [for release-v1.1 branch] This allows CNI version >= 1.0.0 formatted IP address sections to process into network-status annotations properly. --- pkg/utils/net-attach-def.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pkg/utils/net-attach-def.go b/pkg/utils/net-attach-def.go index b15c0965d..be89cc511 100644 --- a/pkg/utils/net-attach-def.go +++ b/pkg/utils/net-attach-def.go @@ -142,13 +142,7 @@ func CreateNetworkStatus(r cnitypes.Result, networkName string, defaultNetwork b } for _, ipconfig := range result.IPs { - if ipconfig.Version == "4" && ipconfig.Address.IP.To4() != nil { - netStatus.IPs = append(netStatus.IPs, ipconfig.Address.IP.String()) - } - - if ipconfig.Version == "6" && ipconfig.Address.IP.To16() != nil { - netStatus.IPs = append(netStatus.IPs, ipconfig.Address.IP.String()) - } + netStatus.IPs = append(netStatus.IPs, ipconfig.Address.IP.String()) } v1dns := convertDNS(result.DNS)