mirror of
				https://github.com/containers/podman.git
				synced 2025-10-31 01:50:50 +08:00 
			
		
		
		
	vendor: bump containers/(storage, common, buildah, image)
Bump containers/(storage, common, buildah and image) Changes since 2023-01-01: - skip mount-cache-selinux-long-name test under remote, with a FIXME requesting that someone see if it can be made to work. - skip six tests that fail under rootless-remote - add new --build-arg-file option: - update man page Squash of: *cf56eb1865*561f082772Signed-off-by: Ed Santiago <santiago@redhat.com> Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Signed-off-by: Aditya R <arajan@redhat.com>
This commit is contained in:
		
							
								
								
									
										53
									
								
								vendor/github.com/containers/storage/containers.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										53
									
								
								vendor/github.com/containers/storage/containers.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @ -107,13 +107,13 @@ type rwContainerStore interface { | ||||
| 	// stopReading releases locks obtained by startReading. | ||||
| 	stopReading() | ||||
|  | ||||
| 	// Create creates a container that has a specified ID (or generates a | ||||
| 	// create creates a container that has a specified ID (or generates a | ||||
| 	// random one if an empty value is supplied) and optional names, | ||||
| 	// based on the specified image, using the specified layer as its | ||||
| 	// read-write layer. | ||||
| 	// The maps in the container's options structure are recorded for the | ||||
| 	// convenience of the caller, nothing more. | ||||
| 	Create(id string, names []string, image, layer, metadata string, options *ContainerOptions) (*Container, error) | ||||
| 	create(id string, names []string, image, layer string, options *ContainerOptions) (*Container, error) | ||||
|  | ||||
| 	// updateNames modifies names associated with a  container based on (op, names). | ||||
| 	updateNames(id string, names []string, op updateNameOperation) error | ||||
| @ -411,7 +411,7 @@ func (r *containerStore) GarbageCollect() error { | ||||
| 	for _, entry := range entries { | ||||
| 		id := entry.Name() | ||||
| 		// Does it look like a datadir directory? | ||||
| 		if !entry.IsDir() || !nameLooksLikeID(id) { | ||||
| 		if !entry.IsDir() || stringid.ValidateID(id) != nil { | ||||
| 			continue | ||||
| 		} | ||||
|  | ||||
| @ -651,7 +651,10 @@ func (r *containerStore) SetFlag(id string, flag string, value interface{}) erro | ||||
| } | ||||
|  | ||||
| // Requires startWriting. | ||||
| func (r *containerStore) Create(id string, names []string, image, layer, metadata string, options *ContainerOptions) (container *Container, err error) { | ||||
| func (r *containerStore) create(id string, names []string, image, layer string, options *ContainerOptions) (container *Container, err error) { | ||||
| 	if options == nil { | ||||
| 		options = &ContainerOptions{} | ||||
| 	} | ||||
| 	if id == "" { | ||||
| 		id = stringid.GenerateRandomID() | ||||
| 		_, idInUse := r.byid[id] | ||||
| @ -663,13 +666,7 @@ func (r *containerStore) Create(id string, names []string, image, layer, metadat | ||||
| 	if _, idInUse := r.byid[id]; idInUse { | ||||
| 		return nil, ErrDuplicateID | ||||
| 	} | ||||
| 	if options.MountOpts != nil { | ||||
| 		options.Flags[mountOptsFlag] = append([]string{}, options.MountOpts...) | ||||
| 	} | ||||
| 	if options.Volatile { | ||||
| 		options.Flags[volatileFlag] = true | ||||
| 	} | ||||
| 	names = dedupeNames(names) | ||||
| 	names = dedupeStrings(names) | ||||
| 	for _, name := range names { | ||||
| 		if _, nameInUse := r.byname[name]; nameInUse { | ||||
| 			return nil, fmt.Errorf("the container name %q is already in use by %s. You have to remove that container to be able to reuse that name: %w", name, r.byname[name].ID, ErrDuplicateName) | ||||
| @ -686,7 +683,7 @@ func (r *containerStore) Create(id string, names []string, image, layer, metadat | ||||
| 		Names:          names, | ||||
| 		ImageID:        image, | ||||
| 		LayerID:        layer, | ||||
| 		Metadata:       metadata, | ||||
| 		Metadata:       options.Metadata, | ||||
| 		BigDataNames:   []string{}, | ||||
| 		BigDataSizes:   make(map[string]int64), | ||||
| 		BigDataDigests: make(map[string]digest.Digest), | ||||
| @ -696,16 +693,42 @@ func (r *containerStore) Create(id string, names []string, image, layer, metadat | ||||
| 		GIDMap:         copyIDMap(options.GIDMap), | ||||
| 		volatileStore:  options.Volatile, | ||||
| 	} | ||||
| 	if options.MountOpts != nil { | ||||
| 		container.Flags[mountOptsFlag] = append([]string{}, options.MountOpts...) | ||||
| 	} | ||||
| 	if options.Volatile { | ||||
| 		container.Flags[volatileFlag] = true | ||||
| 	} | ||||
| 	r.containers = append(r.containers, container) | ||||
| 	r.byid[id] = container | ||||
| 	// This can only fail on duplicate IDs, which shouldn’t happen — and in that case the index is already in the desired state anyway. | ||||
| 	// Implementing recovery from an unlikely and unimportant failure here would be too risky. | ||||
| 	// This can only fail on duplicate IDs, which shouldn’t happen — and in | ||||
| 	// that case the index is already in the desired state anyway. | ||||
| 	// Implementing recovery from an unlikely and unimportant failure here | ||||
| 	// would be too risky. | ||||
| 	_ = r.idindex.Add(id) | ||||
| 	r.byid[id] = container | ||||
| 	r.bylayer[layer] = container | ||||
| 	for _, name := range names { | ||||
| 		r.byname[name] = container | ||||
| 	} | ||||
| 	defer func() { | ||||
| 		if err != nil { | ||||
| 			// now that the in-memory structures know about the new | ||||
| 			// record, we can use regular Delete() to clean up if | ||||
| 			// anything breaks from here on out | ||||
| 			if e := r.Delete(id); e != nil { | ||||
| 				logrus.Debugf("while cleaning up partially-created container %q we failed to create: %v", id, e) | ||||
| 			} | ||||
| 		} | ||||
| 	}() | ||||
| 	err = r.saveFor(container) | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	for _, item := range options.BigData { | ||||
| 		if err = r.SetBigData(id, item.Key, item.Data); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 	} | ||||
| 	container = copyContainer(container) | ||||
| 	return container, err | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Aditya R
					Aditya R