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

shibaken: switch outputted JSON keys from snake_case to kebab-case #1439

Merged
merged 1 commit into from
Apr 7, 2021

Conversation

jpculp
Copy link
Member

@jpculp jpculp commented Apr 2, 2021

Issue number:

N/A

Description of changes:

This renames the snake_case in the Ssh struct to kebab-case when serializing the user data JSON.
This effectively replaces authorized_keys with authorized-keys which is more in line with Bottlerocket's current API standards.

This change is dependent on bottlerocket-os/bottlerocket-admin-container/pull/26

Testing done:

  • Launched aws-ecs-1 instance.
  • Instance connected to ecs cluster.
  • Test task deployed successfully.
  • Switched the admin container source to point to a patched admin container.
  • Enabled and launched admin container.
  • Connected to admin container via ssh.
  • Verified that /.bottlerocket/host-containers/current/user-data contained the expected JSON:
{
   "ssh":{
      "authorized-keys":[
         "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQClKsfkNkuSevGj3eYhCe53pcjqP3maAhDFcvBS7O6V
          hz2ItxCih+PnDSUaw+WNQn/mZphTk/a/gU8jEzoOWbkM4yxyb/wB96xbiFveSFJuOp/d6RJhJOI0iBXr
          lsLnBItntckiJ7FbtxJMXLvvwJryDUilBMTjYtwB+QhYXUMOzce5Pjz5/i8SeJtjnV3iAoG/cQk+0FzZ
          qaeJAAHco+CY/5WrUBkrHmFJr6HcXkvJdWPkYQS3xqC0+FmUZofz221CBt5IMucxXPkX4rWi+z7wB3Rb
          BQoQzd8v7yeb7OzlPnWOyN0qFU0XA246RA8QFYiCNYwI3f05p6KLxEXAMPLE my-key-pair"
      ]
   }
}
  • Ran sudo sheltie to verify root shell was still available.
  • Checked for failed systemd units.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

This renames the snake_case in the Ssh struct to kebab-case when
serializing the user data JSON. This effectively replaces
"authorized_keys" with "authorized-keys" which is more in line with
Bottlerocket's current API standards.
Copy link
Contributor

@zmrow zmrow left a comment

Choose a reason for hiding this comment

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

🌃

@jpculp jpculp marked this pull request as ready for review April 2, 2021 18:56
@tjkirch tjkirch added this to the 1.0.8 milestone Apr 7, 2021
@jpculp jpculp merged commit 4601f16 into bottlerocket-os:develop Apr 7, 2021
@jpculp jpculp deleted the shibaken-meets-kebabs branch April 7, 2021 22:08
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.

5 participants