Does anyone know how to preemptively populate the ...
# pulumi-kubernetes-operator
o
Does anyone know how to preemptively populate the
/share/workspace
directory with the project files? I can obviously get the files into that location, but I can't seem to figure out the combination of
Stack
resource field values to get it to use the existing files (vs. try to use a git source).
h
what do you mean by “existing files”? how are you currently putting those files in place? manually, a volume, something else? the stack resource has a
.spec.workspaceTemplate
field which lets you customize the workspace’s pod. for example.
or do you mean you don’t want the stack to have any sources?
d
Hi @orange-queen-85844, I assume you're trying to use an alternative to the git/flux sources, as described in the 'extensibility' section. The solution is that you omit any source information from the Stack spec and instead use the
workspaceTemplate
to inject an init container. I would guess you've tried that. To be frank, we don't have a test for this scenario and it could be that the Stack controller insists that a source be specified. Could you use an empty public repository, plus an init container, as a workaround? For the next beta, I'll add a test and fix any gap there.
o
Hey guys. @damp-airline-38442 is correct. I was testing an alternative to the git/flux sources. I did poke around a bit and it does look like the controller doesn't allow empty values at the moment. https://github.com/pulumi/pulumi-kubernetes-operator/blob/v2.0.0-beta.1/operator/internal/controller/pulumi/stack_controller.go#L618 Using an empty repo is a good idea as a workaround. I appreciate the follow up and will look out for the next beta release. FWIW, I have been actively using the 1.x version of the operator for several years. The improvements in the 2.x version are awesome. Excellent work by all who are involved.
d
@orange-queen-85844 FYI we merged the fix for this issue: https://github.com/pulumi/pulumi-kubernetes-operator/pull/741