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

The /etc/cloud/cloud.cfg will be also be filtered, expected content is not collected. #3482

Closed
xiangce opened this issue Jul 25, 2022 · 0 comments · Fixed by #3484
Closed

Comments

@xiangce
Copy link
Contributor

xiangce commented Jul 25, 2022

When specifying the filters of the cloud_cfg spec as

add_filter(Specs.cloud_cfg, ['network', 'ssh_deletekeys', 'debug'])

The collected file will look like:

{"debug": {"output": "/var/log/cloud-init-debug.log"}, "network": null, "ssh_deletekeys": 1}

But in fact, the original content is:

users:
  - name: demo
    ssh-authorized-keys:
      - key_one
      - key_two
    passwd: $6$j212wezy$7H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/

ssh_deletekeys: 1

network:
    version: 1
    config:
    - type: physical
        name: eth0
        subnets:
          - type: dhcp
          - type: dhcp6

system_info:
    default_user:
    name: user2
    plain_text_passwd: 'someP@assword'
    home: /home/user2

debug:
    output: /var/log/cloud-init-debug.log
    verbose: true

The expected network should not be null

@xiangce xiangce changed the title The `/etc/cloud/cloud.cfg' will be also be filtered, result in expected content is not collected. The `/etc/cloud/cloud.cfg' will be also be filtered, expected content is not collected. Jul 26, 2022
@xiangce xiangce changed the title The `/etc/cloud/cloud.cfg' will be also be filtered, expected content is not collected. The /etc/cloud/cloud.cfg will be also be filtered, expected content is not collected. Jul 26, 2022
xiangce added a commit that referenced this issue Sep 1, 2022
* fix: change cloud_cfg to Yaml and modify the filtering target

- fix: #3482
- fix: #3478

Signed-off-by: Xiangce Liu <[email protected]>

* forget the tests
* fix doc test

Signed-off-by: Xiangce Liu <[email protected]>

* for python26 - 2
* add more doc for specs

Signed-off-by: Xiangce Liu <[email protected]>

* fix the doc tests

Signed-off-by: Xiangce Liu <[email protected]>
xiangce added a commit that referenced this issue Sep 1, 2022
* fix: change cloud_cfg to Yaml and modify the filtering target

- fix: #3482
- fix: #3478

Signed-off-by: Xiangce Liu <[email protected]>

* forget the tests
* fix doc test

Signed-off-by: Xiangce Liu <[email protected]>

* for python26 - 2
* add more doc for specs

Signed-off-by: Xiangce Liu <[email protected]>

* fix the doc tests

Signed-off-by: Xiangce Liu <[email protected]>
(cherry picked from commit d42266a)
xiangce added a commit that referenced this issue Sep 6, 2024
* fix: change cloud_cfg to Yaml and modify the filtering target

- fix: #3482
- fix: #3478

Signed-off-by: Xiangce Liu <[email protected]>

* forget the tests
* fix doc test

Signed-off-by: Xiangce Liu <[email protected]>

* for python26 - 2
* add more doc for specs

Signed-off-by: Xiangce Liu <[email protected]>

* fix the doc tests

Signed-off-by: Xiangce Liu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant