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

Support custom username #45

Merged
merged 2 commits into from
Aug 5, 2021
Merged

Conversation

jpculp
Copy link
Member

@jpculp jpculp commented Aug 4, 2021

Issue number:

#31

Description of changes:

By default, the admin container's local user is ec2-user.
The first commit allows for the local user to be named something else.

The second commit cleans up the README.md by normalizing spacing of the examples.

Testing done:

  • No custom user-data.
  • User-data with custom user: "user-data": "bottlerocket"
  • User-data with malformed data: "user-data": {]
  • User-data with an empty string: "user-data": ""

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.

start_admin_sshd.sh Outdated Show resolved Hide resolved
start_admin_sshd.sh Show resolved Hide resolved
@jpculp
Copy link
Member Author

jpculp commented Aug 5, 2021

  • Tweaked the logic to verify the validity of the user specified in user-data after the jq.
  • Added test case for user being set to an empty string.

@jpculp jpculp requested a review from tjkirch August 5, 2021 00:06
@jpculp
Copy link
Member Author

jpculp commented Aug 5, 2021

I improved the logic a little to be more condensed, but also factor in the scenario where jq returns an error that somehow passes the regex.

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.

LGTM

🕹️

@jpculp
Copy link
Member Author

jpculp commented Aug 5, 2021

Made a small cosmetic change for consistency and retested.

@jpculp jpculp merged commit 6407950 into bottlerocket-os:develop Aug 5, 2021
@jpculp jpculp deleted the custom-username branch August 5, 2021 21:14
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.

3 participants