pulumi-kubernetes-operator
pulumi-kubernetes-operator copied to clipboard
Support Yarn (+ yarn workspaces) Explicitly
Per discussion on Slack, the operator currently looks for npm then falls back to yarn. We can workaround by uninstalling npm in an init container.
We use yarn workspaces so can't rely on just looking for yarn.lock
in the package root either as it only exists in the repo root.
Additionally, we also have to run as root or chmod/chown /tmp.
{"level":"debug","ts":1632162989.3121283,"logger":"controller_stack","msg":"NPM/Yarn","Request.Namespace":"pulumi-operator","Request.Name":"...","Dir":"...","Path":"/usr/bin/yarn","Args":["/usr
/bin/yarn","install"],"Text":"Error: EACCES: permission denied, open '/tmp/.config/yarn'"}
For people who want a quick workaround we use the following docker image:
FROM pulumi/pulumi-kubernetes-operator:v0.0.20
# Enable us to use yarn, see https://github.com/pulumi/pulumi-kubernetes-operator/issues/196
USER root
RUN npm uninstall npm -g
# We need write permissions for yarn, see https://github.com/pulumi/pulumi-kubernetes-operator/issues/196#issuecomment-923182126
RUN chown -R pulumi-kubernetes-operator:pulumi-kubernetes-operator /tmp
USER pulumi-kubernetes-operator