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: Ensure working dir for bloomstore exists #12019

Merged
merged 5 commits into from
Feb 22, 2024

Conversation

chaudum
Copy link
Contributor

@chaudum chaudum commented Feb 21, 2024

What this PR does / why we need it:

Fail startup if directory does not exist or there are not enough permissions. This prevents the bloomstore to fail later in the process once it tries to download and extract blocks.

@chaudum chaudum requested a review from a team as a code owner February 21, 2024 11:00
@chaudum chaudum changed the title Ensure working dir for bloomstore exists fix: Ensure working dir for bloomstore exists Feb 21, 2024
@chaudum chaudum requested review from owen-d and salvacorts February 21, 2024 15:30
@pull-request-size pull-request-size bot added size/L and removed size/M labels Feb 21, 2024
@chaudum chaudum force-pushed the chaudum/ensure-bloomstore-dir branch from 9ef3b11 to 146a4ac Compare February 21, 2024 22:22
@pull-request-size pull-request-size bot added size/M and removed size/L labels Feb 21, 2024
@chaudum chaudum force-pushed the chaudum/ensure-bloomstore-dir branch from 146a4ac to 037c0b5 Compare February 22, 2024 07:48
@chaudum chaudum force-pushed the chaudum/ensure-bloomstore-dir branch from 037c0b5 to f54afc8 Compare February 22, 2024 09:01
@chaudum chaudum requested review from salvacorts and owen-d February 22, 2024 09:32
@@ -72,6 +72,8 @@ func EnsureDirectory(dir string) error {
return os.MkdirAll(dir, 0o777)
} else if err == nil && !info.IsDir() {
return fmt.Errorf("not a directory: %s", dir)
} else if err == nil && info.Mode()&0700 != 0700 {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd maybe set these 0700 masks as const describing which permissions they set.

@chaudum chaudum merged commit b9ce005 into main Feb 22, 2024
11 checks passed
@chaudum chaudum deleted the chaudum/ensure-bloomstore-dir branch February 22, 2024 09:41
onelapahead pushed a commit to onelapahead/loki that referenced this pull request Feb 22, 2024
Fail startup if directory does not exist or there are not enough permissions. This prevents the bloomstore to fail later in the process once it tries to download and extract blocks.

Signed-off-by: Christian Haudum <[email protected]>
onelapahead pushed a commit to onelapahead/loki that referenced this pull request Feb 22, 2024
Fail startup if directory does not exist or there are not enough permissions. This prevents the bloomstore to fail later in the process once it tries to download and extract blocks.

Signed-off-by: Christian Haudum <[email protected]>
rhnasc pushed a commit to inloco/loki that referenced this pull request Apr 12, 2024
Fail startup if directory does not exist or there are not enough permissions. This prevents the bloomstore to fail later in the process once it tries to download and extract blocks.

Signed-off-by: Christian Haudum <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants