Skip to content

Commit 210d3e4

Browse files
committed
Backend: kube/lima: wait for k3s before adding manifests
Running the k3s installer will delete any existing manifests / static files so we need to wait for that to finish before adding anything we need. Fixes: 74c4193 Signed-off-by: Mark Yen <[email protected]>
1 parent f7e68fb commit 210d3e4

File tree

1 file changed

+15
-8
lines changed
  • pkg/rancher-desktop/backend/kube

1 file changed

+15
-8
lines changed

pkg/rancher-desktop/backend/kube/lima.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,16 +137,23 @@ export default class LimaKubernetesBackend extends events.EventEmitter implement
137137
async install(config: BackendSettings, desiredVersion: semver.SemVer, allowSudo: boolean) {
138138
await this.progressTracker.action('Installing k3s', 50, async() => {
139139
const promises: Promise<void>[] = [];
140-
141-
// installK3s removes old manifests and static workloads.
142-
promises.push(this.installK3s(desiredVersion));
143140
promises.push(this.writeServiceScript(config, desiredVersion, allowSudo));
144-
if (config.experimental?.containerEngine?.webAssembly?.enabled) {
145-
promises.push(BackendHelper.configureRuntimeClasses(this.vm));
146-
if (config.experimental?.kubernetes?.options?.spinkube) {
147-
promises.push(BackendHelper.configureSpinOperator(this.vm));
141+
142+
promises.push((async() => {
143+
// installK3s removes old config and makes sure the directories are recreated;
144+
// this means it must be done before adding custom manifests.
145+
await this.installK3s(desiredVersion);
146+
147+
const localPromises: Promise<void>[] = [];
148+
149+
if (config.experimental?.containerEngine?.webAssembly?.enabled) {
150+
localPromises.push(BackendHelper.configureRuntimeClasses(this.vm));
151+
if (config.experimental?.kubernetes?.options?.spinkube) {
152+
localPromises.push(BackendHelper.configureSpinOperator(this.vm));
153+
}
148154
}
149-
}
155+
await Promise.all(localPromises);
156+
})());
150157
await Promise.all(promises);
151158
});
152159

0 commit comments

Comments
 (0)