akeyless: getV2Url makes a blocking outbound HTTP call on every client instantiation
Author: alekcCreated Jun 22, 2026Updated Sep 22, 2026
LabelsStale
Describe the bug
providers/v1/akeyless/utils.go contains a function getV2Url that is called every time
a new Akeyless secrets client is created (newClient). The function sends a live POST
request to the configured gateway URL to determine whether /v2 needs to be appended:
func getV2Url(path string) string {
rebody := sendReq(path) // blocking HTTP POST, 10-second timeout
if strings.Contains(rebody, "unknown command") {
return path
}
...
}
func sendReq(url string) string {
client := &http.Client{Timeout: 10 * time.Second}
resp, err := client.Do(req)
...
}This causes several problems:
- Latency on every reconcile: every
ExternalSecretreconcile triggersNewClient, which fires a 10-second blocking HTTP call before any secret is fetched. - Failure amplification: a temporarily unreachable gateway makes every reconcile hang for 10 seconds instead of failing fast with a clear error.
- Unnecessary: the correct behaviour is simpler -- if the URL already ends with
/v2, use it as-is; otherwise append/v2. No network call is needed to determine this. - Side effect on validation:
ValidateStorecallsurl.Parse, but the actual URL mutation happens at client-creation time via a network probe, not at validation time.
To Reproduce
- Configure an Akeyless
SecretStorewithakeylessGWApiURL: "https://your.gateway:8080". - Temporarily block network access to the gateway.
- Observe that every reconcile of any
ExternalSecretbacked by this store stalls for 10 seconds before reporting an error.
Expected behavior
getV2Url should be a pure string transformation (append /v2 if not already present)
with no outbound network call. The existing Validate() method already handles connectivity
checks with an appropriate timeout.
Additional context
providers/v1/akeyless/utils.golines 69-93providers/v1/akeyless/akeyless.goline 208 (newClientcallsgetAkeylessHTTPClient)
Source: external-secrets/external-secrets