Exemplo n.º 1
0
func applyConfig(t *testing.T, vserver *vserver, file, clusterName, serviceName string) {
	filename := filepath.Join(testDataDir, file)
	n, err := config.ReadConfig(filename, clusterName)
	if err != nil {
		t.Fatalf("Failed to read %v", file)
	}
	config := n.Cluster.Vservers[serviceName]
	if config == nil {
		t.Fatalf("Failed to find vserver config for %v", serviceName)
	}
	vserver.handleConfigUpdate(config)
}
Exemplo n.º 2
0
func applyConfig(vserver *vserver, file, clusterName, serviceName string) error {
	filename := filepath.Join(testDataDir, file)
	n, err := config.ReadConfig(filename, clusterName)
	if err != nil {
		return err
	}
	config := n.Cluster.Vservers[serviceName]
	if config == nil {
		return fmt.Errorf("unable to find vserver config for %s", serviceName)
	}
	vserver.handleConfigUpdate(config)
	return nil
}