WIP: Switch to new config format.

Don't use jobrun for daemon, just call JobDo() once, the job must
organize stuff itself.

Sacrifice all the oneshot commands, they will be reintroduced as
client-calls to the daemon.
This commit is contained in:
Christian Schwarz
2017-09-10 16:13:05 +02:00
parent 8bf3516003
commit 73c9033583
20 changed files with 865 additions and 1291 deletions

View File

@ -47,24 +47,21 @@ func doTestDatasetMapFilter(cmd *cobra.Command, args []string) {
os.Exit(1)
}
n, i := args[0], args[1]
jobi, err := conf.resolveJobName(n)
if err != nil {
log.Printf("%s", err)
jobi, ok := conf.Jobs[n]
if !ok {
log.Printf("no job %s defined in config")
os.Exit(1)
}
var mf DatasetMapFilter
var mf *DatasetMapFilter
switch j := jobi.(type) {
case *Autosnap:
mf = j.DatasetFilter
case *Prune:
mf = j.DatasetFilter
case *Pull:
case *PullJob:
mf = j.Mapping
case *SourceJob:
mf = j.Datasets
case *LocalJob:
mf = j.Mapping
case *Push:
mf = j.Filter
case DatasetMapFilter:
mf = j
default:
panic("incomplete implementation")
}