https://pulumi.com logo
Title
p

prehistoric-kite-30979

09/15/2021, 1:26 PM
AFAICT you cant configure the operator to explicitly use yarn over npm. Will the operator autodetect yarn?
s

sparse-park-68967

09/15/2021, 10:11 PM
Yes you are right. Could you open an issue in https://github.com/pulumi/pulumi-kubernetes-operator/issues please?
p

prehistoric-kite-30979

09/16/2021, 12:47 PM
So will it automatically use yarn if it detects a
yarn.lock
? This is a blocker for us, happy to contribute if you point me in the right direction.
s

sparse-park-68967

09/16/2021, 4:55 PM
That seems like a reasonable approach. Would also be nice to take a stack configuration override to force one over the other.
As a quick/hacky workaround, you could potentially install an init container which deletes the npm binary from the image - we currently first look for npm and then fallback to yarn. Both are installed in the image so always choose npm.. https://github.com/pulumi/pulumi-kubernetes-operator/blob/master/pkg/controller/stack/stack_controller.go#L729
p

prehistoric-kite-30979

09/16/2021, 10:49 PM
doing that check wouldn’t actually solve my problem as I’m using yarn workspaces… I’ll do the init workaround
I’ve added that comment about yarn.lock as well
I’ve also added the dockerfile we use to workaround this.