mirror of https://github.com/pulumi/pulumi.git
e4529562cf
The currentProject is stored as a plain field on the local backend. This is fine right now because SetCurrentProject is not expected to be called concurrently with anything else. However, in #12437 (project-scoped stacks), we need to be able to access the current project in a context where there are no guarantees about SetCurrentProject being called concurrently with other operations. This switches the currentProject into an atomic.Pointer that we can Load and Swap in a thread-safe manner. Note that this does not protect us from data races caused by concurrent mutations to the workspace.Project struct's fields, but that doesn't appear to be a concern; the code treats that object as a blob of constant values. Extracted from #12437 |
||
---|---|---|
.. | ||
backend.go | ||
backend_test.go | ||
bucket.go | ||
bucket_test.go | ||
doc.go | ||
lock.go | ||
meta.go | ||
meta_test.go | ||
snapshot.go | ||
stack.go | ||
state.go | ||
store.go | ||
store_test.go |