Skip to content

Move to json storage, address pblindex issue #721

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
1 change: 0 additions & 1 deletion calico-vpp-agent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ FROM ubuntu:22.04
LABEL maintainer="[email protected]"

ADD bin/gobgp /bin/gobgp
ADD bin/debug /bin/debug
ADD version /etc/calicovppversion
ADD bin/felix-api-proxy /bin/felix-api-proxy
ADD bin/calico-vpp-agent /bin/calico-vpp-agent
Expand Down
1 change: 0 additions & 1 deletion calico-vpp-agent/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ felix-api-proxy: bin

build: felix-api-proxy bin
${DOCKER_RUN} go build -o ./bin/calico-vpp-agent ./cmd
${DOCKER_RUN} go build -o ./bin/debug ./cmd/debug-state

gobgp: bin
${DOCKER_RUN} go build -o ./bin/gobgp github.com/osrg/gobgp/v3/cmd/gobgp/
Expand Down
46 changes: 34 additions & 12 deletions calico-vpp-agent/cmd/calico_vpp_dataplane.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"context"
"os"
"os/signal"
"runtime/coverage"
"syscall"
"time"

Expand Down Expand Up @@ -224,20 +225,41 @@ func main() {

log.Infof("Agent started")

interruptSignalChannel := make(chan os.Signal, 2)
signal.Notify(interruptSignalChannel, os.Interrupt, syscall.SIGTERM)

usr1SignalChannel := make(chan os.Signal, 2)
signal.Notify(usr1SignalChannel, syscall.SIGUSR1)
sigChan := make(chan os.Signal, 2)
signal.Notify(sigChan,
os.Interrupt,
syscall.SIGTERM,
syscall.SIGUSR1,
syscall.SIGUSR2,
)

select {
case <-usr1SignalChannel:
/* vpp-manager pokes us with USR1 if VPP terminates */
log.Warnf("Vpp stopped, exiting...")
t.Kill(errors.Errorf("Caught signal USR1"))
case <-interruptSignalChannel:
log.Infof("SIG received, exiting")
t.Kill(errors.Errorf("Caught INT signal"))
case sig := <-sigChan:
switch sig {
case os.Interrupt:
fallthrough
case syscall.SIGTERM:
log.Infof("SIG received, exiting")
t.Kill(errors.Errorf("Caught INT signal"))
case syscall.SIGUSR1:
// vpp-manager pokes us with USR1 if VPP terminates
log.Warnf("Vpp stopped, exiting...")
t.Kill(errors.Errorf("Caught signal USR1"))
case syscall.SIGUSR2:
// the USR2 signal outputs the coverage data,
// provided the binary is compiled with -cover and
// GOCOVERDIR is set. This allows us to not require
// a proper binary termination in order to get coverage data.
log.Warn("Received SIGUSR2, writing coverage")
err := coverage.WriteCountersDir(os.Getenv("GOCOVERDIR"))
if err != nil {
log.WithError(err).Error("Could not write counters dir")
}
err = coverage.WriteMetaDir(os.Getenv("GOCOVERDIR"))
if err != nil {
log.WithError(err).Error("Could not write meta dir")
}
}
case <-t.Dying():
log.Errorf("tomb Dying %s", t.Err())
}
Expand Down
43 changes: 0 additions & 43 deletions calico-vpp-agent/cmd/debug-state/debug-state.go

This file was deleted.

4 changes: 2 additions & 2 deletions calico-vpp-agent/cni/cni_pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ var _ = Describe("Pod-related functionality of CNI", func() {
Workload: &cniproto.WorkloadIDs{
Annotations: map[string]string{
// needed just for setting up steering of traffic to default Tun/Tap and to secondary Memif
cni.VppAnnotationPrefix + cni.MemifPortAnnotation: fmt.Sprintf("tcp:%d-%d,udp:%d-%d",
config.MemifPortAnnotation: fmt.Sprintf("tcp:%d-%d,udp:%d-%d",
memifTCPPortStart, memifTCPPortEnd, memifUDPPortStart, memifUDPPortEnd),
},
},
Expand Down Expand Up @@ -418,7 +418,7 @@ var _ = Describe("Pod-related functionality of CNI", func() {
Workload: &cniproto.WorkloadIDs{
Annotations: map[string]string{
// needed just for setting up steering of traffic to default Tun/Tap and to secondary Memif
cni.VppAnnotationPrefix + cni.MemifPortAnnotation: fmt.Sprintf("tcp:%d-%d,udp:%d-%d",
config.MemifPortAnnotation: fmt.Sprintf("tcp:%d-%d,udp:%d-%d",
memifTCPPortStart, memifTCPPortEnd, memifUDPPortStart, memifUDPPortEnd),
},
},
Expand Down
Loading
Loading