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

refactor: move checksum calculation to utils #443

Merged
merged 1 commit into from
Aug 3, 2024

Conversation

h0lyalg0rithm
Copy link
Contributor

@h0lyalg0rithm h0lyalg0rithm commented Aug 2, 2024

Proposed changes

Move sha256 calculation to utils.go file.
Add tests to validate change

Types of changes

What types of changes does your code introduce to the repo? Put an x in the boxes that apply

  • New feature (non-breaking change which adds functionality)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices applies)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have signed the commit for DCO to be passed.
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have added necessary documentation (if appropriate)

@h0lyalg0rithm h0lyalg0rithm requested a review from a team as a code owner August 2, 2024 21:01
Copy link
Member

@glimchb glimchb left a comment

Choose a reason for hiding this comment

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

@h0lyalg0rithm this is great, please fix small gosec issue

  ::medium file=sztp-agent/pkg/secureagent/utils.go,line=72,col=12::G304: Potential file inclusion via variable (gosec)

@glimchb
Copy link
Member

glimchb commented Aug 2, 2024

@h0lyalg0rithm in a separate PR , not here, wdyt to move downloadAndValidateImage(), copyConfigurationFile(), launchScriptsConfiguration() to a new file... ? it looks not belonging to daemon.go

@glimchb glimchb added the Merge Candidate in the open merge window, next candidate for merge label Aug 2, 2024
@h0lyalg0rithm
Copy link
Contributor Author

@h0lyalg0rithm in a separate PR , not here, wdyt to move downloadAndValidateImage(), copyConfigurationFile(), launchScriptsConfiguration() to a new file... ? it looks not belonging to daemon.go

I think we should update the golinter version as it displays the line with the issue in the github action run.Here is the output
https://github.com/h0lyalg0rithm/sztp/actions/runs/10222129019/job/28286107496

Signed-off-by: Suraj Shirvankar <surajshirvankar@gmail.com>
@h0lyalg0rithm
Copy link
Contributor Author

@h0lyalg0rithm in a separate PR , not here, wdyt to move downloadAndValidateImage(), copyConfigurationFile(), launchScriptsConfiguration() to a new file... ? it looks not belonging to daemon.go

Yes it makes sense to move them

@glimchb
Copy link
Member

glimchb commented Aug 3, 2024

I think we should update the golinter version

sure, go for it

@glimchb glimchb merged commit afe7fa5 into opiproject:main Aug 3, 2024
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Merge Candidate in the open merge window, next candidate for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants