Fix workflow volume and network config (#4650)

This commit is contained in:
Anbraten
2025-01-01 16:21:57 +01:00
committed by GitHub
parent 04f691ebd6
commit 5d3300824d
5 changed files with 72 additions and 52 deletions

View File

@@ -191,9 +191,11 @@ func (e *kube) getConfig() *config {
func (e *kube) SetupWorkflow(ctx context.Context, conf *types.Config, taskUUID string) error {
log.Trace().Str("taskUUID", taskUUID).Msgf("Setting up Kubernetes primitives")
_, err := startVolume(ctx, e, conf.Volume.Name)
if err != nil {
return err
for _, vol := range conf.Volumes {
_, err := startVolume(ctx, e, vol.Name)
if err != nil {
return err
}
}
var extraHosts []types.HostAlias
@@ -425,9 +427,11 @@ func (e *kube) DestroyWorkflow(ctx context.Context, conf *types.Config, taskUUID
}
}
err := stopVolume(ctx, e, conf.Volume.Name, defaultDeleteOptions)
if err != nil {
return err
for _, vol := range conf.Volumes {
err := stopVolume(ctx, e, vol.Name, defaultDeleteOptions)
if err != nil {
return err
}
}
return nil