In the LoadNodes function https://github.com/docker/buildx/blob/v0.16.0/builder/node.go#L122-L150 before it initializes the Driver it goes into a bunch of k8s config loading routines that is then passed to the driver initialization.
It loads all contexts to retrieve potential k8s config from it and then passes it to various k8s libraries. Problem is that this code runs every time, even if my current builder is not using k8s driver. It also looks like even if I don't have any k8s config in my contexts, these operations are still not no-ops. In the profiler I can see it calling into some yaml libraries to do some parsing. I assume this happens with some default config as I don't have any custom config on my machine (that I know about).
K8s-specific logic should ideally happen only when loading k8s driver, or at least be skippable in the LoadNodes.
In the
LoadNodesfunction https://github.com/docker/buildx/blob/v0.16.0/builder/node.go#L122-L150 before it initializes the Driver it goes into a bunch of k8s config loading routines that is then passed to the driver initialization.It loads all contexts to retrieve potential k8s config from it and then passes it to various k8s libraries. Problem is that this code runs every time, even if my current builder is not using k8s driver. It also looks like even if I don't have any k8s config in my contexts, these operations are still not no-ops. In the profiler I can see it calling into some yaml libraries to do some parsing. I assume this happens with some default config as I don't have any custom config on my machine (that I know about).
K8s-specific logic should ideally happen only when loading k8s driver, or at least be skippable in the
LoadNodes.