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

Pass image to use for l2discovery #1

Merged
merged 2 commits into from
Aug 21, 2024
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
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ lint:
# Install golangci-lint
install-lint:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ${GO_PATH}/bin ${GOLANGCI_VERSION}
vet:
go vet ${GO_PACKAGES}
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
Loading