-
Notifications
You must be signed in to change notification settings - Fork 7
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
Some small fixes here and there #661
base: main
Are you sure you want to change the base?
Conversation
@@ -172,7 +172,9 @@ func sharedReset(reboot, unattended, resetOem bool, dir ...string) (c *config.Co | |||
|
|||
d, err := json.Marshal(r) | |||
if err != nil { | |||
c.Logger.Errorf("failed to marshal reset cmdline flags/event options: %s", err) | |||
if &c != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was a potential nil reference
@@ -442,7 +424,7 @@ func scan(result *Config, opts ...collector.Option) (c *Config, err error) { | |||
} | |||
} | |||
|
|||
if !kc.IsValid() { | |||
if kc != nil && !kc.IsValid() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
potential nil reference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only a couple of comments. Looks good.
@@ -339,20 +335,6 @@ type Bundle struct { | |||
Targets []string `yaml:"targets,omitempty"` | |||
} | |||
|
|||
const DefaultHeader = "#cloud-config" | |||
|
|||
func HasHeader(userdata, head string) (bool, string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmmh should be implemented there on in the sdk, makes no sense to have a function here that its used bu another library lool
@@ -29,7 +29,7 @@ type OCIImageExtractor struct{} | |||
|
|||
var _ ImageExtractor = OCIImageExtractor{} | |||
|
|||
func (e OCIImageExtractor) ExtractImage(imageRef, destination, platformRef string) error { | |||
func (e OCIImageExtractor) ExtractImage(imageRef, destination, _ string) error { | |||
img, err := utils.GetImage(imageRef, utils.GetCurrentPlatform(), nil, nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we be doing some check that the platformRef matches the current platform or something like that? You already did something like that in the kairos-sdk: https://github.com/kairos-io/kairos-sdk/pull/557/files#diff-5a53c19741f79228c7414fd4f325e7d79935eb2b5c051ae2e44c0d9521542006R111
or is that not the same case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC we are using the sdk here as a backend, this methods were here becuase it was part of the agent before we put in on the sdk and then we moved but could not update or something so we leaved this stub in here. we should be using the sdk ones directly!
Including: - init empty vars as the type - fix import order - fix error strings - fix unused imports - remove unused functions (if needed by anything, they shoudl go into sdk) - fix functions comments - improve constants Signed-off-by: Itxaka <[email protected]>
Signed-off-by: Itxaka <[email protected]>
Signed-off-by: Dimitris Karakasilis <[email protected]>
5a12574
to
218df55
Compare
I fixed the failing test and rebased on main (fixed conflicts). |
Codecov ReportAttention: Patch coverage is
❌ Your project check has failed because the head coverage (6.63%) is below the target coverage (75.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #661 +/- ##
==========================================
+ Coverage 48.09% 48.41% +0.31%
==========================================
Files 48 48
Lines 6161 6135 -26
==========================================
+ Hits 2963 2970 +7
+ Misses 2916 2885 -31
+ Partials 282 280 -2 ☔ View full report in Codecov by Sentry. |
still failing looooool |
Signed-off-by: Dimitris Karakasilis <[email protected]>
fa7d137
to
f5e0ffd
Compare
not anymore :p |
_ = 1 << (10 * iota) | ||
_ | ||
_ | ||
GiB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WAT? hehe I guess it just means we are not using the smaller units 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xDD
I feel weird about that. Its some kind of magic and then it turns into real GiB....
conflicts looooool |
Including: