mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-03 11:03:27 +00:00
Fix workflow volume and network config (#4650)
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user