ipn/ipnlocal: manage per-profile subdirectories in TailscaleVarRoot#18485
ipn/ipnlocal: manage per-profile subdirectories in TailscaleVarRoot#18485creachadair merged 1 commit intomainfrom
Conversation
We probably could move at least part of it to I don't have a super strong preference about where it lands. The initial consumer will be netmap caching, which will live on the LB, but I don't think it would be too hard to move it (either now or later). |
Is this set in stone? Have we considered making it an optional feature, as per the Tailscale Client Modularity Guide? Have we considered implementing netmap caching in If we've already decided to implement all of this in But if we haven't made that decision yet and we're still considering alternatives, then implementing this elsewhere may lead to a design that better aligns with our long-term goals of avoiding optional features in (Unlike the |
No, we're just prototyping the ability to cache network maps. That probably will be an optional feature. When it's enabled, we'll need a place to store the maps for a given profile, and this is meant to be a very-mild generalization, so that we can include other profile-specific data we already store (e.g., taildrop files, AUM chain caches) in a common location. The latter is optional, however, we don't have to combine them. |
|
|
||
| // profileMkdirAllLocked implements ProfileMkdirAll. | ||
| // The caller must hold b.mu. | ||
| func (b *LocalBackend) profileMkdirAllLocked(id ipn.ProfileID, subs ...string) (string, error) { |
There was a problem hiding this comment.
Return an error if id is empty?
As per earlier discussion, we don't expect this to be called for a profile that hasn't been persisted yet anyway, so let's be defensive about it.
5dd75ef to
42db5b4
Compare
In order to better manage per-profile data resources on the client, add methods to the LocalBackend to support creation of per-profile directory structures in local storage. These methods build on the existing TailscaleVarRoot config, and have the same limitation (i.e., if no local storage is available, it will report an error when used). The immediate motivation is to support netmap caching, but we can also use this mechanism for other per-profile resources including pending taildrop files and Tailnet Lock authority caches. This commit only adds the directory-management plumbing; later commits will handle migrating taildrop, TKA, etc. to this mechanism, as well as caching network maps. updates #12639 Change-Id: Ia75741955c7bf885e49c1ad99f856f669a754169 Signed-off-by: M. J. Fromberger <fromberger@tailscale.com>
c326317 to
9716f35
Compare
In order to better manage per-profile data resources on the client, add methods
to the LocalBackend to support creation of per-profile directory structures in
local storage. These methods build on the existing TailscaleVarRoot config, and
have the same limitation (i.e., if no local storage is available, it will
report an error when used).
The immediate motivation is to support netmap caching, but we can also use this
mechanism for other per-profile resources including pending taildrop files and
Tailnet Lock authority caches.
This commit only adds the directory-management plumbing; later commits will
handle migrating taildrop, TKA, etc. to this mechanism, as well as caching
network maps.
updates #12639
Change-Id: Ia75741955c7bf885e49c1ad99f856f669a754169
Signed-off-by: M. J. Fromberger fromberger@tailscale.com