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

Docker command migration #1281

Merged
merged 7 commits into from
May 1, 2024
Merged

Conversation

MorningLightMountain713
Copy link
Contributor

What this pull does

  • Updates deviceHelper child_process commands.
    *. Uses the more modern findmnt instead of mount
    *. Added a bunch of notes so in 6 months time I remember how things work.
    *. Removes the df command - not needed anymore with findmnt.
    *. Log output if the module is run via node directly.
  • Updates dockerService, with new command.
  • Updates dockerService to use new command runner for FixDockerLogs.sh
  • Add new deviceHelper tests
  • Fix fluxNetworkService tests (not part of this pull but needed fixing)
  • Remove node-cmd requirement from dockerService and deviceHelper modules

@XK4MiLX - Can you please check the deviceHelper stuff, I'm pretty sure this is correct but want to make certain.

I haven't run this on any nodes yet - will do that this afternoon.

@MorningLightMountain713
Copy link
Contributor Author

All tests passing now

Screenshot 2024-04-21 at 11 45 47 AM

@Cabecinha84 Cabecinha84 requested review from XK4MiLX and removed request for XK4MiLX April 26, 2024 15:55
// this always has length
if (lines.slice(-1)[0] === '') lines.pop();

lines.forEach((line) => log.info(line));
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't all this continue inside a try catch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah nice spot, the stdout.split() could throw, I'll fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This highlighted an error I had in runCommand, stdout and stderr as allways returned as strings from child_process execFile. I've fixed this up (and tests). Now the above code will never throw. Howver, for safety, have wrapped in a try / catch

@Cabecinha84 Cabecinha84 merged commit 08962c0 into development May 1, 2024
2 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

2 participants