argo by kube invocation
This commit is contained in:
26
tools/interface.go
Normal file
26
tools/interface.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package tools
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"io"
|
||||
"sync"
|
||||
)
|
||||
|
||||
type Tool interface {
|
||||
CreateArgoWorkflow(path string) error
|
||||
CreateAccessSecret(ns string, login string, password string) (string, error)
|
||||
LogWorkflow(namespace string, workflowName string, argoFilePath string, stepMax int,
|
||||
logFunc func(argoFilePath string, stepMax int, pipe io.ReadCloser, wg *sync.WaitGroup)) error
|
||||
}
|
||||
|
||||
var _service = map[string]func() (Tool, error){
|
||||
"kubernetes": NewKubernetesTool,
|
||||
}
|
||||
|
||||
func NewService(name string) (Tool, error) {
|
||||
service, ok := _service[name]
|
||||
if !ok {
|
||||
return nil, errors.New("service not found")
|
||||
}
|
||||
return service()
|
||||
}
|
||||
Reference in New Issue
Block a user