mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-03 12:07:54 +00:00
serviceregistration: add external-source meta value (#12163)
* serviceregistration: add external-source meta value * add changelog file
This commit is contained in:
committed by
GitHub
parent
d44ffe4dc8
commit
d45c67c68a
3
changelog/12163.txt
Normal file
3
changelog/12163.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
```release-note:improvement
|
||||||
|
serviceregistration: add `external-source: "vault"` metadata value for Consul registration.
|
||||||
|
```
|
||||||
@@ -49,6 +49,10 @@ const (
|
|||||||
// reconcileTimeout is how often Vault should query Consul to detect
|
// reconcileTimeout is how often Vault should query Consul to detect
|
||||||
// and fix any state drift.
|
// and fix any state drift.
|
||||||
reconcileTimeout = 60 * time.Second
|
reconcileTimeout = 60 * time.Second
|
||||||
|
|
||||||
|
// metaExternalSource is a metadata value for external-source that can be
|
||||||
|
// used by the Consul UI.
|
||||||
|
metaExternalSource = "vault"
|
||||||
)
|
)
|
||||||
|
|
||||||
var hostnameRegex = regexp.MustCompile(`^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$`)
|
var hostnameRegex = regexp.MustCompile(`^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$`)
|
||||||
@@ -503,6 +507,9 @@ func (c *serviceRegistration) reconcileConsul(registeredServiceID string) (servi
|
|||||||
Port: int(c.redirectPort),
|
Port: int(c.redirectPort),
|
||||||
Address: serviceAddress,
|
Address: serviceAddress,
|
||||||
EnableTagOverride: false,
|
EnableTagOverride: false,
|
||||||
|
Meta: map[string]string{
|
||||||
|
"external-source": metaExternalSource,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
checkStatus := api.HealthCritical
|
checkStatus := api.HealthCritical
|
||||||
|
|||||||
Reference in New Issue
Block a user