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:

go
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:

  1. Latency on every reconcile: every ExternalSecret reconcile triggers NewClient, which fires a 10-second blocking HTTP call before any secret is fetched.
  2. Failure amplification: a temporarily unreachable gateway makes every reconcile hang for 10 seconds instead of failing fast with a clear error.
  3. 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.
  4. Side effect on validation: ValidateStore calls url.Parse, but the actual URL mutation happens at client-creation time via a network probe, not at validation time.

To Reproduce

  1. Configure an Akeyless SecretStore with akeylessGWApiURL: "https://your.gateway:8080".
  2. Temporarily block network access to the gateway.
  3. Observe that every reconcile of any ExternalSecret backed 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.go lines 69-93
  • providers/v1/akeyless/akeyless.go line 208 (newClient calls getAkeylessHTTPClient)

Source: external-secrets/external-secrets