mirror of
https://github.com/apple/container.git
synced 2026-09-28 01:46:25 -04:00
Update kernel install UX (#22)
This change updates the UX when we install required dependencies at first launch ### Fresh install - respond `y` to prompt ``` ➜ bin/container system start Verifying apiserver is running... Installing base container filesystem... No default kernel configured. Install the recommended default kernel from [https://github.com/kata-containers/kata-containers/releases/download/3.17.0/kata-static-3.17.0-arm64.tar.xz]? [Y/n]: y Installing kernel... ``` ### Fresh install - respond `n` to prompt and then run the provided command ``` ➜ bin/container system start Verifying apiserver is running... Installing base container filesystem... No default kernel configured. Install the recommended default kernel from [https://github.com/kata-containers/kata-containers/releases/download/3.17.0/kata-static-3.17.0-arm64.tar.xz]? [Y/n]: n Please use the `container system kernel set --recommended` command to configure the default kernel ➜ bin/container system kernel set --recommended Installing the recommended kernel from https://github.com/kata-containers/kata-containers/releases/download/3.17.0/kata-static-3.17.0-arm64.tar.xz... ``` ### Fresh install - respond `n` to prompt and then run a container ``` ➜ bin/container system start Verifying apiserver is running... Installing base container filesystem... No default kernel configured. Install the recommended default kernel from [https://github.com/kata-containers/kata-containers/releases/download/3.17.0/kata-static-3.17.0-arm64.tar.xz]? [Y/n]: n Please use the `container system kernel set --recommended` command to configure the default kernel ➜ bin/container run alpine uname Error: notFound: "Default kernel not configured for architecture arm64. Please use the `container system kernel set` command to configure it ``` --------- Signed-off-by: Aditya Ramani <a_ramani@apple.com>
This commit is contained in:
@@ -42,7 +42,13 @@ actor KernelService {
|
||||
let kFile = url.resolvingSymlinksInPath()
|
||||
let destPath = self.kernelDirectory.appendingPathComponent(kFile.lastPathComponent)
|
||||
try FileManager.default.copyItem(at: kFile, to: destPath)
|
||||
try self.setDefaultKernel(name: kFile.lastPathComponent, platform: platform)
|
||||
try Task.checkCancellation()
|
||||
do {
|
||||
try self.setDefaultKernel(name: kFile.lastPathComponent, platform: platform)
|
||||
} catch {
|
||||
try? FileManager.default.removeItem(at: destPath)
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
/// Copies a kernel binary from inside of tar file into the managed kernels directory
|
||||
|
||||
Reference in New Issue
Block a user