Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate Descriptor UID/GID #59

Closed
tri-adam opened this issue Jul 15, 2021 · 0 comments · Fixed by #61
Closed

Deprecate Descriptor UID/GID #59

tri-adam opened this issue Jul 15, 2021 · 0 comments · Fixed by #61
Labels
v2 Affects v2 API

Comments

@tri-adam
Copy link
Member

type Descriptor struct contains UID/GID values:

sif/pkg/sif/sif.go

Lines 332 to 333 in 08f0698

UID int64 // system user owning the file
GID int64 // system group owning the file

These are populated when a data object is created by calling user.Current:

sif/pkg/sif/create.go

Lines 51 to 69 in 08f0698

// Get current user and returns both uid and gid.
func getUserIDs() (int64, int64, error) {
u, err := user.Current()
if err != nil {
return -1, -1, fmt.Errorf("getting current user info: %s", err)
}
uid, err := strconv.Atoi(u.Uid)
if err != nil {
return -1, -1, fmt.Errorf("converting UID: %s", err)
}
gid, err := strconv.Atoi(u.Gid)
if err != nil {
return -1, -1, fmt.Errorf("converting GID: %s", err)
}
return int64(uid), int64(gid), nil
}

UID/GID values are by their nature system specific, and thus these seem to be of limited utility in a container format that is meant to support mobility. I cannot find a single use of these in SingularityCE, nor any other projects using the github.com/sylabs/sif module.

I suggest we deprecate these in github.com/sylabs/sif. In github.com/sylabs/sif/v2, I suggest we set these values to zero, and remove them from the exported API.

@tri-adam tri-adam added the v2 Affects v2 API label Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2 Affects v2 API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant