Skip to content

Commit

Permalink
Pass image to use for l2discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
edcdavid committed Aug 20, 2024
1 parent 6b5175c commit a1cfb82
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions l2lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type L2Info interface {
GetPortsGettingPTP() []*l2.PtpIf

SetL2Client(kubernetes.Interface, *rest.Config)
GetL2DiscoveryConfig(ptpInterfacesOnly bool) (config L2Info, err error)
GetL2DiscoveryConfig(ptpInterfacesOnly bool, l2DiscoveryImage string) (config L2Info, err error)
}

const (
Expand All @@ -50,7 +50,6 @@ const (
L2DiscoveryContainerName = "l2discovery"
timeoutDaemon = time.Second * 60
L2DiscoveryDuration = time.Second * 15
l2DiscoveryImage = "quay.io/redhat-cne/l2discovery:v10"
L2ContainerCPULim = "100m"
L2ContainerCPUReq = "100m"
L2ContainerMemLim = "100M"
Expand Down Expand Up @@ -140,9 +139,9 @@ func (config *L2DiscoveryConfig) SetL2Client(k8sClient kubernetes.Interface, res
}

// Gets existing L2 configuration or creates a new one (if refresh is set to true)
func (config *L2DiscoveryConfig) GetL2DiscoveryConfig(ptpInterfacesOnly bool) (L2Info, error) {
func (config *L2DiscoveryConfig) GetL2DiscoveryConfig(ptpInterfacesOnly bool, l2DiscoveryImage string) (L2Info, error) {
if GlobalL2DiscoveryConfig.refresh {
err := GlobalL2DiscoveryConfig.DiscoverL2Connectivity(ptpInterfacesOnly)
err := GlobalL2DiscoveryConfig.DiscoverL2Connectivity(ptpInterfacesOnly, l2DiscoveryImage)
if err != nil {
GlobalL2DiscoveryConfig.refresh = false
return nil, fmt.Errorf("failed to discover L2 connectivity: %w", err)
Expand All @@ -165,7 +164,7 @@ func (config *L2DiscoveryConfig) reset() {
}

// Discovers the L2 connectivity using l2discovery daemonset
func (config *L2DiscoveryConfig) DiscoverL2Connectivity(ptpInterfacesOnly bool) error {
func (config *L2DiscoveryConfig) DiscoverL2Connectivity(ptpInterfacesOnly bool, l2DiscoveryImage string) error {
GlobalL2DiscoveryConfig.reset()
GlobalL2DiscoveryConfig.InitSkippedInterfaces()
// initializes clusterwide ptp interfaces
Expand Down

0 comments on commit a1cfb82

Please sign in to comment.