Uploaded image for project: 'Machine Config Operator'
  1. Machine Config Operator
  2. MCO-1925

Migrate direct runCmdSync() to use CommandRunner in the MCD

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • None
    • 0

      Story:
      A CommandRunner interface was introduced in OCPBUGS-62714 as part of a bugfix. This interface abstracts command execution (exec.Command) to improve testability and flexibility, but it's not complete and it's not consumed as a central API to run exec commands in the MCD due to the bugfix nature of the original PR.

      1. Extending it's usages to replace all the calls to exec.Command that are not the ones of runGetOut (that effort is covered by MCO-1924).
      2. Update the unit tests to run, if possible, the mocked commands.
      3. Remove the runCmdSync free function

      Acceptance Criteria:
        - All direct runCmdSync() calls migrated to use CommandRunner interface
        - Global runCmdSync() function removed
        - All affected structs use dependency injection for CommandRunner
        - Existing tests updated and passing
        - New unit tests added for migrated code
        - No regression in functionality

              Unassigned Unassigned
              rh-ee-pabrodri Pablo Rodriguez Nava
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: