@@ -81,7 +81,7 @@ func (p *IPAMPlugin) CmdAdd(args *cniSkel.CmdArgs) error {
8181 p .logger .Debug ("Making request to CNS" )
8282 // if this fails, the caller plugin should execute again with cmdDel before returning error.
8383 // https://www.cni.dev/docs/spec/#delegated-plugin-execution-procedure
84- resp , err := p .cnsClient .RequestIPs (context .TODO (), req )
84+ resp , err := p .cnsClient .RequestIPs (context .TODO (), req ) // need to add interfaces to this response
8585 if err != nil {
8686 if cnscli .IsUnsupportedAPI (err ) {
8787 p .logger .Error ("Failed to request IPs using RequestIPs from CNS, going to try RequestIPAddress" , zap .Error (err ), zap .Any ("request" , req ))
@@ -113,9 +113,10 @@ func (p *IPAMPlugin) CmdAdd(args *cniSkel.CmdArgs) error {
113113 }
114114 }
115115 p .logger .Debug ("Received CNS IP config response" , zap .Any ("response" , resp ))
116+ // resp.PodIPInfo
116117
117118 // Get Pod IP and gateway IP from ip config response
118- podIPNet , err := ipconfig .ProcessIPConfigsResp (resp )
119+ podIPNet , gatewayIP , err := ipconfig .ProcessIPConfigsResp (resp ) // need to get interfaces out of the response and add it here
119120 if err != nil {
120121 p .logger .Error ("Failed to interpret CNS IPConfigResponse" , zap .Error (err ), zap .Any ("response" , resp ))
121122 return cniTypes .NewError (ErrProcessIPConfigResponse , err .Error (), "failed to interpret CNS IPConfigResponse" )
@@ -130,14 +131,24 @@ func (p *IPAMPlugin) CmdAdd(args *cniSkel.CmdArgs) error {
130131 IP : net .ParseIP (ipNet .Addr ().String ()),
131132 Mask : net .CIDRMask (ipNet .Bits (), 32 ), // nolint
132133 }
134+ ipConfig .Gateway = (* gatewayIP )[i ]
133135 } else {
134136 ipConfig .Address = net.IPNet {
135137 IP : net .ParseIP (ipNet .Addr ().String ()),
136138 Mask : net .CIDRMask (ipNet .Bits (), 128 ), // nolint
137139 }
140+ ipConfig .Gateway = net .ParseIP ("fd00:aec6:6946:1::" )
138141 }
139142 cniResult .IPs [i ] = ipConfig
140143 }
144+ cniResult .Interfaces = make ([]* types100.Interface , 1 )
145+ interface_test := & types100.Interface {
146+ Name : "eth1" ,
147+ Mac : "00:0D:3A:FE:1E:B2" ,
148+ }
149+ cniResult .Interfaces [0 ] = interface_test
150+
151+ p .logger .Info ("Created CNIResult:" , zap .Any ("result" , cniResult ))
141152
142153 // Get versioned result
143154 versionedCniResult , err := cniResult .GetAsVersion (nwCfg .CNIVersion )
0 commit comments