Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions Sources/ContainerK8s/Support/K8sHelper+Bootstrap.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,19 @@ extension K8sHelper {

private static func loadKindnetManifest(log: Logger) async throws -> String {
let pluginLoader = try await Utility.createPluginLoader(log: log)
guard let plugin = pluginLoader.findPlugin(forExecutable: CommandLine.executablePath),
let resourceURL = plugin.resourceURL
else {
throw ContainerizationError(.internalError, message: "unable to locate k8s plugin installation or resources")
let executable = CommandLine.executablePath
guard let plugin = pluginLoader.findPlugin(forExecutable: executable) else {
let installed = pluginLoader.findPlugins().map(\.name).sorted()
throw ContainerizationError(
.internalError,
message: "no installed plugin runs \(executable); installed plugins: \(installed.isEmpty ? "none" : installed.joined(separator: ", "))"
)
}
guard let resourceURL = plugin.resourceURL else {
throw ContainerizationError(
.internalError,
message: "the \(plugin.name) plugin installed at \(plugin.binaryURL.path) carries no resources directory"
)
}
let url = resourceURL.appendingPathComponent("kindnet.yaml")
guard let contents = try? String(contentsOf: url, encoding: .utf8) else {
Expand Down