nmstate / nmstate

Nmstate is a library with an accompanying command line tool that manages host networking settings in a declarative manner.
https://nmstate.io
Apache License 2.0
289 stars 99 forks source link

typo in config key should break validation #1997

Open javipolo opened 2 years ago

javipolo commented 2 years ago

Describe the bug

When having a wrong key in nmstate yaml, it is ignored when generating configurations, and then a wrong configuration is generated without any kind of warnings or errors

In newer versions, this is not an issue anymore, and it would be great to have that to be backported to 1.3.0

Nmstate version

How reproducible

Steps to Reproduce

interfaces:
- name: eth0
  type: ethernet
  state: up
  # Note the typo here, ipv5 instead of ipv4
  ipv5:
    address:
    - ip: 192.168.122.250
      prefix-length: 24
    enabled: true

Nmstate output

cathay4t commented 2 years ago

With nmstate 2.1+ (rust rewrite, targeting for RHEL 9.1+), the output changed to:

[fge@c9s ~]$ sudo nmstatectl gc /tmp/a.yml
serde_yaml::Error: unknown field `ipv5`

The 1.x branch is entering maintenance stage for RHEL 8.x.

@javipolo Do you still need fix in 1.x branch?

javipolo commented 2 years ago

Yes @cathay4t, we would need the fix for the 1.x version ... :sweat_smile:

We're working to migrate to the rust rewrite, but we're still far from it