-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 update jsonpatch #499
🐛 update jsonpatch #499
Conversation
Welcome @kdada! |
go.mod
Outdated
@@ -36,6 +34,7 @@ require ( | |||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be // indirect | |||
golang.org/x/sync v0.0.0-20190423024810-112230192c58 // indirect | |||
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2 // indirect | |||
gomodules.xyz/jsonpatch v0.0.0-20190625105815-9fbceb03c566 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be gomodules.xyz/jsonpatch/v2 v2.0.0
pkg/webhook/admission/multi_test.go
Outdated
@@ -22,7 +22,7 @@ import ( | |||
. "github.com/onsi/ginkgo" | |||
. "github.com/onsi/gomega" | |||
|
|||
"github.com/appscode/jsonpatch" | |||
"gomodules.xyz/jsonpatch" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gomodules.xyz/jsonpatch/v2
everywhere.
@tamalsaha PTAL |
/lgtm |
@tamalsaha: changing LGTM is restricted to assignees, and only kubernetes-sigs/controller-runtime repo collaborators may be assigned issues. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
We should declare that this error could cause the user cluster to chaos. Users should update |
@tamalsaha I can't reconcile go mod and dep. go mod asks me to import "gomodules.xyz/jsonpatch/v2" but dep requires "gomodules.xyz/jsonpatch" |
Hmm. I am not sure how to fix this. I think it is time to drop Go dep? |
golang/dep#1963 was supposed to help but I don't know when that will happen. Given Go 1.13 is going to come out in a month (Aug 1) and Kubernetes 1.15 has go mod support, it might be time to drop Go dep support. |
@tamalsaha I'll update this PR and use go mod only. I think we need another PR to remove dep. |
@kdada Can you use something like the following in
|
@mengqiy , I am afraid that this will not work. Because jsonpatch now uses v2, |
I'd prefer not to break dep users till we promised (v1.13 release, and probably later to be nice), but if there's no other way, we might have to cave. @tamalsaha are you involved in the maintenance of that project? Shouldn't the import path returned by the meta tag in |
need to double check |
@DirectXMan12, I am the maintainer of the jsonpatch repo. I am following the instructions here: https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher . I also looked at https://github.com/google/go-github as an example. I think I did it correctly. This is my first time releasing a v2 for a go mod project. So, if you see any issue, please let me know. |
yep, that works. You can test by building a diff --git a/gps/deduce.go b/gps/deduce.go
index ee097e18..3c372968 100644
--- a/gps/deduce.go
+++ b/gps/deduce.go
@@ -1003,5 +1003,8 @@ func getMetadata(ctx context.Context, path, scheme string) (string, string, stri
if match == -1 {
return "", "", "", errors.Errorf("go-import metadata not found")
}
+ if imports[match].Prefix == "gomodules.xyz/jsonpatch" && path == "gomodules.xyz/jsonpatch/v2" {
+ return path, imports[match].VCS, imports[match].RepoRoot, nil
+ }
return imports[match].Prefix, imports[match].VCS, imports[match].RepoRoot, nil
} |
(which'll fake out |
@tamalsaha I think you did the actual module correctly :-) What's incorrect (I believe) is your webserver for |
I am just using https://github.com/gomodules/govanityurls deployed on appengine. |
I have updated the https://github.com/gomodules/jsonpatch repo to use the Major subdirectory structure. So, it should work ok with both |
@tamalsaha @DirectXMan12 PTAL. |
@kdada , LGTM. You may also want to add the dependency to the |
@tamalsaha It seems I can only add the dependency with [[override]]. I think it's not necessary to add the dependency if the |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: kdada The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I think that may need to be tweaked then. Switching to the major subdirectory structure also works for now :-) |
add RBAC annotation for status subresource
To fix gomodules/jsonpatch#16.
This bug may cause wrong patches when modifying arrays in webhook.
Example:
Origin:
Target:
The
jsonpatch
will generate patches: