Merge pull request #50209 from thaJeztah/pkg_idtools_deprecate

pkg/idtools: deprecate IdentityMapping, Identity.Chown
This commit is contained in:
Sebastiaan van Stijn
2025-06-18 12:23:35 +02:00
committed by GitHub
2 changed files with 5 additions and 1 deletions

View File

@@ -304,7 +304,7 @@ linters:
- staticcheck
# FIXME(thaJeztah): ignoring these transitional utilities until BuildKit is vendored with https://github.com/moby/moby/pull/49743
- text: "SA1019: idtools\\.(ToUserIdentityMapping|FromUserIdentityMapping) is deprecated"
- text: "SA1019: idtools\\.(ToUserIdentityMapping|FromUserIdentityMapping|IdentityMapping) is deprecated"
linters:
- staticcheck

View File

@@ -108,12 +108,16 @@ type Identity struct {
}
// Chown changes the numeric uid and gid of the named file to id.UID and id.GID.
//
// Deprecated: this method is deprecated and will be removed in the next release.
func (id Identity) Chown(name string) error {
return os.Chown(name, id.UID, id.GID)
}
// IdentityMapping contains a mappings of UIDs and GIDs.
// The zero value represents an empty mapping.
//
// Deprecated: this type is deprecated and will be removed in the next release.
type IdentityMapping struct {
UIDMaps []IDMap `json:"UIDMaps"`
GIDMaps []IDMap `json:"GIDMaps"`