diff --git a/Makefile b/Makefile index 976de0550015a75b2fddcfda0c918eba2cb6715c..405ecdd14962e081b1b666a3da6b14b9d1efe57b 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ generate-yang-models: install-tools go generate container: build - docker buildx build --rm -t gnmi-target --load -f ./examples/example01/target.Dockerfile . + docker buildx build --rm -t gnmi-target-local --load -f ./examples/example01/target.Dockerfile . container-debug: docker buildx build --rm -t gnmi-target-debug --load -f .examples/example01/Dockerfile.debug . diff --git a/examples/example01/handlers/interfaces/interfacesHandler.go b/examples/example01/handlers/interfaces/interfacesHandler.go index cb77aa2a29e987b8234162f8f8af627fd853df55..6d2d4f3e27c4767e8375f4a8a30a8a46c48cad88 100644 --- a/examples/example01/handlers/interfaces/interfacesHandler.go +++ b/examples/example01/handlers/interfaces/interfacesHandler.go @@ -59,6 +59,7 @@ func (yh *InterfacesHandler) Init(config *handler.Config, publishToSubsFunc func case update := <-interfaceChannel: //lock access for model diff, err := yh.updateOrCreateInterface(update) + fmt.Println("PublishToSubs with this diff:", diff) if err != nil { log.Errorf("Error within interface subscription goroutine; %v", err) // TODO: check again @@ -70,12 +71,12 @@ func (yh *InterfacesHandler) Init(config *handler.Config, publishToSubsFunc func } } }() - return nil } func (yh *InterfacesHandler) Update(c ygot.ValidatedGoStruct, updates []*gnmi.Update) error { fmt.Println("Update request received for ", yh.GetName()) + fmt.Println("To be updated:", updates) config, ok := c.(*gnmitargetygot.Gnmitarget) if !ok { return fmt.Errorf("failed type assertion for config %T", (*gnmitargetygot.Gnmitarget)(nil)) @@ -149,6 +150,7 @@ func (yh *InterfacesHandler) Update(c ygot.ValidatedGoStruct, updates []*gnmi.Up } func (yh *InterfacesHandler) updateOrCreateInterface(localInterface *additions.Interface) ([]*gnmi.Notification, error) { + fmt.Println("UpdateOrCreateInterface on interface", localInterface) yh.Config.Lock() defer yh.Config.Unlock() diff --git a/internal/gnmiserver/server.go b/internal/gnmiserver/server.go index 1ad9553a74bcc114874353ee79fbda24ce4635e0..8c3df6bdab301d87d502ee852c42af02d474ea04 100644 --- a/internal/gnmiserver/server.go +++ b/internal/gnmiserver/server.go @@ -144,6 +144,8 @@ func (s *Server) callback(newConfig ygot.ValidatedGoStruct, existingConf ygot.Va // TODO: This will be moved. func (s *Server) PublishNotificationsToSubscribers(notifications []*gnmi.Notification) error { + fmt.Println("In PublishNotificationsToSubscribers()") + fmt.Println("Notifications:", notifications) for _, specificDiff := range notifications { // First for gnmi Updates updates := specificDiff.GetUpdate()