Modified how logging with monitord container is implemented, with simpler logic thanks to the argo client library and k8 client-go for pods' logs

This commit is contained in:
pb
2025-04-17 16:51:29 +02:00
parent 6f7acee2df
commit fb8d994be3
5 changed files with 322 additions and 355 deletions

View File

@@ -3,17 +3,15 @@ package tools
import (
"errors"
"io"
"oc-monitord/models"
"sync"
"k8s.io/apimachinery/pkg/watch"
)
type Tool interface {
CreateArgoWorkflow(path string, ns string) (string, error)
CreateAccessSecret(ns string, login string, password string) (string, error)
LogWorkflow(execID string, namespace string, workflowName string, argoFilePath string, stepMax int, current_watch *models.ArgoWatch, previous_watch *models.ArgoWatch,
argoLogs *models.ArgoLogs, seen []string,
logFunc func(argoFilePath string, stepMax int, pipe io.ReadCloser, current_watch *models.ArgoWatch, previous_watch *models.ArgoWatch,
argoLogs *models.ArgoLogs, seen []string, wg *sync.WaitGroup)) error
GetArgoWatch(executionId string, wfName string) (watch.Interface, error)
GetPodLogger(ns string, wfName string, podName string) (io.ReadCloser, error)
}
var _service = map[string]func() (Tool, error){