Skip to content

Commit

Permalink
[Windows] Remove AddtionalParams in hcsshim.HNSEndpoint
Browse files Browse the repository at this point in the history
1. Use OVS Port externalIDs to cache the externalIDS in containerd
   runtime instead of HNSEndpoint

2. Create the OVS Interface with type "" if the host interface is
   not created (in containerd case), and update the type as "internal"
   after the host interface is created

3. Connect the OVS port to the host interface in function "reconcile" if
   the OVS port's ofport number is -1, by updating the OVS Interface type
   as "internal".

Signed-off-by: wenyingd <wenyingd@vmware.com>
  • Loading branch information
wenyingd committed Oct 29, 2021
1 parent 12f8395 commit d27ffdb
Show file tree
Hide file tree
Showing 10 changed files with 136 additions and 110 deletions.
4 changes: 0 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,3 @@ require (
sigs.k8s.io/structured-merge-diff/v4 v4.1.0 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
)

// hcshim repo is modifed to add "AdditionalParams" field to HNSEndpoint struct.
// We will use this replace before pushing the change to hcshim upstream repo.
replace github.com/Microsoft/hcsshim v0.8.9 => github.com/ruicao93/hcsshim v0.8.10-0.20210114035434-63fe00c1b9aa
11 changes: 8 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,12 @@ github.com/Mellanox/sriovnet v1.0.2 h1:VTQHD7OHU6QejTtclt5a2obDfsW1ATRxTCgZmsiKm
github.com/Mellanox/sriovnet v1.0.2/go.mod h1:pXdSZwahlvP0Xn8nuXcVthBE38Nqf2czo449p5ALLXY=
github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA=
github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw=
github.com/Microsoft/go-winio v0.4.16-0.20201130162521-d1ffc52c7331 h1:3YnB7Hpmh1lPecPE8doMOtYCrMdrpedZOvxfuNES/Vk=
github.com/Microsoft/go-winio v0.4.16-0.20201130162521-d1ffc52c7331/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0=
github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg=
github.com/Microsoft/hcsshim v0.8.9 h1:VrfodqvztU8YSOvygU+DN1BGaSGxmrNfqOv5oOuX2Bk=
github.com/Microsoft/hcsshim v0.8.9/go.mod h1:5692vkUqntj1idxauYlpoINNKeqCiG6Sg38RRsjT5y8=
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I=
github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c=
Expand Down Expand Up @@ -111,6 +114,7 @@ github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa h1:OaNxuTZr
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
github.com/confluentinc/bincover v0.1.0 h1:M4Gfj4rCXuUQVe8TqT/VXcAMjLyvN81oDRy79fjSv3o=
github.com/confluentinc/bincover v0.1.0/go.mod h1:qeI1wx0RxdGTZtrJY0HVlgJ4NqC/X2Z+fHbvy87tgHE=
github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko=
github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59 h1:qWj4qVYZ95vLWwqyNJCQg7rDsG5wPdze0UaPolH7DUk=
github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM=
github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw=
Expand Down Expand Up @@ -258,6 +262,7 @@ github.com/go-openapi/validate v0.19.8/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85n
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/gobuffalo/here v0.6.0/go.mod h1:wAG085dHOYqUpf+Ap+WOdrPTp5IYcDAs/x7PLa8Y5fM=
github.com/godbus/dbus v0.0.0-20180201030542-885f9cc04c9c/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw=
github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4=
github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
Expand Down Expand Up @@ -516,6 +521,7 @@ github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1Cpa
github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c h1:Lgl0gzECD8GnQ5QCWA8o6BtfL6mDH5rQgM4/fX3avOs=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
Expand Down Expand Up @@ -574,8 +580,6 @@ github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJ
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/ruicao93/hcsshim v0.8.10-0.20210114035434-63fe00c1b9aa h1:hHmWLNqmjp+23XdtiBZOvDf5iXze75ypta1xe/eHaW4=
github.com/ruicao93/hcsshim v0.8.10-0.20210114035434-63fe00c1b9aa/go.mod h1:NtVKoYxQuTLx6gEq0L96c9Ju4JbRJ4nY2ow3VK6a9Lg=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
Expand Down Expand Up @@ -642,6 +646,7 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw=
Expand Down Expand Up @@ -817,6 +822,7 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand Down Expand Up @@ -855,7 +861,6 @@ golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20201017003518-b09fb700fbb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201118182958-a01c418693c7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201218084310-7d0127a74742/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210110051926-789bb1bd4061/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand Down
2 changes: 1 addition & 1 deletion pkg/agent/cniserver/interface_configuration_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,6 @@ func isVeth(link netlink.Link) bool {
return isVeth
}

