argo by kube invocation

This commit is contained in:
mr
2025-02-14 12:00:29 +01:00
parent df6e3d5a46
commit 34547e8b2f
11 changed files with 602 additions and 414 deletions

26
tools/interface.go Normal file
View 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()
}