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

Respect user defined/default sizes on upgrade #587

Merged
merged 1 commit into from
Nov 6, 2024
Merged

Conversation

Itxaka
Copy link
Member

@Itxaka Itxaka commented Nov 5, 2024

We were ignoring if the user set any values in there and just overwriting it with our calculated size

Fixes kairos-io/kairos#2985

@Itxaka Itxaka requested review from a team and Copilot November 5, 2024 15:03
@Itxaka
Copy link
Member Author

Itxaka commented Nov 5, 2024

2024-11-05T15:01:09Z DBG Calculated size (3016Mb) is less than specified/default size (8192Mb)
2024-11-05T15:01:09Z INF Setting image size to 8192Mb

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 suggestion.

Comments skipped due to low confidence (1)

pkg/config/spec.go:2

  • The error returned by 'runner.Run' is being ignored. Consider handling the error to ensure any issues are properly logged or managed.
out, _ := runner.Run("cat", "/proc/cmdline")

pkg/config/spec.go Show resolved Hide resolved
@Itxaka Itxaka force-pushed the respect_user_size branch from a69eecf to f3e44c9 Compare November 5, 2024 15:06
@Itxaka Itxaka requested a review from Copilot November 5, 2024 15:06
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 suggestions.

pkg/config/spec.go Outdated Show resolved Hide resolved
pkg/config/spec.go Outdated Show resolved Hide resolved
pkg/config/spec.go Outdated Show resolved Hide resolved
pkg/config/spec.go Fixed Show fixed Hide fixed
pkg/config/spec.go Fixed Show fixed Hide fixed
pkg/config/spec.go Fixed Show fixed Hide fixed
pkg/config/spec.go Fixed Show fixed Hide fixed
@Itxaka Itxaka force-pushed the respect_user_size branch from f3e44c9 to a3fbb50 Compare November 5, 2024 15:11
@Itxaka Itxaka requested a review from Copilot November 5, 2024 15:12

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no suggestions.

Comments skipped due to low confidence (2)

pkg/config/spec.go:432

  • The units for size should be consistent. Ensure that both sizes are represented in the same unit (MB or Mb).
cfg.Logger.Debugf("Calculated size (%dMB) is less than specified/default size (%dMB)", size, originalSize)

pkg/config/spec.go:431

  • There is a potential type mismatch between originalSize (uint) and size (int64). Consider using the same type for both variables to avoid unexpected behavior.
if uint(size) < originalSize {
pkg/config/spec.go Dismissed Show dismissed Hide dismissed
pkg/config/spec.go Dismissed Show dismissed Hide dismissed
@Itxaka Itxaka requested a review from Copilot November 6, 2024 10:19
Copy link

codecov bot commented Nov 6, 2024

Codecov Report

Attention: Patch coverage is 95.65217% with 1 line in your changes missing coverage. Please review.

Project coverage is 48.34%. Comparing base (7cb2219) to head (c8bf3f3).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
pkg/config/spec.go 95.45% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #587      +/-   ##
==========================================
+ Coverage   48.23%   48.34%   +0.11%     
==========================================
  Files          48       48              
  Lines        6002     6017      +15     
==========================================
+ Hits         2895     2909      +14     
- Misses       2831     2833       +2     
+ Partials      276      275       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 7 changed files in this pull request and generated no suggestions.

Files not reviewed (2)
  • pkg/config/config_test.go: Evaluated as low risk
  • pkg/action/upgrade_test.go: Evaluated as low risk
@Itxaka Itxaka requested a review from jimmykarily November 6, 2024 10:25
We were ignoring if the user set any values in there and just
overwriting it with our calculated size

Signed-off-by: Itxaka <[email protected]>
@Itxaka Itxaka force-pushed the respect_user_size branch from 4a21f59 to c8bf3f3 Compare November 6, 2024 10:31
@Itxaka Itxaka merged commit 6634e18 into main Nov 6, 2024
14 checks passed
@Itxaka Itxaka deleted the respect_user_size branch November 6, 2024 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Image loopback size discrepancy after upgrade
2 participants