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/api/client.go b/internal/api/client.go index 392b5ab..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 { @@ -266,17 +268,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() == sentToken { + // 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 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 {