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

Fix windows runtime dir #1810

Merged
merged 1 commit into from
Jan 29, 2024
Merged

Fix windows runtime dir #1810

merged 1 commit into from
Jan 29, 2024

Conversation

ashley-cui
Copy link
Member

@ashley-cui ashley-cui commented Jan 29, 2024

Needed to un-break podman win main.

Needs to be vendored into common, then into podman.

Co-authored-by: Giuseppe Scrivano <[email protected]>
Co-authored-by: Ashley Cui <[email protected]>
Signed-off-by: Ashley Cui <[email protected]>
@ashley-cui
Copy link
Member Author

Thanks! @giuseppe

cc @mheon @baude @TomSweeneyRedHat

@mheon
Copy link
Member

mheon commented Jan 29, 2024

LGTM
@nalind PTAL

@baude
Copy link
Member

baude commented Jan 29, 2024

/approve

Copy link
Contributor

openshift-ci bot commented Jan 29, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ashley-cui, baude
Once this PR has been reviewed and has the lgtm label, please assign edsantiago for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rhatdan rhatdan merged commit 3e39962 into containers:main Jan 29, 2024
17 of 18 checks passed
if err != nil {
return "", err
}
runtimeDir := filepath.Join(data, "containers", "podman")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a weird name choice when the code making it lives in this repository.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opened a PR to fix it: #1812

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i agree ... seems misplaced

// GetShortcutString returns the string that is shortcut to user's home directory
// in the native shell of the platform running on.
func GetShortcutString() string {
return "%USERPROFILE%" // be careful while using in format functions
}

// StickRuntimeDirContents is a no-op on Windows
func StickRuntimeDirContents(files []string) ([]string, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This has no callers, and IMHO pretty suspect description/implementation… I wouldn’t mind if it just somehow went missing ;) )

// environment variables depending on the target operating system.
// Returned path should be used with "path/filepath" to form new paths.
func GetConfigHome() (string, error) {
return filepath.Join(Get(), ".config"), nil
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn’t this preserve the error handling from homedir_others? The path where Get() returns "" seems to be reachable in principle.

if err != nil {
return "", err
}
runtimeDir := filepath.Join(data, "containers", "podman")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is ~/.local/share/containers/podman? On Linux, “runtime” and “data” dirs are different directories with different lifetimes (and hypothetically naming conflicts).

OTOH I appreciate that Podman’s pkg/util.GetRootlessRuntimeDir has been using this path… I guess we are trusting Jason?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants