Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update logging levels #23

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions pkg/agent/cniserver/pod_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func setupInterface(podName string, podNamespace string, ifname string, netns ns
if err != nil {
return err
}
klog.Infof("Setup interfaces host: %s, container %s", hostVeth.Name, containerVeth.Name)
klog.V(2).Infof("Setup interfaces host: %s, container %s", hostVeth.Name, containerVeth.Name)
containerIface.Name = containerVeth.Name
containerIface.Mac = containerVeth.HardwareAddr.String()
containerIface.Sandbox = netns.Path()
Expand Down Expand Up @@ -152,7 +152,7 @@ func validateContainerPeerInterface(hostIntf *current.Interface, containerVeth *
}
_, isVeth := link.(*netlink.Veth)
if !isVeth {
klog.Infof("Link %s is not created by CNI", hostIntf.Name)
klog.V(2).Infof("Link %s is not created by CNI", hostIntf.Name)
return hostVeth, nil
}
linkName := link.Attrs().Name
Expand Down Expand Up @@ -290,7 +290,7 @@ func removeContainerLink(containerID string, containerNetns string, ifname strin
_, err = ip.DelLinkByNameAddr(ifname)
if err != nil && err == ip.ErrLinkNotFound {
// Not found link should return success for deletion
klog.Infof("Interface %s not found in netns %s", ifname, containerNetns)
klog.V(2).Infof("Interface %s not found in netns %s", ifname, containerNetns)
return nil
}
return err
Expand Down Expand Up @@ -321,18 +321,18 @@ func removeInterfaces(
// many resources as possible (e.g. releasing IPAM allocations) and return a
// successful response.
// In our case it means deleting the OVS port.
klog.Infof("Target netns not specified, not removing veth pair")
klog.V(2).Infof("Target netns not specified, not removing veth pair")
}

containerConfig, found := ifaceStore.GetContainerInterface(podName, podNamespace)
if !found {
klog.Infof("Did not find the port for container %s in local cache", containerID)
klog.V(2).Infof("Did not find the port for container %s in local cache", containerID)
return nil
}

portUUID := containerConfig.PortUUID
ovsPortName := containerConfig.IfaceName
klog.Infof("Delete OVS port with UUID %s peer container %s", portUUID, containerID)
klog.V(2).Infof("Delete OVS port with UUID %s peer container %s", portUUID, containerID)
// Remove openflow entries of target container
if err := ofClient.UninstallPodFlows(ovsPortName); err != nil {
klog.Errorf("Failed to delete Openflow entries for container %s: %v", containerID, err)
Expand Down Expand Up @@ -429,7 +429,7 @@ func validateOVSPort(ifaceStore agent.InterfaceStore, ovsPortName string, contai
}
return fmt.Errorf("failed to find a valid IP equal to attached address")
} else {
klog.Infof("Not found container %s config from local cache", containerID)
klog.V(2).Infof("Not found container %s config from local cache", containerID)
return fmt.Errorf("not found OVS port %s", ovsPortName)
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/agent/interface_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (c *interfaceCache) Initialize(ovsBridgeClient ovsconfig.OVSBridgeClient, g
intf = &InterfaceConfig{Type: TunnelInterface, OVSPortConfig: ovsPort, ID: tunnelPort}
default:
if port.ExternalIDs == nil {
klog.Infof("OVS port %s has no external_ids, continue to next", port.Name)
klog.V(2).Infof("OVS port %s has no external_ids, continue to next", port.Name)
continue
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/networkpolicy/networkpolicy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,6 @@ func (n *NetworkPolicyController) syncNetworkPolicy(key string) error {
if err != nil {
return fmt.Errorf("failed to get NetworkPolicy %s: %v", key, err)
}
klog.Infof("Syncing NetworkPolicy %s: %v", key, networkPolicy.Spec.PodSelector)
klog.V(1).Infof("Syncing NetworkPolicy %s: %v", key, networkPolicy.Spec.PodSelector)
return nil
}
8 changes: 4 additions & 4 deletions pkg/monitor/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@ func (monitor *controllerMonitor) createControllerCRD(controllerCRD *v1beta1.Ant
NodeRef: monitor.GetSelfNode(),
ServiceRef: monitor.GetService(),
}
klog.Infof("Creating controller monitor CRD %v", controllerCRD)
klog.V(2).Infof("Creating controller monitor CRD %v", controllerCRD)
return monitor.client.ClusterinformationV1beta1().AntreaControllerInfos().Create(controllerCRD)
}

// TODO: Update network policy related fields when the upstreaming is ready
func (monitor *controllerMonitor) updateControllerCRD(controllerCRD *v1beta1.AntreaControllerInfo) (*v1beta1.AntreaControllerInfo, error) {
klog.Infof("Updating controller monitor CRD %v", controllerCRD)
klog.V(2).Infof("Updating controller monitor CRD %v", controllerCRD)
return monitor.client.ClusterinformationV1beta1().AntreaControllerInfos().Update(controllerCRD)
}

Expand All @@ -132,14 +132,14 @@ func (monitor *agentMonitor) createAgentCRD(agentCRD *v1beta1.AntreaAgentInfo) (
OVSInfo: v1beta1.OVSInfo{BridgeName: monitor.ovsBridge, FlowTable: monitor.GetOVSFlowTable()},
LocalPodNum: monitor.GetLocalPodNum(),
}
klog.Infof("Creating agent monitor CRD %v", agentCRD)
klog.V(2).Infof("Creating agent monitor CRD %v", agentCRD)
return monitor.client.ClusterinformationV1beta1().AntreaAgentInfos().Create(agentCRD)
}

func (monitor *agentMonitor) updateAgentCRD(agentCRD *v1beta1.AntreaAgentInfo) (*v1beta1.AntreaAgentInfo, error) {
// LocalPodNum and FlowTable can be changed, so reset these fields.
agentCRD.LocalPodNum = monitor.GetLocalPodNum()
agentCRD.OVSInfo.FlowTable = monitor.GetOVSFlowTable()
klog.Infof("Updating agent monitor CRD %v", agentCRD)
klog.V(2).Infof("Updating agent monitor CRD %v", agentCRD)
return monitor.client.ClusterinformationV1beta1().AntreaAgentInfos().Update(agentCRD)
}