mirror of https://github.com/hashicorp/consul
Updates to allow for using an enterprise specific token as the agents token
This is needed to allow for managed Consul instances to register themselves in the catalog with one of the managed service provider tokens.pull/7714/head
parent
bec3fb7c18
commit
7a4c73acaf
|
@ -1412,7 +1412,7 @@ func (a *Agent) consulConfig() (*consul.Config, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
base.ConfigEntryBootstrap = a.config.ConfigEntryBootstrap
|
base.ConfigEntryBootstrap = a.config.ConfigEntryBootstrap
|
||||||
|
|
||||||
return a.enterpriseConsulConfig(base)
|
return a.enterpriseConsulConfig(base)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -113,6 +113,10 @@ func (t *Store) AgentToken() string {
|
||||||
t.l.RLock()
|
t.l.RLock()
|
||||||
defer t.l.RUnlock()
|
defer t.l.RUnlock()
|
||||||
|
|
||||||
|
if tok := t.enterpriseAgentToken(); tok != "" {
|
||||||
|
return tok
|
||||||
|
}
|
||||||
|
|
||||||
if t.agentToken != "" {
|
if t.agentToken != "" {
|
||||||
return t.agentToken
|
return t.agentToken
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,3 +5,8 @@ package token
|
||||||
// Stub for enterpriseTokens
|
// Stub for enterpriseTokens
|
||||||
type enterpriseTokens struct {
|
type enterpriseTokens struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// enterpriseAgentToken OSS stub
|
||||||
|
func (s *Store) enterpriseAgentToken() string {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue