Skip to content

Commit

Permalink
error on non linux
Browse files Browse the repository at this point in the history
  • Loading branch information
DanG100 committed Aug 15, 2023
1 parent bc4ade2 commit 2db3592
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions lemming.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,15 @@ import (
"context"
"fmt"
"net"
"runtime"
"sync"

"github.com/spf13/viper"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/reflection"
"k8s.io/klog/v2"

"github.com/openconfig/lemming/bgp"
"github.com/openconfig/lemming/dataplane"
fgnmi "github.com/openconfig/lemming/gnmi"
Expand All @@ -32,11 +39,6 @@ import (
fgribi "github.com/openconfig/lemming/gribi"
fp4rt "github.com/openconfig/lemming/p4rt"
"github.com/openconfig/lemming/sysrib"
"github.com/spf13/viper"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/reflection"
"k8s.io/klog/v2"

log "github.com/golang/glog"
)
Expand Down Expand Up @@ -152,6 +154,10 @@ func New(targetName, zapiURL string, opts ...Option) (*Device, error) {
var dplane *dataplane.Dataplane
var recs []reconciler.Reconciler

if viper.GetBool("enable_dataplane") && runtime.GOOS != "linux" {
return nil, fmt.Errorf("dataplane only supported on linux, GOOS is %s", runtime.GOOS)
}

if viper.GetBool("enable_dataplane") {
log.Info("enabling dataplane")
var err error
Expand Down

0 comments on commit 2db3592

Please sign in to comment.