Skip to content
Snippets Groups Projects
Commit af732489 authored by S.H.'s avatar S.H.
Browse files

Change makefile to rename image to gnmi-target-local, add many debug print statements

parent 26fd529d
No related branches found
No related tags found
No related merge requests found
Pipeline #265242 failed
......@@ -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 .
......
......@@ -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()
......
......@@ -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()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment