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

bugfix: use os.Create to write env rendered file #2175

Merged

Conversation

kakaZhou719
Copy link
Member

Describe what this PR does / why we need it

os.OpenFile(strings.TrimSuffix(path, templateSuffix), os.O_CREATE|os.O_RDWR, os.ModePerm)

if file is exits, without O_TRUNC mod, will leads to uncontrollable results. so we do better use os.Create to write rendered file.

Does this pull request fix one issue?

Describe how you did it

Describe how to verify it

Special notes for reviews

@codecov-commenter
Copy link

codecov-commenter commented Apr 10, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -6.43 ⚠️

Comparison is base (006e1db) 19.34% compared to head (1567540) 12.91%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2175      +/-   ##
==========================================
- Coverage   19.34%   12.91%   -6.43%     
==========================================
  Files          96      260     +164     
  Lines        8919    22228   +13309     
==========================================
+ Hits         1725     2870    +1145     
- Misses       6953    18967   +12014     
- Partials      241      391     +150     
Flag Coverage Δ
e2e-tests 8.60% <ø> (?)
unit-tests 19.34% <100.00%> (ø)

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

Impacted Files Coverage Δ
pkg/env/env.go 50.98% <100.00%> (ø)

... and 164 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@Stevent-fei Stevent-fei left a comment

Choose a reason for hiding this comment

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

LGTM

@Stevent-fei Stevent-fei merged commit 70bb9ff into sealerio:main Apr 10, 2023
11 checks passed
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.

None yet

3 participants