Repository navigation
feat(ds-identify): add notfound=enabled-ds-none policy (#6895) - #7149
Open
grosbaloon wants to merge 1 commit into
Open
grosbaloon wants to merge 1 commit into
grosbaloon wants to merge 1 commit into
Conversation
When no datasource is detected, notfound=enabled leaves the result file without a datasource_list, so cloud-init falls back to the list in /etc/cloud/cloud.cfg and probes every datasource; notfound=disabled turns cloud-init off entirely. Add a third value enabled-ds-none that writes a datasource_list of just None to /run/cloud-init/cloud.cfg and returns success, so cloud-init boots on the None datasource.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Proposed Commit Message
Additional Context
Today an image built with a generic
datasource_listin/etc/cloud/cloud.cfghas two choices when ds-identify finds nothing:notfound=disablednotfound=enabledcloud.cfg, network ones included, which can add long timeouts to bootNeither fits images that run both on clouds and on bare metal: on those
platforms we still want cloud-init to run (to apply the configuration
baked into the image via the None datasource) but without walking
the full datasource list and waiting on metadata services that do not exist.
notfound=enabled-ds-nonecovers that case: ds-identify writesto
/run/cloud-init/cloud.cfgand enables cloud-init. Behaviour when adatasource is found is unchanged, and the existing
enabled/disabledvalues are untouched.Notes for review:
found None --is called explicitly becausefound()only appendsNoneto a non-empty list.searchmode, if writing the result file fails, cloud-init isdisabled rather than enabled, since enabling it would fall back to the
full search this policy is meant to avoid. In
reportmode the resultis only informational (namespaced under
di_report), so cloud-init isstill reported as enabled.
where the other policy values are documented.
Test Steps
Unit tests:
On a live system where no datasource is identified (e.g. a local
QEMU/KVM VM with no NoCloud seed):
After reboot:
Report mode (dry run):
Merge type