From e0389ac5d64e696c363f6a3ba87067c7497122ec Mon Sep 17 00:00:00 2001 From: Sina Darbouy Date: Sun, 29 Nov 2026 01:35:00 +0100 Subject: [PATCH 1/3] Pin Liqo and liqoctl to the build running on neo. v0.0.0-50a39cf9 blocks reflection when one peered provider does not serve every custom resource. v0.0.0-6870864e is the chart already running on neo. --- CHANGELOG.md | 2 +- configs/default.yaml | 6 +++--- internal/config/constants.go | 4 ++-- internal/install/prerequisites_test.go | 10 +++++----- internal/install/tools.go | 2 +- internal/install/tools_test.go | 14 +++++++------- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 486a225..8909db7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Pin Liqo and liqoctl to `v0.0.0-50a39cf9` (`oci://harbor.noderings.com/nrings/liqo:0.0.0-50a39cf9`). This is upstream Liqo `50a39cf`. Custom-resource reflection uses server-side apply, so provider Kopf annotations and finalizers stay in place. +- Pin Liqo and liqoctl to `v0.0.0-6870864e` (`oci://harbor.noderings.com/nrings/liqo:0.0.0-6870864e`). This is the build running on neo. A provider that does not serve one custom resource no longer blocks reflection of the others. ## [1.0.20] - 2026-11-24 diff --git a/configs/default.yaml b/configs/default.yaml index 4d88293..b59e594 100644 --- a/configs/default.yaml +++ b/configs/default.yaml @@ -41,16 +41,16 @@ calico: min_version: "v3.26.0" liqo: - version: "v0.0.0-50a39cf9" + version: "v0.0.0-6870864e" timeout: "10m" gw_service_type: "NodePort" gw_server_service_location: "Provider" pod_offloading_strategy: "Local" pod_cidr: "10.200.0.0/16" service_cidr: "10.201.0.0/16" - min_version: "v0.0.0-50a39cf9" + min_version: "v0.0.0-6870864e" chart_oci: "oci://harbor.noderings.com/nrings/liqo" - chart_version: "0.0.0-50a39cf9" + chart_version: "0.0.0-6870864e" proxy_url: "" # Optional proxy URL for liqo peer command api_server_url: "" # Optional; defaults to https://:6443 during registration gw_server_service_nodeport: "" # Optional UDP NodePort for liqoctl peer diff --git a/internal/config/constants.go b/internal/config/constants.go index 932beb0..03b83e7 100644 --- a/internal/config/constants.go +++ b/internal/config/constants.go @@ -55,9 +55,9 @@ const ( DefaultHarborPublicProject = "nrings" // DefaultLiqoVersion is the default Liqo / liqoctl version pin. - DefaultLiqoVersion = "v0.0.0-50a39cf9" + DefaultLiqoVersion = "v0.0.0-6870864e" // DefaultLiqoChartVersion is the Helm chart version (no leading v). - DefaultLiqoChartVersion = "0.0.0-50a39cf9" + DefaultLiqoChartVersion = "0.0.0-6870864e" // DefaultLiqoChartOCI is the OCI chart reference (without version tag). DefaultLiqoChartOCI = "oci://" + DefaultHarborRegistry + "/" + DefaultHarborPublicProject + "/liqo" // DefaultLiqoctlOCIRepo is the OCI project/repo prefix for liqoctl artifacts. diff --git a/internal/install/prerequisites_test.go b/internal/install/prerequisites_test.go index 5742062..085e681 100644 --- a/internal/install/prerequisites_test.go +++ b/internal/install/prerequisites_test.go @@ -12,8 +12,8 @@ func TestNewToolValidatorUsesPlatformPins(t *testing.T) { Components: map[string]api.ComponentPin{ api.ComponentLiqoctl: { Name: api.ComponentLiqoctl, - Version: "v0.0.0-50a39cf9", - MinVersion: "v0.0.0-50a39cf9", + Version: "v0.0.0-6870864e", + MinVersion: "v0.0.0-6870864e", }, api.ComponentHelm: { Name: api.ComponentHelm, @@ -24,8 +24,8 @@ func TestNewToolValidatorUsesPlatformPins(t *testing.T) { } v := NewToolValidator(pins, nil) - if got := v.requirements["liqoctl"].MinVersion; got != "0.0.0-50a39cf9" { - t.Fatalf("liqoctl min = %q, want 0.0.0-50a39cf9", got) + if got := v.requirements["liqoctl"].MinVersion; got != "0.0.0-6870864e" { + t.Fatalf("liqoctl min = %q, want 0.0.0-6870864e", got) } if got := v.requirements["helm"].MinVersion; got != "3.12.0" { t.Fatalf("helm min = %q, want 3.12.0", got) @@ -45,7 +45,7 @@ func TestNewToolValidatorFallsBackToConfigLiqoPin(t *testing.T) { func TestValidateVersionForkPin(t *testing.T) { v := NewValidator() - ok, err := v.validateVersion("Client version: v0.0.0-50a39cf9", "0.0.0-50a39cf9") + ok, err := v.validateVersion("Client version: v0.0.0-6870864e", "0.0.0-6870864e") if err != nil { t.Fatalf("validateVersion: %v", err) } diff --git a/internal/install/tools.go b/internal/install/tools.go index f42d413..5e1e36e 100644 --- a/internal/install/tools.go +++ b/internal/install/tools.go @@ -709,7 +709,7 @@ func parseOCIChartRef(ref string) (repo, version string) { return "", "" } withoutScheme := strings.TrimPrefix(ref, "oci://") - // harbor.noderings.com/nrings/liqo:0.0.0-50a39cf9 + // harbor.noderings.com/nrings/liqo:0.0.0-6870864e if i := strings.LastIndex(withoutScheme, ":"); i > 0 { hostPath := withoutScheme[:i] ver := withoutScheme[i+1:] diff --git a/internal/install/tools_test.go b/internal/install/tools_test.go index 49f112c..f1a2719 100644 --- a/internal/install/tools_test.go +++ b/internal/install/tools_test.go @@ -43,18 +43,18 @@ func TestDeriveToolDownloadURL(t *testing.T) { { name: "liqoctl", tool: "liqoctl", - version: "v0.0.0-50a39cf9", + version: "v0.0.0-6870864e", goos: "linux", goarch: "amd64", - want: "oci://harbor.noderings.com/nrings/liqoctl-linux-amd64:v0.0.0-50a39cf9", + want: "oci://harbor.noderings.com/nrings/liqoctl-linux-amd64:v0.0.0-6870864e", }, { name: "arch normalization", tool: "liqoctl", - version: "v0.0.0-50a39cf9", + version: "v0.0.0-6870864e", goos: "linux", goarch: "aarch64", - want: "oci://harbor.noderings.com/nrings/liqoctl-linux-arm64:v0.0.0-50a39cf9", + want: "oci://harbor.noderings.com/nrings/liqoctl-linux-arm64:v0.0.0-6870864e", }, { name: "override wins", @@ -321,9 +321,9 @@ func TestVersionSatisfiesTable(t *testing.T) { {"v1.0.0", "", "v1.0.0", true}, {"v0.9.0", "v1.1.1", "v1.0.0", false}, {"", "v1.0.0", "", false}, - {"Client version: v0.0.0-50a39cf9", "v0.0.0-50a39cf9", "", true}, - {"Client version: v1.1.1", "v0.0.0-50a39cf9", "", false}, - {"v1.1.1", "v0.0.0-50a39cf9", "", false}, + {"Client version: v0.0.0-6870864e", "v0.0.0-6870864e", "", true}, + {"Client version: v1.1.1", "v0.0.0-6870864e", "", false}, + {"v1.1.1", "v0.0.0-6870864e", "", false}, } for _, tc := range cases { if got := VersionSatisfies(tc.current, tc.required, tc.min); got != tc.want { From 053e0ec2109e8f27e36691e8b7fdbff0043fbe7b Mon Sep 17 00:00:00 2001 From: Sina Darbouy Date: Sun, 29 Nov 2026 01:43:26 +0100 Subject: [PATCH 2/3] Skip a second token refresh when another caller already refreshed. A late 401 could take the refresh lock after the first refresh had finished and call the refresh function again. --- internal/api/client.go | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/internal/api/client.go b/internal/api/client.go index 392b5ab..4b8a3cf 100644 --- a/internal/api/client.go +++ b/internal/api/client.go @@ -257,6 +257,9 @@ func (c *Client) DoWithAutoRefresh(ctx context.Context, maxRetries uint, fn func // Check for 401 Unauthorized - try to refresh token once if resp.StatusCode == http.StatusUnauthorized && !refreshed && c.refreshFunc != nil { + // Captured before waiting on the lock. A caller that arrives after another + // goroutine has already refreshed must not refresh again. + staleToken := c.GetToken() // Acquire mutex to prevent concurrent refresh attempts select { case c.refreshMutex <- struct{}{}: @@ -266,17 +269,19 @@ func (c *Client) DoWithAutoRefresh(ctx context.Context, maxRetries uint, fn func // Close the response body before refreshing _ = resp.Body.Close() - // Refresh token - newToken, refreshErr := c.refreshFunc(ctx) - if refreshErr != nil { - // If refresh fails, mark as unrecoverable (don't retry) - // This typically means refresh token is invalid/expired - // The error message from refreshFunc already includes re-authentication instructions - return retry.Unrecoverable(fmt.Errorf("token refresh failed: %w", refreshErr)) + if c.GetToken() == staleToken { + // Refresh token + newToken, refreshErr := c.refreshFunc(ctx) + if refreshErr != nil { + // If refresh fails, mark as unrecoverable (don't retry) + // This typically means refresh token is invalid/expired + // The error message from refreshFunc already includes re-authentication instructions + return retry.Unrecoverable(fmt.Errorf("token refresh failed: %w", refreshErr)) + } + + // Update token in client + c.SetToken(newToken) } - - // Update token in client - c.SetToken(newToken) refreshed = true // Retry the original request with new token From bc9a2d79ed927d7f26c930182552eddf77db3314 Mon Sep 17 00:00:00 2001 From: Sina Darbouy Date: Sun, 29 Nov 2026 01:50:58 +0100 Subject: [PATCH 3/3] Snapshot the sent token before the 401 returns. Comparing the token after the response can already see another caller's refresh and refresh a second time. --- internal/api/client.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/internal/api/client.go b/internal/api/client.go index 4b8a3cf..3008c15 100644 --- a/internal/api/client.go +++ b/internal/api/client.go @@ -248,7 +248,9 @@ func (c *Client) DoWithAutoRefresh(ctx context.Context, maxRetries uint, fn func // Execute with retry logic err = c.WithRetry(ctx, maxRetries, func() error { - // Make the API call + // Snapshot the token this attempt will send. Reading it after a 401 + // returns can already observe another goroutine's refresh. + sentToken := c.GetToken() var callErr error resp, callErr = fn() if callErr != nil { @@ -257,9 +259,6 @@ func (c *Client) DoWithAutoRefresh(ctx context.Context, maxRetries uint, fn func // Check for 401 Unauthorized - try to refresh token once if resp.StatusCode == http.StatusUnauthorized && !refreshed && c.refreshFunc != nil { - // Captured before waiting on the lock. A caller that arrives after another - // goroutine has already refreshed must not refresh again. - staleToken := c.GetToken() // Acquire mutex to prevent concurrent refresh attempts select { case c.refreshMutex <- struct{}{}: @@ -269,7 +268,7 @@ func (c *Client) DoWithAutoRefresh(ctx context.Context, maxRetries uint, fn func // Close the response body before refreshing _ = resp.Body.Close() - if c.GetToken() == staleToken { + if c.GetToken() == sentToken { // Refresh token newToken, refreshErr := c.refreshFunc(ctx) if refreshErr != nil {