in xds/local-control-panel/server/app/main.go [43:81]
func main() {
flag.Parse()
// Create a snaphost
snaphost := cache.NewSnapshotCache(false, cache.IDHash{}, l)
go func() {
// Create the config that we'll serve to Envoy
config := GenerateSnapshotPixiu()
if err := config.Consistent(); err != nil {
l.Errorf("config inconsistency: %+v\n%+v", config, err)
os.Exit(1)
}
l.Debugf("will serve config %+v", config)
// Add the config to the snaphost
if err := snaphost.SetSnapshot(context.Background(), nodeID, config); err != nil {
l.Errorf("config error %q for %+v", err, config)
os.Exit(1)
}
//time.Sleep(30 * time.Second)
//config2 := GenerateSnapshotPixiu2()
//if err := config2.Consistent(); err != nil {
// l.Errorf("config inconsistency: %+v\n%+v", config, err)
// os.Exit(1)
//}
//if err := snaphost.SetSnapshot(context.Background(), nodeID, config2); err != nil {
// l.Errorf("config error %q for %+v", err, config)
// os.Exit(1)
//}
}()
// Run the xDS server
ctx := context.Background()
cb := &test.Callbacks{Debug: l.Debug}
srv := server.NewServer(ctx, snaphost, cb)
RunServer(ctx, srv, port)
}