forked from feedhenry/fh-system-dump-tool
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmillicore.go
More file actions
27 lines (24 loc) · 716 Bytes
/
millicore.go
File metadata and controls
27 lines (24 loc) · 716 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package main
import (
"os/exec"
"path/filepath"
)
func GetMillicoreConfigTasks(tasks chan<- Task, runner Runner, projects []string, resourceFactory ResourceMatchFactory) {
for _, p := range projects {
pods, err := resourceFactory(p, "pod", "millicore")
if err != nil {
tasks <- NewError(err)
continue
}
for _, pod := range pods {
tasks <- GetMillicoreConfig(runner, p, pod)
}
}
}
func GetMillicoreConfig(r Runner, project, pod string) Task {
return func() error {
cmd := exec.Command("oc", "exec", pod, "--", "cat", "/etc/feedhenry/cluster-override.properties")
path := filepath.Join("projects", project, "millicore", pod+"_cluster-override.properties")
return r.Run(cmd, path)
}
}