mirror of
https://github.com/docker/compose.git
synced 2026-05-13 13:58:02 +00:00
fix: restore deprecated Set.Clear/Union; use resource var in pull.go
Assisted-By: docker-agent Signed-off-by: Nicolas De loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
07832c4df1
commit
5c70712199
2 changed files with 25 additions and 2 deletions
|
|
@ -175,7 +175,7 @@ func getUnwrappedErrorMessage(err error) string {
|
|||
|
||||
func (s *composeService) pullServiceImage(ctx context.Context, service types.ServiceConfig, quietPull bool, defaultPlatform string) (string, error) {
|
||||
resource := "Image " + service.Image
|
||||
s.events.On(newEvent("Image "+service.Image, api.Working, api.StatusPulling))
|
||||
s.events.On(newEvent(resource, api.Working, api.StatusPulling))
|
||||
ref, err := reference.ParseNormalizedNamed(service.Image)
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
|
@ -246,7 +246,7 @@ func (s *composeService) pullServiceImage(ctx context.Context, service types.Ser
|
|||
toPullProgressEvent(resource, jm, s.events)
|
||||
}
|
||||
}
|
||||
s.events.On(newEvent("Image "+service.Image, api.Done, api.StatusPulled))
|
||||
s.events.On(newEvent(resource, api.Done, api.StatusPulled))
|
||||
|
||||
inspected, err := s.apiClient().ImageInspect(ctx, service.Image)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -74,3 +74,26 @@ func (s Set[T]) Diff(other Set[T]) Set[T] {
|
|||
}
|
||||
return out
|
||||
}
|
||||
|
||||
// Clear removes all elements from the set.
|
||||
//
|
||||
// Deprecated: Clear is retained for API compatibility; prefer re-assigning a new Set.
|
||||
func (s Set[T]) Clear() {
|
||||
for v := range s {
|
||||
delete(s, v)
|
||||
}
|
||||
}
|
||||
|
||||
// Union returns a new set containing all elements from both s and other.
|
||||
//
|
||||
// Deprecated: Union is retained for API compatibility.
|
||||
func (s Set[T]) Union(other Set[T]) Set[T] {
|
||||
out := make(Set[T])
|
||||
for k := range s {
|
||||
out[k] = struct{}{}
|
||||
}
|
||||
for k := range other {
|
||||
out[k] = struct{}{}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue