Skip to content
Merged
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
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ endif
# This is useful for CI or a project to utilize a specific version of the operator-sdk toolkit.
OPERATOR_SDK_VERSION ?= v1.37.0
# Image URL to use all building/pushing image targets
TAG ?= latest
TAG ?= 1.1.1
IMG ?= ${IMAGE_TAG_BASE}:${TAG}
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.31.0
Expand Down Expand Up @@ -231,7 +231,7 @@ GOLANGCI_LINT = $(LOCALBIN)/golangci-lint-$(GOLANGCI_LINT_VERSION)
KUSTOMIZE_VERSION ?= v5.3.0
CONTROLLER_TOOLS_VERSION ?= v0.14.0
ENVTEST_VERSION ?= release-0.17
GOLANGCI_LINT_VERSION ?= v1.64.7
GOLANGCI_LINT_VERSION ?= v1.64.8

.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
Expand Down
6 changes: 3 additions & 3 deletions charts/network-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: intel-network-operator
description: A Helm chart for Intel Network Operator for Kubernetes
type: application
version: 1.1.0
appVersion: "1.1.0"
version: 1.1.1
appVersion: "1.1.1"

dependencies:
- name: node-feature-discovery
Expand All @@ -15,6 +15,6 @@ dependencies:
annotations:
org.opencontainers.image.url: "https://github.com/intel/network-operator"
org.opencontainers.image.source: "https://github.com/intel/network-operator"
org.opencontainers.image.version: "1.1.0"
org.opencontainers.image.version: "1.1.1"
org.opencontainers.image.title: "Intel Network Operator"
org.opencontainers.image.description: "This chart installs the Intel Network Operator for Kubernetes."
4 changes: 2 additions & 2 deletions charts/network-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ logLevel: 2
operator:
image:
repository: intel/intel-network-operator
tag: 1.1.0
tag: 1.1.1
imagePullPolicy: IfNotPresent
resources:
limits:
Expand All @@ -30,7 +30,7 @@ config:
networkMetrics: false
image:
repository: intel/intel-network-linkdiscovery
tag: 1.1.0
tag: 1.1.1
imagePullPolicy: IfNotPresent
nodeSelector:
intel.feature.node.kubernetes.io/gaudi-ready: "true"
Expand Down
9 changes: 8 additions & 1 deletion cmd/discover/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ func detectLLDP(config *cmdConfig, networkConfigs map[string]*networkConfigurati
lldpResultChan := make(chan lldp.DiscoveryResult, len(networkConfigs))
timeoutctx, cancelctx := context.WithTimeout(config.ctx, config.timeout)

filterFunc := func(portDescription string) bool {
// Check if the port description field has the correct data in it
_, _, err := parseIPFromString(portDescription)

return err == nil
}

defer cancelctx()

for _, networkconfig := range networkConfigs {
Expand All @@ -107,7 +114,7 @@ func detectLLDP(config *cmdConfig, networkConfigs map[string]*networkConfigurati
wg.Add(1)
go func() {
lldpClient := lldp.NewClient(timeoutctx, networkconfig.link.Attrs().Name, *networkconfig.localHwAddr)
if err := lldpClient.Start(lldpResultChan); err != nil {
if err := lldpClient.Start(lldpResultChan, filterFunc); err != nil {
klog.Infof("Cannot start LLDP client: %v\n", err)
}
wg.Done()
Expand Down
19 changes: 11 additions & 8 deletions cmd/discover/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,15 @@ func getNetworkConfigs(interfaces []string) ([]string, map[string]*networkConfig
return allinterfaces, links, nil
}

func parseIPFromString(portDescription string) (net.IP, *net.IPNet, error) {
substrings := strings.Split(portDescription, " ")
if len(substrings) < 2 {
return nil, nil, fmt.Errorf("port description field doesn't follow expected format (no-alert CIDR)")
}

return net.ParseCIDR(substrings[1])
}

func selectMask30L3Address(nwconfig *networkConfiguration) (*net.IP, *net.IP, error) {
var (
peerNetwork *net.IPNet
Expand All @@ -221,15 +230,9 @@ func selectMask30L3Address(nwconfig *networkConfiguration) (*net.IP, *net.IP, er
err error
)

substrings := strings.Split(nwconfig.portDescription, " ")
if len(substrings) < 2 {
return nil, nil, fmt.Errorf("interface '%s' could not split string '%s'",
nwconfig.link.Attrs().Name, nwconfig.portDescription)
}

peeraddr, peerNetwork, err = net.ParseCIDR(substrings[1])
peeraddr, peerNetwork, err = parseIPFromString(nwconfig.portDescription)
if err != nil {
return nil, nil, fmt.Errorf("interface '%s' could not parse '%s': %v",
return nil, nil, fmt.Errorf("interface '%s' could not parse CIDR from port description '%s': %v",
nwconfig.link.Attrs().Name, nwconfig.portDescription, err)
}

Expand Down
2 changes: 1 addition & 1 deletion config/operator/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ spec:
args:
- --leader-elect
- --health-probe-bind-address=:8081
image: intel/intel-network-operator:1.1.0
image: intel/intel-network-operator:1.1.1
name: manager
env:
- name: OPERATOR_NAMESPACE
Expand Down
2 changes: 1 addition & 1 deletion config/operator/samples/gaudi-l2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ spec:
configurationType: gaudi-so
gaudiScaleOut:
layer: L2
image: intel/intel-network-linkdiscovery:1.1.0
image: intel/intel-network-linkdiscovery:1.1.1
pullPolicy: IfNotPresent
logLevel: 1
nodeSelector:
Expand Down
2 changes: 1 addition & 1 deletion config/operator/samples/gaudi-l3-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
gaudiScaleOut:
layer: L3
networkMetrics: true
image: intel/intel-network-linkdiscovery:1.1.0
image: intel/intel-network-linkdiscovery:1.1.1
pullPolicy: IfNotPresent
logLevel: 1
nodeSelector:
Expand Down
2 changes: 1 addition & 1 deletion config/operator/samples/gaudi-l3-pfc-lldpad-enabled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
layer: L3
pfcPriorities: "11110000"
enableLLDPAD: true
image: intel/intel-network-linkdiscovery:1.1.0
image: intel/intel-network-linkdiscovery:1.1.1
pullPolicy: IfNotPresent
logLevel: 1
nodeSelector:
Expand Down
2 changes: 1 addition & 1 deletion config/operator/samples/gaudi-l3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ spec:
configurationType: gaudi-so
gaudiScaleOut:
layer: L3
image: intel/intel-network-linkdiscovery:1.1.0
image: intel/intel-network-linkdiscovery:1.1.1
pullPolicy: IfNotPresent
logLevel: 1
nodeSelector:
Expand Down
2 changes: 2 additions & 0 deletions internal/controller/networkconfiguration_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ func updateGaudiScaleOutDaemonSet(ds *apps.DaemonSet, netconf *networkv1alpha1.N
ds.Name = netconf.Name
ds.ObjectMeta.Namespace = namespace

ds.Spec.Template.Spec.Containers[0].ImagePullPolicy = v1.PullPolicy(netconf.Spec.GaudiScaleOut.PullPolicy)

if len(netconf.Spec.NodeSelector) > 0 {
ds.Spec.Template.Spec.NodeSelector = netconf.Spec.NodeSelector
}
Expand Down
18 changes: 17 additions & 1 deletion pkg/lldp/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func NewClient(ctx context.Context, ifacename string, hwAddr []byte) *Client {
// Start searches on the configured interface for lldp packages and
// pushes the optional TLV SysName and SysDescription fields of each
// found lldp package into the given channel.
func (l *Client) Start(resultChan chan<- DiscoveryResult) error {
func (l *Client) Start(resultChan chan<- DiscoveryResult, portDescriptionFilter func(string) bool) error {
defer l.Close()

var packetSource *gopacket.PacketSource
Expand Down Expand Up @@ -110,6 +110,8 @@ func (l *Client) Start(resultChan chan<- DiscoveryResult) error {
continue
}

infoFound := false

dr := DiscoveryResult{InterfaceName: l.InterfaceName}
for _, layer := range packet.Layers() {
if layer.LayerType() == layers.LayerTypeLinkLayerDiscovery {
Expand All @@ -134,12 +136,26 @@ func (l *Client) Start(resultChan chan<- DiscoveryResult) error {
if !ok {
continue
}

if portDescriptionFilter != nil && !portDescriptionFilter(info.PortDescription) {
// Filter function did not match, ignore this packet
continue
}

dr.SysName = info.SysName
dr.SysDescription = info.SysDescription
dr.PortDescription = info.PortDescription

infoFound = true
}

}

if !infoFound {
// We did not find the info layer, ignore this packet
continue
}

resultChan <- dr
return nil

Expand Down