Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-65522

Please unify ip rule subnet sanitizing in creation and removal

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • rhel-9.6
    • nmstate
    • No
    • Low
    • 1
    • rhel-sst-network-management
    • ssg_networking
    • 2
    • False
    • Hide

      None

      Show
      None
    • None
    • Future releases
    • Hide

      Given a system administrator has created route rules with specific IP subnets using Nmstate,

      When they attempt to remove these route rules by setting the rule’s state to absent,

      Then Nmstate should automatically sanitize the IP subnets for deletion to make sure the rule is removed without manual adjustments. 

      Definition of Done:

      • The implementation meets the acceptance criteria
      • Integration tests are written and pass 
      • The fix is part of a downstream build attached to an errata
      Show
      Given a system administrator has created route rules with specific IP subnets using Nmstate, When they attempt to remove these route rules by setting the rule’s state to absent, Then Nmstate should automatically sanitize the IP subnets for deletion to make sure the rule is removed without manual adjustments.  Definition of Done: The implementation meets the acceptance criteria Integration tests are written and pass  The fix is part of a downstream build attached to an errata
    • None
    • None
    • None

      What were you trying to do that didn't work?

      Given a YAML file unformatted.yaml:

      route-rules:
        config:
          - ip-from: 192.0.2.1/24
            priority: 1001
            route-table: 50
          - ip-to: 100::1/64
            priority: 1000
            route-table: 50

      to create, nmstate converts the ip subnet to 192.0.2.0/24 and 100::/64 according to the subnet mask

      But when wanting to delete them, simply append `state: absent` to the rule items, say unformatted-absent.yaml:

      route-rules:
        config:
          - ip-from: 192.0.2.1/24
            priority: 1001
            route-table: 50
            state: absent
          - ip-to: 100::1/64
            priority: 1000
            route-table: 50
            state: absent

      then apply it. In this case, nmstate literally uses 192.0.2.1/24 and 100::1/64, matches nothing to delete.

      What is the impact of this issue to you?

      I cannot remove the route rules by simply modifying creating file, I have to look up the current state or convert the subnet by myself then remove them.

      Please provide the package NVR for which the bug is seen:

      nmstate-2.2.38-1.el9.x86_64
      NetworkManager-1.51.2-2.el9.x86_64

      How reproducible is this bug?:

      100%

      Steps to reproduce

      nmstatectl apply unformatted.yaml
      ip rule
      ip -6 rule
      nmstatectl apply unformatted-absent.yaml
      # still there
      ip rule
      ip -6 rule
      

       

      Expected results

      The rules are removed

      The behavior (convert ip subnet or not) should be the same in route rules creation and deletion. 

      Actual results

              rh-ee-sfaye Stanislas Faye
              rh-ee-mshi1 Mingyu Shi
              Network Management Team Network Management Team
              Mingyu Shi Mingyu Shi
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated: