func()

in deploy/eligible_instance_groups.go [41:65]


func (app *App) EligibleInstanceGroups(cfg chaosmonkey.AppConfig) []grp.InstanceGroup {
	if !cfg.Enabled {
		log.Fatalf("app %s unexpectedly disabled", app.Name())
	}

	grouping := cfg.Grouping
	indep := cfg.RegionsAreIndependent

	switch {
	case grouping == chaosmonkey.App && indep:
		return appIndep(app)
	case grouping == chaosmonkey.App && !indep:
		return appDep(app)
	case grouping == chaosmonkey.Stack && indep:
		return stackIndep(app)
	case grouping == chaosmonkey.Stack && !indep:
		return stackDep(app)
	case grouping == chaosmonkey.Cluster && indep:
		return clusterIndep(app)
	case grouping == chaosmonkey.Cluster && !indep:
		return clusterDep(app)
	default:
		panic(fmt.Sprintf("Unknown grouping: %d", grouping))
	}
}