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

Netplan state diff #386

Merged
merged 12 commits into from
Nov 29, 2023
Merged

Netplan state diff #386

merged 12 commits into from
Nov 29, 2023

Commits on Nov 27, 2023

  1. netdef: simplify NetplanRoute __eq__ and __hash__

    There are some fields that exist in Netplan but not in the system and
    vice-versa, such as on-link and protocol. Using the default dataclass
    methods makes it harder to compare objects.
    daniloegea committed Nov 27, 2023
    Configuration menu
    Copy the full SHA
    61316b5 View commit details
    Browse the repository at this point in the history

Commits on Nov 29, 2023

  1. state_diff: add the new state_diff submodule

    The state_diff submodule is responsible for comparing system's and
    netplan's states and calculating the differences.
    
    The new class NetplanDiffState must be instantiated with both states.
    The method get_full_state() will return both system's and netplan's
    states without calculating the differences.
    
    The diff calculation will be added in the next commits.
    daniloegea committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    d103617 View commit details
    Browse the repository at this point in the history
  2. state_diff: add the get_diff() method

    The get_diff() will calculate the differences between system's and
    Netplan's states and return a report to the caller.
    
    This commit adds support for checking what interfaces are present only
    in one of the states.
    daniloegea committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    68e998e View commit details
    Browse the repository at this point in the history
  3. state_diff: add support for IP addresses analysis

    get_diff() will compare and report differences in the addresses present
    in the system and Netplan. Addresses detected as dynamically assigned
    will not be reported as missing as they will not be defined in Netplan.
    daniloegea committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    336905a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7a9ea67 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5605817 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    ea58943 View commit details
    Browse the repository at this point in the history
  7. state_diff: add support for routes analysis

    A number of heuristics are implemented to eliminate routes we don't want
    to compare, such as routes installed dynamically, as they will not be
    found in Netplan.
    daniloegea committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    2969a3f View commit details
    Browse the repository at this point in the history
  8. state_diff: add a JSON encoder for NetplanRoutes

    It will be used to serialize the state and diff.
    daniloegea committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    65a1921 View commit details
    Browse the repository at this point in the history
  9. state_diff: add more information to the missing_interfaces result

    For netplan interfaces add the name and type. For system interfaces add
    the name, type and index.
    daniloegea committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    df64595 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    59d8a19 View commit details
    Browse the repository at this point in the history
  11. tools/diff.py: add a temporary tool to test netplan diff

    Also add a few integrations tests that use tools/diff.py to test the
    diff against a running system configured with Netplan.
    daniloegea committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    5fddf54 View commit details
    Browse the repository at this point in the history