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

Inconsistency in validation of user-groups in cloud-init #1083

Closed
nano2007 opened this issue Mar 10, 2023 · 0 comments · Fixed by #1077
Closed

Inconsistency in validation of user-groups in cloud-init #1083

nano2007 opened this issue Mar 10, 2023 · 0 comments · Fixed by #1077
Assignees
Labels
bug Something isn't working

Comments

@nano2007
Copy link

Kairos version:

Welcome to Kairos!

Refer to https://kairos.io for documentation.
Last login: Thu Mar 9 17:47:18 2023 from 10.61.1.75
rancher@cryptoflow:~$ cat /etc/os-release
NAME="kairos-debian"
VERSION="v1.6.1-k3sv1.26.1+k3s1"
ID="kairos"
ID_LIKE="kairos-debian"
VERSION_ID="v1.6.1-k3sv1.26.1+k3s1"
PRETTY_NAME="kairos-debian v1.6.1-k3sv1.26.1+k3s1"
ANSI_COLOR="0;32"
BUG_REPORT_URL="https://github.com/kairos-io/kairos/issues/new/choose"
HOME_URL="https://github.com/kairos-io/provider-kairos"
IMAGE_REPO="quay.io/kairos/kairos-debian"
IMAGE_LABEL="latest"
GITHUB_REPO="kairos-io/provider-kairos"
VARIANT="core"
FLAVOR="opensuse-leap"

CPU architecture, OS, and Version:

Linux cryptoflow 6.1.0-3-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.8-1 (2023-01-29) x86_64 GNU/Linux

Describe the bug

I see an inconsistency in the cloud-init format for defining user-groups in kairos. As an example, if I have the following defined in /oem/66_users.yaml:

#cloud-config
users:
  - name: "tester"
    passwd: "tester"
    shell: /bin/bash
    homedir: "/home/tester"
    groups: ["admin"]

On rebooting the box, the tester user gets created and is a member of the admin group. But if I try to validate the above yaml file using kairos-agent validate, the following error is seen:

jsonschema: '/users/0/groups' does not validate with file:///home/tester/schema.json#/properties/users/items/$ref/properties/groups/type: expected string, but got array.

According to the kairos documentation, it should indeed be a string like below, but in this case the user is not getting added to the admin group.

#cloud-config
users:
  - name: "tester"
    passwd: "tester"
    shell: /bin/bash
    homedir: "/home/tester"
    groups: "admin"

To Reproduce

As described above.

Expected behavior

The schema used by kairos should be consistent with what cloud-init supports and it should be consistent in the system as well

Logs

Additional context

@nano2007 nano2007 added the bug Something isn't working label Mar 10, 2023
@Itxaka Itxaka assigned Itxaka and unassigned mudler Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants