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

don't pre-create log files (not required anymore) #2267

Merged
merged 3 commits into from
Jun 7, 2023
Merged

Conversation

mmetc
Copy link
Contributor

@mmetc mmetc commented Jun 5, 2023

The lumberjack package fixed the issue in natefinch/lumberjack#83 (tested with umask 002) and this code is now redundant since we updated the dependency to v2.2.1.

Lumberjack seems to behave correctly (tested with umask 002) and this code
should be redundant.
@github-actions
Copy link

github-actions bot commented Jun 5, 2023

@mmetc: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically.

  • /kind feature
  • /kind enhancement
  • /kind fix
  • /kind chore
  • /kind dependencies
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

@github-actions
Copy link

github-actions bot commented Jun 5, 2023

@mmetc: There are no area labels on this PR. You can add as many areas as you see fit.

  • /area agent
  • /area local-api
  • /area cscli
  • /area security
  • /area configuration
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

@mmetc mmetc added this to the 1.5.3 milestone Jun 5, 2023
@mmetc
Copy link
Contributor Author

mmetc commented Jun 5, 2023

@codecov
Copy link

codecov bot commented Jun 5, 2023

Codecov Report

Merging #2267 (360b62a) into master (0191faf) will increase coverage by 4.09%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #2267      +/-   ##
==========================================
+ Coverage   51.53%   55.63%   +4.09%     
==========================================
  Files         182      182              
  Lines       25541    25527      -14     
==========================================
+ Hits        13163    14202    +1039     
+ Misses      10846     9761    -1085     
- Partials     1532     1564      +32     
Flag Coverage Δ
bats 37.25% <100.00%> (+<0.01%) ⬆️
unit-linux 54.47% <100.00%> (?)
unit-windows 50.96% <50.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/apiserver/apiserver.go 65.10% <100.00%> (-0.57%) ⬇️
pkg/types/utils.go 57.44% <100.00%> (-2.29%) ⬇️

... and 31 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@mmetc mmetc requested a review from buixor June 5, 2023 15:01
@LaurenceJJones
Copy link
Contributor

LaurenceJJones commented Jun 5, 2023

Should we also catch the crowdsec_api.log also?

_, err := os.Stat(logFile)
// create file if not exists, purposefully ignore errors
if os.IsNotExist(err) {
file, _ := os.OpenFile(logFile, os.O_RDWR|os.O_CREATE, 0600)
file.Close()
}

@mmetc mmetc merged commit 5b32001 into master Jun 7, 2023
@mmetc mmetc deleted the lumberjack-perms branch June 7, 2023 10:58
mmetc added a commit that referenced this pull request Jun 9, 2023
The lumberjack package fixed the issue in natefinch/lumberjack#83 (tested with umask 002) and this code is now redundant since we updated the dependency to v2.2.1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants