summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
d30732d)
Using an embedded lock instead of an explicit variable
Issue-ID: AAF-92
Change-Id: Ia7bd43a40ec50664b042afa9e46091f14122ba5c
Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
// Vault is the main Struct used in Backend to initialize the struct
type Vault struct {
// Vault is the main Struct used in Backend to initialize the struct
type Vault struct {
engineType string
initRoleDone bool
policyName string
roleID string
secretID string
engineType string
initRoleDone bool
policyName string
roleID string
secretID string
vaultAddress string
vaultClient *vaultapi.Client
vaultMount string
vaultAddress string
vaultClient *vaultapi.Client
vaultMount string
// Function checkToken() gets called multiple times to create
// temporary tokens
func (v *Vault) checkToken() error {
// Function checkToken() gets called multiple times to create
// temporary tokens
func (v *Vault) checkToken() error {
- v.tokenLock.Lock()
- defer v.tokenLock.Unlock()
+ v.Lock()
+ defer v.Unlock()
// Init Role if it is not yet done
// Role needs to be created before token can be created
// Init Role if it is not yet done
// Role needs to be created before token can be created