-
Notifications
You must be signed in to change notification settings - Fork 696
Remove VMType check from the lima-init boot script #3861
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
base: master
Are you sure you want to change the base?
Conversation
Do this when setting up the cidata instead, next to the decision on whether to use "cidata" dir or "cidata.iso". This means that this particular boot script is not depending on the driver, but can be used from all container drivers. Signed-off-by: Anders F Björklund <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the file name should be changed.
e.g. 02-no-cloudinit.sh
@@ -4,8 +4,7 @@ | |||
# SPDX-License-Identifier: Apache-2.0 | |||
|
|||
# This script replaces the cloud-init functionality of creating a user and setting its SSH keys | |||
# when using a WSL2 VM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# when cloud-init is not available
@@ -4,8 +4,7 @@ | |||
# SPDX-License-Identifier: Apache-2.0 | |||
|
|||
# This script replaces the cloud-init functionality of creating a user and setting its SSH keys | |||
# when using a WSL2 VM. | |||
[ "$LIMA_CIDATA_VMTYPE" = "wsl2" ] || exit 0 | |||
[ "$LIMA_CIDATA_LIMA_INIT" = "1" ] || exit 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe you can just check the existence of cloud-init here, then the variable can be just dropped
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is still needed (in the Go code, that is) to know if we should create a "cidata" directory, or a cidata.iso
Do this when setting up the cidata instead, next to the decision on whether to use "cidata/" directory or "cidata.iso".
This means that this particular boot script is not depending on the driver, but can be used from all container drivers.
Apple Container external driver for macOS #3839
Docker Container external driver for Linux #3840
We probably want to add an explicit
bool
config for it to the driver, instead of checking for the driver name?And there are still some features left to add to the script (from cloud-config), like the hostname and timezone.
Currently we dont use
user-data
, butlima.env
(+ ssh key)We execute this script through the
boot.sh
directly (lima-init).