-
Notifications
You must be signed in to change notification settings - Fork 918
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
Clarify subiquity docs #5957
Merged
Merged
Clarify subiquity docs #5957
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
cc_ubuntu_autoinstall: | ||
description: | | ||
The ``autoinstall`` key indicates a configuration for the Ubuntu installer. | ||
It is not acted on by cloud-init other than to ensure that the | ||
configuration is schema compliant and that the installer package is | ||
present on the system. | ||
Cloud-init is used by the Ubuntu installer in two stages. | ||
The ``autoinstall`` key may contain a configuration for the Ubuntu | ||
installer. | ||
|
||
Cloud-init verifies that an ``autoinstall`` key contains a ``version`` key | ||
and that the installer package is present on the system. | ||
|
||
.. note:: | ||
The installer may use the provided configuration to instrument | ||
cloud-init on the target system. See | ||
`the Ubuntu installer documentation <https://canonical-subiquity.readthedocs-hosted.com/en/latest/reference/autoinstall-reference.html#user-data>`_ | ||
for more information. | ||
The Ubuntu installer might pass part of this configuration to cloud-init | ||
during a later boot as part of the install process. | ||
See `the Ubuntu installer documentation <https://canonical-subiquity.readthedocs-hosted.com/en/latest/reference/autoinstall-reference.html#user-data>`_ | ||
for more information. Please direct Ubuntu installer questions to | ||
their IRC channel (#ubuntu-server on Libera). | ||
examples: | ||
- comment: | | ||
Example 1: | ||
file: cc_ubuntu_autoinstall/example1.yaml | ||
name: Ubuntu Autoinstall | ||
title: Support Ubuntu live-server install syntax | ||
title: Autoinstall configuration is ignored (but validated) by cloud-init. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,33 +38,6 @@ | |
) | ||
|
||
|
||
class TestvalidateConfigSchema: | ||
@pytest.mark.parametrize( | ||
"src_cfg,error_msg", | ||
[ | ||
pytest.param( | ||
{"autoinstall": 1}, | ||
"autoinstall: Expected dict type but found: int", | ||
id="err_non_dict", | ||
), | ||
pytest.param( | ||
{"autoinstall": {}}, | ||
"autoinstall: Missing required 'version' key", | ||
id="err_require_version_key", | ||
), | ||
pytest.param( | ||
{"autoinstall": {"version": "v1"}}, | ||
"autoinstall.version: Expected int type but found: str", | ||
id="err_version_non_int", | ||
), | ||
], | ||
) | ||
def test_runtime_validation_errors(self, src_cfg, error_msg): | ||
"""cloud-init raises errors at runtime on invalid autoinstall config""" | ||
with pytest.raises(SchemaValidationError, match=error_msg): | ||
cc_ubuntu_autoinstall.validate_config_schema(src_cfg) | ||
|
||
|
||
@mock.patch(MODPATH + "util.wait_for_snap_seeded") | ||
@mock.patch(MODPATH + "subp.subp") | ||
class TestHandleAutoinstall: | ||
|
@@ -73,14 +46,6 @@ class TestHandleAutoinstall: | |
@pytest.mark.parametrize( | ||
"cfg,snap_list,subp_calls,logs,snap_wait_called", | ||
[ | ||
pytest.param( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This never happens in the codebase due to |
||
{}, | ||
SAMPLE_SNAP_LIST_OUTPUT, | ||
[], | ||
["Skipping module named name, no 'autoinstall' key"], | ||
False, | ||
id="skip_no_cfg", | ||
), | ||
pytest.param( | ||
{"autoinstall": {"version": 1}}, | ||
SAMPLE_SNAP_LIST_OUTPUT, | ||
|
@@ -149,6 +114,8 @@ class TestAutoInstallSchema: | |
{"autoinstall": {}}, | ||
"autoinstall: 'version' is a required property", | ||
), | ||
({"autoinstall": {"version": 1}}, None), | ||
({"autoinstall": {"version": "v1"}}, "is not of type 'integer'"), | ||
), | ||
) | ||
@skipUnlessJsonSchema() | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage on this module remains at 100% after removing these tests.