mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #33225 from allencloud/unexport-errPruneRunning
unexport error errPruneRunning
This commit is contained in:
commit
d6b1650825
1 changed files with 6 additions and 6 deletions
|
@ -22,9 +22,9 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// ErrPruneRunning is returned when a prune request is received while
|
// errPruneRunning is returned when a prune request is received while
|
||||||
// one is in progress
|
// one is in progress
|
||||||
ErrPruneRunning = fmt.Errorf("a prune operation is already running")
|
errPruneRunning = fmt.Errorf("a prune operation is already running")
|
||||||
|
|
||||||
containersAcceptedFilters = map[string]bool{
|
containersAcceptedFilters = map[string]bool{
|
||||||
"label": true,
|
"label": true,
|
||||||
|
@ -51,7 +51,7 @@ var (
|
||||||
// ContainersPrune removes unused containers
|
// ContainersPrune removes unused containers
|
||||||
func (daemon *Daemon) ContainersPrune(ctx context.Context, pruneFilters filters.Args) (*types.ContainersPruneReport, error) {
|
func (daemon *Daemon) ContainersPrune(ctx context.Context, pruneFilters filters.Args) (*types.ContainersPruneReport, error) {
|
||||||
if !atomic.CompareAndSwapInt32(&daemon.pruneRunning, 0, 1) {
|
if !atomic.CompareAndSwapInt32(&daemon.pruneRunning, 0, 1) {
|
||||||
return nil, ErrPruneRunning
|
return nil, errPruneRunning
|
||||||
}
|
}
|
||||||
defer atomic.StoreInt32(&daemon.pruneRunning, 0)
|
defer atomic.StoreInt32(&daemon.pruneRunning, 0)
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ func (daemon *Daemon) ContainersPrune(ctx context.Context, pruneFilters filters.
|
||||||
// VolumesPrune removes unused local volumes
|
// VolumesPrune removes unused local volumes
|
||||||
func (daemon *Daemon) VolumesPrune(ctx context.Context, pruneFilters filters.Args) (*types.VolumesPruneReport, error) {
|
func (daemon *Daemon) VolumesPrune(ctx context.Context, pruneFilters filters.Args) (*types.VolumesPruneReport, error) {
|
||||||
if !atomic.CompareAndSwapInt32(&daemon.pruneRunning, 0, 1) {
|
if !atomic.CompareAndSwapInt32(&daemon.pruneRunning, 0, 1) {
|
||||||
return nil, ErrPruneRunning
|
return nil, errPruneRunning
|
||||||
}
|
}
|
||||||
defer atomic.StoreInt32(&daemon.pruneRunning, 0)
|
defer atomic.StoreInt32(&daemon.pruneRunning, 0)
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@ func (daemon *Daemon) VolumesPrune(ctx context.Context, pruneFilters filters.Arg
|
||||||
// ImagesPrune removes unused images
|
// ImagesPrune removes unused images
|
||||||
func (daemon *Daemon) ImagesPrune(ctx context.Context, pruneFilters filters.Args) (*types.ImagesPruneReport, error) {
|
func (daemon *Daemon) ImagesPrune(ctx context.Context, pruneFilters filters.Args) (*types.ImagesPruneReport, error) {
|
||||||
if !atomic.CompareAndSwapInt32(&daemon.pruneRunning, 0, 1) {
|
if !atomic.CompareAndSwapInt32(&daemon.pruneRunning, 0, 1) {
|
||||||
return nil, ErrPruneRunning
|
return nil, errPruneRunning
|
||||||
}
|
}
|
||||||
defer atomic.StoreInt32(&daemon.pruneRunning, 0)
|
defer atomic.StoreInt32(&daemon.pruneRunning, 0)
|
||||||
|
|
||||||
|
@ -392,7 +392,7 @@ func (daemon *Daemon) clusterNetworksPrune(ctx context.Context, pruneFilters fil
|
||||||
// NetworksPrune removes unused networks
|
// NetworksPrune removes unused networks
|
||||||
func (daemon *Daemon) NetworksPrune(ctx context.Context, pruneFilters filters.Args) (*types.NetworksPruneReport, error) {
|
func (daemon *Daemon) NetworksPrune(ctx context.Context, pruneFilters filters.Args) (*types.NetworksPruneReport, error) {
|
||||||
if !atomic.CompareAndSwapInt32(&daemon.pruneRunning, 0, 1) {
|
if !atomic.CompareAndSwapInt32(&daemon.pruneRunning, 0, 1) {
|
||||||
return nil, ErrPruneRunning
|
return nil, errPruneRunning
|
||||||
}
|
}
|
||||||
defer atomic.StoreInt32(&daemon.pruneRunning, 0)
|
defer atomic.StoreInt32(&daemon.pruneRunning, 0)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue