mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 03:27:54 +00:00
Add a sysview call to determine if a mount is local. (#3899)
This is useful for deciding when to run upgrade logic, e.g. if on a performance secondary but local it's fine to run.
This commit is contained in:
@@ -39,6 +39,10 @@ type SystemView interface {
|
||||
// despite known slowdowns.
|
||||
CachingDisabled() bool
|
||||
|
||||
// When run from a system view attached to a request, indicates whether the
|
||||
// request is affecting a local mount or not
|
||||
LocalMount() bool
|
||||
|
||||
// ReplicationState indicates the state of cluster replication
|
||||
ReplicationState() consts.ReplicationState
|
||||
|
||||
@@ -63,6 +67,7 @@ type StaticSystemView struct {
|
||||
CachingDisabledVal bool
|
||||
Primary bool
|
||||
EnableMlock bool
|
||||
LocalMountVal bool
|
||||
ReplicationStateVal consts.ReplicationState
|
||||
}
|
||||
|
||||
@@ -86,6 +91,10 @@ func (d StaticSystemView) CachingDisabled() bool {
|
||||
return d.CachingDisabledVal
|
||||
}
|
||||
|
||||
func (d StaticSystemView) LocalMount() bool {
|
||||
return d.LocalMountVal
|
||||
}
|
||||
|
||||
func (d StaticSystemView) ReplicationState() consts.ReplicationState {
|
||||
return d.ReplicationStateVal
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user