Skip to content

Commit e190e1b

Browse files
committed
factory: Default to normal sandbox boot path when factory init not done
The behavior we had before was that, for a starting k8s pod, it sees enable_template=true and therefore: 1. Tries NewFactory with fetchOnly=true 2. When that fails (because template.Fetch fails to find the artifacts, we retry with fetchOnly=false. This creates a direct factory which creates the template from scratch (hence we pay a full pod sandbox boot time here) and then restores from that. Hence the boot times are strictly worse on this path. Now, even when enable_template=true, we don't try to force a direct factory. Instead we just revert to the standard sandbox boot path. Signed-off-by: Cameron Baird <cameronbaird@microsoft.com>
1 parent 73489ea commit e190e1b

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/runtime/pkg/katautils/create.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,8 @@ func HandleFactory(ctx context.Context, vci vc.VC, runtimeConfig *oci.RuntimeCon
8282
kataUtilsLogger.WithField("factory", factoryConfig).Info("load vm factory")
8383

8484
f, err := vf.NewFactory(ctx, factoryConfig, true)
85-
if err != nil && !factoryConfig.VMCache {
86-
kataUtilsLogger.WithError(err).Warn("load vm factory failed, about to create new one")
87-
f, err = vf.NewFactory(ctx, factoryConfig, false)
88-
}
8985
if err != nil {
90-
kataUtilsLogger.WithError(err).Warn("create vm factory failed")
86+
kataUtilsLogger.WithError(err).Warn("load vm factory failed, will use direct boot")
9187
return
9288
}
9389

0 commit comments

Comments
 (0)