Skip to content
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

gogo/protobuf -> golang/protobuf breaks api embeddings due to missing JSON tags #2352

Closed
rahulanand16nov opened this issue May 17, 2022 · 3 comments

Comments

@rahulanand16nov
Copy link

I am currently working with AuthorizationPolicy and use Rule struct in one of our CRDs but with the last update of protobuf library, it has included a few fields without JSON tags that cause issues with controller-gen when creating manifests.

/home/rahul/kuadrant-controller/bin/controller-gen rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
/home/rahul/go/pkg/mod/istio.io/api@v0.0.0-20220512153635-e0015771f0c0/security/v1beta1/authorization_policy.pb.go:439:2: encountered struct field "state" without JSON tag in type "Rule"
/home/rahul/go/pkg/mod/istio.io/api@v0.0.0-20220512153635-e0015771f0c0/security/v1beta1/authorization_policy.pb.go:440:2: encountered struct field "sizeCache" without JSON tag in type "Rule"
/home/rahul/go/pkg/mod/istio.io/api@v0.0.0-20220512153635-e0015771f0c0/security/v1beta1/authorization_policy.pb.go:441:2: encountered struct field "unknownFields" without JSON tag in type "Rule"
/home/rahul/go/pkg/mod/istio.io/api@v0.0.0-20220512153635-e0015771f0c0/security/v1beta1/authorization_policy.pb.go:927:2: encountered struct field "state" without JSON tag in type "Rule_From"
/home/rahul/go/pkg/mod/istio.io/api@v0.0.0-20220512153635-e0015771f0c0/security/v1beta1/authorization_policy.pb.go:928:2: encountered struct field "sizeCache" without JSON tag in type "Rule_From"
/home/rahul/go/pkg/mod/istio.io/api@v0.0.0-20220512153635-e0015771f0c0/security/v1beta1/authorization_policy.pb.go:929:2: encountered struct field "unknownFields" without JSON tag in type "Rule_From"
/home/rahul/go/pkg/mod/istio.io/api@v0.0.0-20220512153635-e0015771f0c0/security/v1beta1/authorization_policy.pb.go:522:2: encountered struct field "state" without JSON tag in type "Source"
/home/rahul/go/pkg/mod/istio.io/api@v0.0.0-20220512153635-e0015771f0c0/security/v1beta1/authorization_policy.pb.go:523:2: encountered struct field "sizeCache" without JSON tag in type "Source"
/home/rahul/go/pkg/mod/istio.io/api@v0.0.0-20220512153635-e0015771f0c0/security/v1beta1/authorization_policy.pb.go:524:2: encountered struct field "unknownFields" without JSON tag in type "Source"
/home/rahul/go/pkg/mod/istio.io/api@v0.0.0-20220512153635-e0015771f0c0/security/v1beta1/authorization_policy.pb.go:976:2: encountered struct field "state" without JSON tag in type "Rule_To"
/home/rahul/go/pkg/mod/istio.io/api@v0.0.0-20220512153635-e0015771f0c0/security/v1beta1/authorization_policy.pb.go:977:2: encountered struct field "sizeCache" without JSON tag in type "Rule_To"
/home/rahul/go/pkg/mod/istio.io/api@v0.0.0-20220512153635-e0015771f0c0/security/v1beta1/authorization_policy.pb.go:978:2: encountered struct field "unknownFields" without JSON tag in type "Rule_To"
/home/rahul/go/pkg/mod/istio.io/api@v0.0.0-20220512153635-e0015771f0c0/security/v1beta1/authorization_policy.pb.go:683:2: encountered struct field "state" without JSON tag in type "Operation"
/home/rahul/go/pkg/mod/istio.io/api@v0.0.0-20220512153635-e0015771f0c0/security/v1beta1/authorization_policy.pb.go:684:2: encountered struct field "sizeCache" without JSON tag in type "Operation"
/home/rahul/go/pkg/mod/istio.io/api@v0.0.0-20220512153635-e0015771f0c0/security/v1beta1/authorization_policy.pb.go:685:2: encountered struct field "unknownFields" without JSON tag in type "Operation"
/home/rahul/go/pkg/mod/istio.io/api@v0.0.0-20220512153635-e0015771f0c0/security/v1beta1/authorization_policy.pb.go:808:2: encountered struct field "state" without JSON tag in type "Condition"
/home/rahul/go/pkg/mod/istio.io/api@v0.0.0-20220512153635-e0015771f0c0/security/v1beta1/authorization_policy.pb.go:809:2: encountered struct field "sizeCache" without JSON tag in type "Condition"
/home/rahul/go/pkg/mod/istio.io/api@v0.0.0-20220512153635-e0015771f0c0/security/v1beta1/authorization_policy.pb.go:810:2: encountered struct field "unknownFields" without JSON tag in type "Condition"
Error: not all generators ran successfully

Any solution for this?

@howardjohn
Copy link
Member

kubernetes-sigs/controller-tools#584 (comment) seems to allow ignoring them

@rahulanand16nov
Copy link
Author

Looks like it was merged on Jan 31st and the last release was on Jan 8th so maybe that's why I wasn't able to get it to work.

@howardjohn
Copy link
Member

Seems like based on the above this is fixed upstream

@howardjohn howardjohn closed this as not planned Won't fix, can't repro, duplicate, stale May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants