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

Conversation

flouthoc
Copy link
Collaborator

@flouthoc flouthoc commented Dec 2, 2021

While reloading from config files graph and run root could be set to
empty. We should fall back to default if they are empty.

Closes: containers/podman#12467

While reloading from config files `graph` and `run` root could be set to
empty. We should fall back to default if they are empty.

See: containers/podman#12467

Signed-off-by: Aditya Rajan <arajan@redhat.com>
@flouthoc
Copy link
Collaborator Author

flouthoc commented Dec 2, 2021

Still need to add tests for this.

@flouthoc flouthoc marked this pull request as draft December 2, 2021 11:42
types/options.go Outdated
@@ -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.

Signed-off-by: Aditya Rajan <arajan@redhat.com>
@flouthoc flouthoc marked this pull request as ready for review December 2, 2021 15:59
@rhatdan
Copy link
Member

rhatdan commented Dec 2, 2021

@umohnani8
Copy link
Member

LGTM, are we waiting for tests to be added?

@rhatdan rhatdan merged commit 0cdedf0 into containers:main Dec 2, 2021
@vrothberg
Copy link
Member

LGTM, are we waiting for tests to be added?

I am also in the "adding tests camp". There's no guarantee we won't regress another time.

@flouthoc
Copy link
Collaborator Author

flouthoc commented Dec 3, 2021

Still need to add tests for this.

@umohnani8 @vrothberg Yes i was trying to figure out the best way to test this in c/storage but unfortunately i was unable to test buggy behavior in c/storage would it be fine if i test this in podman ?

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.

graphroot and runroot default to current directory
4 participants