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

fix(net-schema): no warn when skipping schema check on non-netplan #4819

Conversation

blackboxsw
Copy link
Collaborator

@blackboxsw blackboxsw commented Jan 29, 2024

Proposed Commit Message

    fix(net-schema): no warn when skipping schema check on non-netplan
    
    Avoid warning when network-config schema is version 2 and we
    are on non-netplan systems because cloud-init doesn't yet
    have static JSON network-config schema defined yet for
    version 2.
    
    Also fixes integration test to expect python3 netplan API
    on Ubuntu Mantic and newer.
    
    Fixes GH-4814

Additional Context

Also failed our Jenkins test runners
https://jenkins.canonical.com/server-team/view/cloud-init/job/cloud-init-integration-mantic-lxd_container/139/testReport/junit/tests.integration_tests.cmd.test_schema/TestSchemaDeprecations/test_network_config_schema_validation/

Test Steps

Validation performed with this PR on a system with no netplan python imports available
Notice:

  1. happy cloud-init status without warnings
  2. skipping netplan schema validation debug log
  3. schema validation reporting same reason for skipped validation
root@nnn:~# grep netplan /var/log/cloud-init.log 
2024-01-29 22:09:53,263 - schema.py[DEBUG]: Skipping netplan schema validation. No netplan available
2024-01-29 22:09:53,265 - distros[DEBUG]: Selected renderer 'netplan' from priority list: ['netplan', 'eni', 'sysconfig']
2024-01-29 22:09:53,265 - network_state.py[DEBUG]: Passthrough netplan v2 config
2024-01-29 22:09:53,265 - netplan.py[DEBUG]: V2 to V2 passthrough
2024-01-29 22:09:53,265 - util.py[DEBUG]: Writing to /etc/netplan/50-cloud-init.yaml - wb: [600] 389 bytes
2024-01-29 22:09:53,265 - netplan.py[DEBUG]: skipping call to `netplan generate`. reason: identical netplan config
root@nnn:~# cloud-init schema --system
Found cloud-config data types: user-data, network-config

1. user-data at /var/lib/cloud/instances/77a8ebd1-cae8-4727-83ff-330bf7c9c5e4/cloud-config.txt:
  Valid schema user-data

2. network-config at /var/lib/cloud/instances/77a8ebd1-cae8-4727-83ff-330bf7c9c5e4/network-config.json:
Skipping network-config schema validation. No network schema for version: 2

Checklist

Merge type

  • Squash merge using "Proposed Commit Message"
  • Rebase and merge unique commits. Requires commit messages per-commit each referencing the pull request number (#<PR_NUM>)

@blackboxsw
Copy link
Collaborator Author

CC: @dermotbradley thanks for the issue 👍

@blackboxsw
Copy link
Collaborator Author

#4814

@TheRealFalcon TheRealFalcon self-assigned this Jan 29, 2024
@blackboxsw blackboxsw force-pushed the no-warn-on-netplan-schema-validation-skip branch 2 times, most recently from c49f9c6 to cc9274e Compare January 29, 2024 22:38
Avoid warning when network-config schema is version 2 and we
are on a system within netplan python modules because cloud-init
doesn't ye have static JSON network-config schema defined yet for
version 2.

Also fixes integration test to expect python3 netplan API
on Ubuntu Mantic and newer.

Fixes canonicalGH-4814
@blackboxsw blackboxsw force-pushed the no-warn-on-netplan-schema-validation-skip branch from cc9274e to 81ab1fb Compare January 29, 2024 22:40
Copy link
Member

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@blackboxsw blackboxsw merged commit e168b4a into canonical:main Jan 29, 2024
29 checks passed
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 this pull request may close these issues.

2 participants