mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-01 08:31:57 +00:00
Simplify backend types (#5299)
This commit is contained in:
@@ -146,7 +146,7 @@ func (e *docker) SetupWorkflow(ctx context.Context, conf *backend.Config, taskUU
|
||||
log.Trace().Str("taskUUID", taskUUID).Msg("create workflow environment")
|
||||
|
||||
_, err := e.client.VolumeCreate(ctx, volume.CreateOptions{
|
||||
Name: conf.Volume.Name,
|
||||
Name: conf.Volume,
|
||||
Driver: volumeDriver,
|
||||
})
|
||||
if err != nil {
|
||||
@@ -157,7 +157,7 @@ func (e *docker) SetupWorkflow(ctx context.Context, conf *backend.Config, taskUU
|
||||
if e.info.OSType == "windows" {
|
||||
networkDriver = networkDriverNAT
|
||||
}
|
||||
_, err = e.client.NetworkCreate(ctx, conf.Network.Name, network.CreateOptions{
|
||||
_, err = e.client.NetworkCreate(ctx, conf.Network, network.CreateOptions{
|
||||
Driver: networkDriver,
|
||||
EnableIPv6: &e.config.enableIPv6,
|
||||
})
|
||||
@@ -324,11 +324,11 @@ func (e *docker) DestroyWorkflow(ctx context.Context, conf *backend.Config, task
|
||||
}
|
||||
}
|
||||
}
|
||||
if err := e.client.VolumeRemove(ctx, conf.Volume.Name, true); err != nil {
|
||||
log.Error().Err(err).Msgf("could not remove volume '%s'", conf.Volume.Name)
|
||||
if err := e.client.VolumeRemove(ctx, conf.Volume, true); err != nil {
|
||||
log.Error().Err(err).Msgf("could not remove volume '%s'", conf.Volume)
|
||||
}
|
||||
if err := e.client.NetworkRemove(ctx, conf.Network.Name); err != nil {
|
||||
log.Error().Err(err).Msgf("could not remove network '%s'", conf.Network.Name)
|
||||
if err := e.client.NetworkRemove(ctx, conf.Network); err != nil {
|
||||
log.Error().Err(err).Msgf("could not remove network '%s'", conf.Network)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user