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

options: fall back to default graph and run root for empty case #1083

Merged
merged 2 commits into from
Dec 2, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions types/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ func init() {
}
ReloadConfigurationFileIfNeeded(defaultConfigFile, &defaultStoreOptions)
}
// reload could set values to empty for run and graph root if config does not contains anything
if defaultStoreOptions.RunRoot == "" {
defaultStoreOptions.RunRoot = "/run/containers/storage"
Copy link
Member

Choose a reason for hiding this comment

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

Will this work in rootless mode?

Copy link
Member

Choose a reason for hiding this comment

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

At least make these a constant.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@rhatdan I think issue only happens for rootful case. But i need to try it myself ill confirm it and make changes.

And sure I agree ill make these constant.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@rhatdan Following bug is only for rootful* users for rootless path is constructed via getRootlessStorageOpts() which handles case correctly.

}
if defaultStoreOptions.GraphRoot == "" {
defaultStoreOptions.GraphRoot = "/var/lib/containers/storage"
}
}

// defaultStoreOptionsIsolated is an internal implementation detail of DefaultStoreOptions to allow testing.
Expand Down