mirror of
				https://github.com/docker/compose.git
				synced 2025-10-24 16:53:52 +02:00 
			
		
		
		
	Merge pull request #1562 from docker/atoi
scale must ignore oneoff containers
This commit is contained in:
		
						commit
						9f23d9e992
					
				| @ -83,6 +83,11 @@ func isNotService(services ...string) containerPredicate { | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| func isNotOneOff(c moby.Container) bool { | ||||
| 	v, ok := c.Labels[oneoffLabel] | ||||
| 	return !ok || v == "False" | ||||
| } | ||||
| 
 | ||||
| // filter return Containers with elements to match predicate | ||||
| func (containers Containers) filter(predicate containerPredicate) Containers { | ||||
| 	var filtered Containers | ||||
|  | ||||
| @ -52,7 +52,7 @@ func (s *composeService) ensureScale(ctx context.Context, project *types.Project | ||||
| 		return nil, nil, err | ||||
| 	} | ||||
| 	observedState := cState.GetContainers() | ||||
| 	actual := observedState.filter(isService(service.Name)) | ||||
| 	actual := observedState.filter(isService(service.Name)).filter(isNotOneOff) | ||||
| 	scale, err := getScale(service) | ||||
| 	if err != nil { | ||||
| 		return nil, nil, err | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user