← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1979491] [NEW] schema: wrong validation of cc_users_groups

 

Public bug reported:

The schema validation does detect the following wrong schema as valid:

```yaml
#cloud-config
groups:
  - 3.14
```

Steps to reproduce:

```sh
cat <<EOF > /tmp/user-data
#cloud-config
groups:
  - 3.14
EOF

lxc launch ubuntu-daily:jammy gg --config=user.user-data="$(cat /tmp/user-data)"
$ lxc exec gg -- cloud-init status --wait
..............
status: error

$ lxc exec gg -- grep -ni "error" /var/log/cloud-init.log
412:    raise TypeError(
413:TypeError: Unknown group name type float
440:    raise TypeError(
441:TypeError: Unknown group name type float

$ lxc exec gg -- cloud-init schema --system
Valid cloud-config: system userdata

$ lxc exec gg -- echo $?
0
```

The schema validation should detect this schema as invalid.

** Affects: cloud-init
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1979491

Title:
  schema: wrong validation of cc_users_groups

Status in cloud-init:
  New

Bug description:
  The schema validation does detect the following wrong schema as valid:

  ```yaml
  #cloud-config
  groups:
    - 3.14
  ```

  Steps to reproduce:

  ```sh
  cat <<EOF > /tmp/user-data
  #cloud-config
  groups:
    - 3.14
  EOF

  lxc launch ubuntu-daily:jammy gg --config=user.user-data="$(cat /tmp/user-data)"
  $ lxc exec gg -- cloud-init status --wait
  ..............
  status: error

  $ lxc exec gg -- grep -ni "error" /var/log/cloud-init.log
  412:    raise TypeError(
  413:TypeError: Unknown group name type float
  440:    raise TypeError(
  441:TypeError: Unknown group name type float

  $ lxc exec gg -- cloud-init schema --system
  Valid cloud-config: system userdata

  $ lxc exec gg -- echo $?
  0
  ```

  The schema validation should detect this schema as invalid.

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1979491/+subscriptions



Follow ups