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

Deprecate the users ssh-authorized-keys property #5162

Merged

Conversation

afbjorklund
Copy link
Contributor

@afbjorklund afbjorklund commented Apr 9, 2024

The previous cloud-config still works without any issues, but it doesn't pass validation - not even as deprecated.

Example from https://lima-vm.io default

Currently it does not validate, therefore.

commit b27f713

Proposed Commit Message

fix: deprecate ssh-authorized-keys in schema

Deprecate the users ssh-authorized-keys property

Additional Context

Test Steps

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>)

@catmsred
Copy link
Collaborator

catmsred commented Apr 9, 2024

Thank you for helping improve cloud-init! Your change looks good to me. Have you done any additional testing to ensure that this change unblocks your use case? If so, feel free to add a comment expanding on it.

Additionally, can you also sign the CLA as part of this PR?

@afbjorklund
Copy link
Contributor Author

Have you done any additional testing to ensure that this change unblocks your use case?

By allowing "ssh-authorized-keys" to pass, the rest of our generated cloud-config now passes.

There are two deprecations, but if I "fix" these they will break with older/other cloud-init...

We did find one bug, where we were passing trusted: null instead of omitting the field.

@afbjorklund
Copy link
Contributor Author

afbjorklund commented Apr 10, 2024

Found an old report (from 2022), of the same issue.

Closes #3984

@afbjorklund afbjorklund force-pushed the deprecate-ssh-authorized-keys branch from 39b858e to 2ee0dac Compare April 10, 2024 05:46
@TheRealFalcon
Copy link
Member

TheRealFalcon commented Apr 17, 2024

@afbjorklund , To my knowledge, that isn't a valid key on any supported version of cloud-init. Do you have an example of a cloud-config that works when ssh-authorized-keys is used? If so, can you tell me what version of cloud-init that it works on for you?

Edit: nevermind, I wasn't thinking about the '-' to '_' replacement.

@TheRealFalcon TheRealFalcon self-assigned this Apr 17, 2024
@afbjorklund
Copy link
Contributor Author

afbjorklund commented Apr 18, 2024

There is still code in cloud-init, that replaces dashes in keys with underscores. I can get you versions, but all major distros at least

EDIT: Such as /usr/bin/cloud-init 23.4.4-0ubuntu0~22.04.1

@TheRealFalcon
Copy link
Member

@afbjorklund , thanks for updated info. You are correct. I filed #5187 to fix the remaining keys.

The rest of the PR looks good, but for the CLA, I noticed that you signed the CLA, but haven't yet added yourself to the CLA signers file. As part of this PR, please also add your name (alphabetically) to the CLA signers file. The full details are described in the documentation.

@afbjorklund afbjorklund force-pushed the deprecate-ssh-authorized-keys branch from 2ee0dac to a5fe268 Compare April 19, 2024 06:44
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! Assuming CI passes, I'll merge it as-is.

@TheRealFalcon
Copy link
Member

Bah, one more CI failure. JSON formatting:

diff --git a/cloudinit/config/schemas/schema-cloud-config-v1.json b/cloudinit/config/schemas/schema-cloud-config-v1.json
index 863c0c200..94a356747 100644
--- a/cloudinit/config/schemas/schema-cloud-config-v1.json
+++ b/cloudinit/config/schemas/schema-cloud-config-v1.json
@@ -361,7 +361,7 @@
           },
           "minItems": 1
         },
-       "ssh-authorized-keys": {
+        "ssh-authorized-keys": {
           "allOf": [
             {
               "type": "array",

@afbjorklund
Copy link
Contributor Author

Weird, I thought I had updated that stray tab once already....

The previous cloud-config still works without any issues,
but it doesn't pass validation - not even as deprecated.

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
@afbjorklund afbjorklund force-pushed the deprecate-ssh-authorized-keys branch from a5fe268 to dd1082a Compare April 21, 2024 06:59
@TheRealFalcon TheRealFalcon merged commit 5205b4d into canonical:main Apr 22, 2024
28 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.

None yet

3 participants