func (ic *ifConfigurator) getOVSInterfaceType() int {
func (ic *ifConfigurator) getOVSInterfaceType(ovsPortName string) int {
return defaultOVSInterfaceType
}
86 changes: 11 additions & 75 deletions pkg/agent/cniserver/interface_configuration_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,12 @@ import (
"github.com/Microsoft/hcsshim/hcn"
cnitypes "github.com/containernetworking/cni/pkg/types"
"github.com/containernetworking/cni/pkg/types/current"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/klog/v2"

"antrea.io/antrea/pkg/agent/interfacestore"
"antrea.io/antrea/pkg/agent/util"
cnipb "antrea.io/antrea/pkg/apis/cni/v1beta1"
"antrea.io/antrea/pkg/ovs/ovsconfig"
"antrea.io/antrea/pkg/util/k8s"
)

const (
Expand Down Expand Up @@ -179,44 +176,13 @@ func (ic *ifConfigurator) createContainerLink(endpointName string, result *curre
if err != nil {
return nil, err
}
containerIPStr, err := parseContainerIPs(result.IPs)
if err != nil {
klog.Errorf("Failed to find container %s IP", containerID)
}
// Save interface config to HNSEndpoint. It's used for creating missing OVS
// ports during antrea-agent boot stage. The change is introduced mainly for
// Containerd support. When working with Containerd runtime, antrea-agent creates
// OVS ports in an asynchronous way. So the OVS ports can be lost if antrea-agent
// gets stopped/restarted before port creation completes.
//
// The interface config will be rebuilt based on the params saved in the "AdditionalParams"
// field of HNSEndpoint.
// - endpointName: the name of the host interface without Hyper-V prefix(vEthernet).
// The name is same as the OVS port name and HNSEndpoint name.
// - containerID: used as the goroutine lock to avoid concurrency issue.
// - podName and PodNamespace: Used to identify the owner of the HNSEndpoint.
// - Other params will be passed to OVS port.
ifaceConfig := interfacestore.NewContainerInterface(
endpointName,
containerID,
podName,
podNamespace,
nil,
containerIPStr)
ovsAttachInfoData := BuildOVSPortExternalIDs(ifaceConfig)
ovsAttachInfo := make(map[string]string)
for k, v := range ovsAttachInfoData {
valueStr, _ := v.(string)
ovsAttachInfo[k] = valueStr
}
epRequest := &hcsshim.HNSEndpoint{
Name: endpointName,
VirtualNetwork: ic.hnsNetwork.Id,
DNSServerList: strings.Join(result.DNS.Nameservers, ","),
DNSSuffix: strings.Join(result.DNS.Search, ","),
GatewayAddress: containerIP.Gateway.String(),
IPAddress: containerIP.Address.IP,
AdditionalParams: ovsAttachInfo,
Name: endpointName,
VirtualNetwork: ic.hnsNetwork.Id,
DNSServerList: strings.Join(result.DNS.Nameservers, ","),
DNSSuffix: strings.Join(result.DNS.Search, ","),
GatewayAddress: containerIP.Gateway.String(),
IPAddress: containerIP.Address.IP,
}
hnsEP, err := epRequest.Create()
if err != nil {
Expand All @@ -227,40 +193,6 @@ func (ic *ifConfigurator) createContainerLink(endpointName string, result *curre
return hnsEP, nil
}

func (ic *ifConfigurator) getInterfaceConfigForPods(pods sets.String) map[string]*interfacestore.InterfaceConfig {
interfaces := make(map[string]*interfacestore.InterfaceConfig)
ic.epCache.Range(func(key, value interface{}) bool {
ep, _ := value.(*hcsshim.HNSEndpoint)
ifConfig := parseOVSPortInterfaceConfigFromHNSEndpoint(ep)
if ifConfig == nil {
return true
}
namespacedName := k8s.NamespacedName(ifConfig.PodNamespace, ifConfig.PodName)
if pods.Has(namespacedName) {
interfaces[namespacedName] = ifConfig
}
return true
})
return interfaces
}

func parseOVSPortInterfaceConfigFromHNSEndpoint(ep *hcsshim.HNSEndpoint) *interfacestore.InterfaceConfig {
portData := &ovsconfig.OVSPortData{
Name: ep.Name,
ExternalIDs: ep.AdditionalParams,
}
ifaceConfig := ParseOVSPortInterfaceConfig(portData, nil, false)
if ifaceConfig != nil {
var err error
ifaceConfig.MAC, err = net.ParseMAC(ep.MacAddress)
if err != nil {
klog.Errorf("Failed to parse MAC address from HNSEndpoint %s: %v", ep.MacAddress, err)
return nil
}
}
return ifaceConfig
}

// attachContainerLink takes the result of the IPAM plugin, and adds the appropriate IP
// addresses and routes to the interface.
// For different CRI runtimes we need to use the appropriate Windows container API:
Expand Down Expand Up @@ -515,7 +447,11 @@ func (ic *ifConfigurator) getInterceptedInterfaces(
}

// getOVSInterfaceType returns "internal". Windows uses internal OVS interface for container vNIC.
func (ic *ifConfigurator) getOVSInterfaceType() int {
func (ic *ifConfigurator) getOVSInterfaceType(ovsPortName string) int {
ifaceName := fmt.Sprintf("vEthernet (%s)", ovsPortName)
if !util.HostInterfaceExists(ifaceName) {
return defaultOVSInterfaceType
}
return internalOVSInterfaceType
}

Expand Down
39 changes: 27 additions & 12 deletions pkg/agent/cniserver/pod_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ func (pc *podConfigurator) configureInterfaces(
func (pc *podConfigurator) createOVSPort(ovsPortName string, ovsAttachInfo map[string]interface{}) (string, error) {
var portUUID string
var err error
switch pc.ifConfigurator.getOVSInterfaceType() {
switch pc.ifConfigurator.getOVSInterfaceType(ovsPortName) {
case internalOVSInterfaceType:
portUUID, err = pc.ovsBridgeClient.CreateInternalPort(ovsPortName, 0, ovsAttachInfo)
default:
Expand Down Expand Up @@ -416,7 +416,14 @@ func (pc *podConfigurator) reconcile(pods []corev1.Pod, containerAccess *contain
desiredPods.Insert(k8s.NamespacedName(pod.Namespace, pod.Name))
}

missingIfConfigs := make([]*interfacestore.InterfaceConfig, 0)
for _, containerConfig := range knownInterfaces {
// Find the OVS ports which are not connected to host interfaces, this is useful on Windows if the runtime is
// containerd, because the host interface is created async from the OVS port.
if containerConfig.OFPort == -1 {
missingIfConfigs = append(missingIfConfigs, containerConfig)
continue
}
namespacedName := k8s.NamespacedName(containerConfig.PodNamespace, containerConfig.PodName)
actualPods.Insert(namespacedName)
if desiredPods.Has(namespacedName) {
Expand All @@ -442,9 +449,9 @@ func (pc *podConfigurator) reconcile(pods []corev1.Pod, containerAccess *contain
// interface should no longer be in store after the call to removeInterfaces
}
}

missingPods := desiredPods.Difference(actualPods)
pc.reconcileMissingPods(missingPods, containerAccess)
if len(missingIfConfigs) > 0 {
pc.reconcileMissingPods(missingIfConfigs, containerAccess)
}
return nil
}

Expand All @@ -465,15 +472,9 @@ func (pc *podConfigurator) connectInterfaceToOVSCommon(ovsPortName string, conta
}()

// GetOFPort will wait for up to 1 second for OVSDB to report the OFPort number.
ofPort, err := pc.ovsBridgeClient.GetOFPort(ovsPortName)
ofPort, err := pc.installPodFlows(ovsPortName, containerConfig)
if err != nil {
return fmt.Errorf("failed to get of_port of OVS port %s: %v", ovsPortName, err)
}

klog.V(2).Infof("Setting up Openflow entries for container %s", containerID)
err = pc.ofClient.InstallPodFlows(ovsPortName, containerConfig.IPs, containerConfig.MAC, uint32(ofPort))
if err != nil {
return fmt.Errorf("failed to add Openflow entries for container %s: %v", containerID, err)
return err
}
containerConfig.OVSPortConfig = &interfacestore.OVSPortConfig{PortUUID: portUUID, OFPort: ofPort}
// Add containerConfig into local cache
Expand All @@ -485,6 +486,20 @@ func (pc *podConfigurator) connectInterfaceToOVSCommon(ovsPortName string, conta
return nil
}

func (pc *podConfigurator) installPodFlows(ovsPortName string, containerConfig *interfacestore.InterfaceConfig) (int32, error) {
// GetOFPort will wait for up to 1 second for OVSDB to report the OFPort number.
ofPort, err := pc.ovsBridgeClient.GetOFPort(ovsPortName)
if err != nil {
return 0, fmt.Errorf("failed to get of_port of OVS port %s: %v", ovsPortName, err)
}
containerID := containerConfig.ContainerID
klog.V(2).Infof("Setting up Openflow entries for container %s", containerID)
if err := pc.ofClient.InstallPodFlows(ovsPortName, containerConfig.IPs, containerConfig.MAC, uint32(ofPort)); err != nil {
return 0, fmt.Errorf("failed to add Openflow entries for container %s: %v", containerID, err)
}
return ofPort, nil
}

// disconnectInterfaceFromOVS disconnects an existing interface from ovs br-int.
func (pc *podConfigurator) disconnectInterfaceFromOVS(containerConfig *interfacestore.InterfaceConfig) error {
containerID := containerConfig.ContainerID
Expand Down
8 changes: 4 additions & 4 deletions pkg/agent/cniserver/pod_configuration_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package cniserver

import (
"github.com/containernetworking/cni/pkg/types/current"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/klog/v2"

"antrea.io/antrea/pkg/agent/interfacestore"
Expand All @@ -41,8 +40,8 @@ func (pc *podConfigurator) connectInterfaceToOVS(
return containerConfig, pc.connectInterfaceToOVSCommon(ovsPortName, containerConfig)
}

func (pc *podConfigurator) reconcileMissingPods(pods sets.String, containerAccess *containerAccessArbitrator) {
for pod := range pods {
func (pc *podConfigurator) reconcileMissingPods(ifConfigs []*interfacestore.InterfaceConfig, containerAccess *containerAccessArbitrator) {
for i := range ifConfigs {
// This should not happen since OVSDB is persisted on the Node.
// TODO: is there anything else we should be doing? Assuming that the Pod's
// interface still exists, we can repair the interface store since we can
Expand All @@ -52,6 +51,7 @@ func (pc *podConfigurator) reconcileMissingPods(pods sets.String, containerAcces
// we store in the cache, but this ID is not used for anything at the
// moment. However, if the interface does not exist, there is nothing we can
// do since we do not have the original CNI parameters.
klog.Warningf("Interface for Pod %s not found in the interface store", pod)
ifaceConfig := ifConfigs[i]
klog.Warningf("Interface for Pod %s/%s not found in the interface store", ifaceConfig.PodNamespace, ifaceConfig.PodName)
}
}
Loading

0 comments on commit d27ffdb

Please sign in to comment.