fix(schema): skip datasource loading when --config-file is provided#6713
fix(schema): skip datasource loading when --config-file is provided#6713jayendra13 wants to merge 1 commit intocanonical:mainfrom
Conversation
When a non-root user runs `cloud-init schema --config-file <file>`, the command was attempting to load the datasource from /var/lib/cloud/instance/obj.pkl, causing a confusing permission warning even though the datasource isn't needed for validating user-provided config files. Skip datasource loading when --config-file is provided since we're only validating the file's YAML syntax and schema, not system instance data. Fixes: canonical#6592
|
#6592 (comment) |
|
@holmanb it should work now, after CLA signing. |
@blackboxsw do you know if this command is supposed to be able to validate jinja-based configs? If not, I'm unsure why loading these files would be needed. |
|
Hello! Thank you for this proposed change to cloud-init. This pull request is now marked as stale as it has not seen any activity in 14 days. If no activity occurs within the next 7 days, this pull request will automatically close. If you are waiting for code review and you are seeing this message, apologies! Please reply, tagging blackboxsw, and he will ensure that someone takes a look soon. (If the pull request is closed and you would like to continue working on it, please do tag blackboxsw to reopen it.) |
|
@blackboxsw — this PR has gone stale waiting for review. Could you (or someone on the team) take a look when you get a chance? @holmanb — to address your question: the datasource loading (fetch_existing_datasource="trust") is needed for the --system path, where cloud-init validates the config that actually ran With --config-file, the use case is different: users are authoring or debugging their cloud-config YAML locally before deploying (as documented in Happy to make any adjustments if needed. |
When a non-root user runs
cloud-init schema --config-file <file>, the command was attempting to load the datasource from /var/lib/cloud/instance/obj.pkl, causing a confusing permission warning even though the datasource isn't needed for validating user-provided config files.Skip datasource loading when --config-file is provided since we're only validating the file's YAML syntax and schema, not system instance data.
Fixes: #6592
Merge type