Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module open-cluster-management.io/addon-framework
go 1.24.0

require (
github.com/evanphx/json-patch v5.9.11+incompatible
github.com/evanphx/json-patch/v5 v5.9.11
github.com/fatih/structs v1.1.0
github.com/mochi-mqtt/server/v2 v2.6.5
github.com/onsi/ginkgo v1.16.5
Expand Down Expand Up @@ -52,7 +52,7 @@ require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/eclipse/paho.golang v0.21.0 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
github.com/evanphx/json-patch v5.9.11+incompatible // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"reflect"
"strings"

jsonpatch "github.com/evanphx/json-patch"
jsonpatch "github.com/evanphx/json-patch/v5"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/equality"
apierrors "k8s.io/apimachinery/pkg/api/errors"
Expand Down
9 changes: 4 additions & 5 deletions test/integration/cloudevents/agent_deploy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@ import (
"context"
"encoding/json"
"fmt"
"open-cluster-management.io/sdk-go/pkg/cloudevents/clients/work"
"time"

jsonpatch "github.com/evanphx/json-patch"
"open-cluster-management.io/addon-framework/pkg/agent"
"open-cluster-management.io/addon-framework/pkg/utils"

jsonpatch "github.com/evanphx/json-patch/v5"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Ensure go.mod / go.sum are tidied after the major-version bump

The import path now points to the v5 module. Double-check that:

  1. go.mod contains

    github.com/evanphx/json-patch/v5 v5.9.11 // indirect?
    

    and that the old github.com/evanphx/json-patch line is gone.

  2. go mod tidy has been run so no redundant entries remain.


🏁 Script executed:

#!/bin/bash
# Fails if any pre-v5 import or module reference is still present.
rg --no-heading -n $'github.com/evanphx/json-patch"' || true
grep -n 'github.com/evanphx/json-patch"' go.{mod,sum} || true

Length of output: 124


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

echo "🔍 Checking for v5 module require in go.mod..."
grep -nE 'github.com/evanphx/json-patch/v5 ' go.mod || echo "⚠️ v5 module not found in go.mod"

echo "🔍 Checking for v5 references in go.sum..."
grep -nE 'github.com/evanphx/json-patch/v5 ' go.sum || echo "⚠️ v5 references not found in go.sum"

echo "🔍 Ensuring no pre-v5 references remain in go.mod or go.sum..."
# Match the base path without `/v5`
grep -nE 'github\.com/evanphx/json-patch($| )' go.mod go.sum && {
  echo "❌ Found pre-v5 references"
  exit 1
} || echo "✅ No pre-v5 references detected"

echo "✅ Verification complete."

Length of output: 1124


Remove lingering pre-v5 json-patch entries in go.mod/go.sum

The verification script found that the old, incompatible v5 entry is still present:

  • go.mod:55
    github.com/evanphx/json-patch v5.9.0+incompatible // indirect
    
  • go.sum:77–78
    github.com/evanphx/json-patch v5.9.0+incompatible h1:…
    github.com/evanphx/json-patch v5.9.0+incompatible/go.mod h1:…
    

Please remove those lines and ensure only the /v5 module remains:

Suggested diff:

--- go.mod
@@
-   github.com/evanphx/json-patch v5.9.0+incompatible // indirect
    github.com/evanphx/json-patch/v5 v5.9.11 // indirect
--- go.sum
@@
- github.com/evanphx/json-patch v5.9.0+incompatible h1:fBXyNpNMuTTDdquAq/uisOr2lShz4oaXpDTX2bLe7ls=
- github.com/evanphx/json-patch v5.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
    github.com/evanphx/json-patch/v5 v5.9.11 h1:/8HVnzMq13/3x9TPvjG08wUGqBTmZBsCWzjTM0wiaDU=
    github.com/evanphx/json-patch/v5 v5.9.11/go.mod h1:3j+LviiESTElxA4p3EMKAB9HXj3/XEtnUf6OZxqIQTM=

After updating, run:

go get github.com/evanphx/json-patch/[email protected]
go mod tidy

to purge any residual entries and keep your module files clean.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In test/integration/cloudevents/agent_deploy_test.go around line 9, remove the
old incompatible v5 entry for github.com/evanphx/json-patch from go.mod and
go.sum files. Then run 'go get github.com/evanphx/json-patch/[email protected]'
followed by 'go mod tidy' to update dependencies and clean up any lingering
references, ensuring only the proper /v5 module remains.

"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
Expand All @@ -22,12 +18,15 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/rand"
"open-cluster-management.io/addon-framework/pkg/agent"
"open-cluster-management.io/addon-framework/pkg/utils"
addonapiv1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
workv1client "open-cluster-management.io/api/client/work/clientset/versioned/typed/work/v1"
workv1informers "open-cluster-management.io/api/client/work/informers/externalversions/work/v1"
workv1listers "open-cluster-management.io/api/client/work/listers/work/v1"
clusterv1 "open-cluster-management.io/api/cluster/v1"
workv1 "open-cluster-management.io/api/work/v1"
"open-cluster-management.io/sdk-go/pkg/cloudevents/clients/work"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions test/integration/cloudevents/agent_hook_deploy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import (
"context"
"encoding/json"
"fmt"
"open-cluster-management.io/sdk-go/pkg/cloudevents/clients/work"
"time"

jsonpatch "github.com/evanphx/json-patch"
jsonpatch "github.com/evanphx/json-patch/v5"
"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
Expand All @@ -26,6 +25,7 @@ import (
workv1listers "open-cluster-management.io/api/client/work/listers/work/v1"
clusterv1 "open-cluster-management.io/api/cluster/v1"
workv1 "open-cluster-management.io/api/work/v1"
"open-cluster-management.io/sdk-go/pkg/cloudevents/clients/work"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions test/integration/cloudevents/agent_hosting_deploy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import (
"context"
"encoding/json"
"fmt"
"open-cluster-management.io/sdk-go/pkg/cloudevents/clients/work"
"time"

jsonpatch "github.com/evanphx/json-patch"
jsonpatch "github.com/evanphx/json-patch/v5"
"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
Expand All @@ -27,6 +26,7 @@ import (
workv1listers "open-cluster-management.io/api/client/work/listers/work/v1"
clusterv1 "open-cluster-management.io/api/cluster/v1"
workv1 "open-cluster-management.io/api/work/v1"
"open-cluster-management.io/sdk-go/pkg/cloudevents/clients/work"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import (
"context"
"encoding/json"
"fmt"
"open-cluster-management.io/sdk-go/pkg/cloudevents/clients/work"
"time"

jsonpatch "github.com/evanphx/json-patch"
jsonpatch "github.com/evanphx/json-patch/v5"
"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
Expand All @@ -27,6 +26,7 @@ import (
workv1listers "open-cluster-management.io/api/client/work/listers/work/v1"
clusterv1 "open-cluster-management.io/api/cluster/v1"
workv1 "open-cluster-management.io/api/work/v1"
"open-cluster-management.io/sdk-go/pkg/cloudevents/clients/work"
)

const (
Expand Down