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

Fix MarshalJSON error caused by incorrect conversion function #2302

Merged
merged 1 commit into from
Jun 25, 2021

Conversation

tnqn
Copy link
Member

@tnqn tnqn commented Jun 24, 2021

controlplane.Service couldn't be converted to v1beta1.Service directly as it has an extra field. This patch fixes it by using the auto-generated conversion function.

Signed-off-by: Quan Tian [email protected]

Fixes #2303

It may need to be backported to 0.13, 1.0, and 1.1.

@codecov-commenter
Copy link

codecov-commenter commented Jun 24, 2021

Codecov Report

Merging #2302 (a729f13) into main (ef14ad1) will increase coverage by 0.01%.
The diff coverage is 65.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2302      +/-   ##
==========================================
+ Coverage   62.05%   62.06%   +0.01%     
==========================================
  Files         277      278       +1     
  Lines       21588    21589       +1     
==========================================
+ Hits        13396    13400       +4     
+ Misses       6792     6788       -4     
- Partials     1400     1401       +1     
Flag Coverage Δ
kind-e2e-tests 52.37% <60.00%> (+0.02%) ⬆️
unit-tests 41.89% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/legacyapis/controlplane/v1beta1/conversion.go 30.00% <30.00%> (ø)
pkg/apis/controlplane/v1beta1/conversion.go 84.33% <100.00%> (+3.32%) ⬆️
pkg/legacyapis/controlplane/v1beta1/register.go 92.85% <100.00%> (ø)
...gent/controller/networkpolicy/status_controller.go 75.34% <0.00%> (-2.74%) ⬇️
pkg/controller/networkpolicy/status_controller.go 86.45% <0.00%> (-0.65%) ⬇️
pkg/agent/route/route_linux.go 44.14% <0.00%> (-0.54%) ⬇️
pkg/agent/agent.go 49.88% <0.00%> (-0.46%) ⬇️
pkg/agent/openflow/pipeline.go 71.69% <0.00%> (-0.17%) ⬇️
pkg/controller/traceflow/controller.go 74.09% <0.00%> (+2.40%) ⬆️
... and 1 more

controlplane.Service couldn't be converted to v1beta1.Service directly
as it has an extra field. This patch fixes it by using the
auto-generated conversion function.

Signed-off-by: Quan Tian <[email protected]>
@tnqn tnqn changed the title Fix API compability issue caused by incorrect conversion functions Fix MarshalJSON error caused by incorrect conversion function Jun 24, 2021
@tnqn
Copy link
Member Author

tnqn commented Jun 24, 2021

/test-all

Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

LGTM, yes please backport to the 3 releases you listed in the PR description

BTW, I remember you saying that this issue affected networking.antrea.tanzu.vmware.com but not controlplane.antrea.tanzu.vmware.com. From the fix, I don't see how it's possible?

@antoninbas
Copy link
Contributor

BTW, I remember you saying that this issue affected networking.antrea.tanzu.vmware.com but not controlplane.antrea.tanzu.vmware.com. From the fix, I don't see how it's possible?

Actually looks like it's explained by #2305 :)

@tnqn
Copy link
Member Author

tnqn commented Jun 24, 2021

BTW, I remember you saying that this issue affected networking.antrea.tanzu.vmware.com but not controlplane.antrea.tanzu.vmware.com. From the fix, I don't see how it's possible?

Actually looks like it's explained by #2305 :)

Yes, separating them as #2305 only needs to be backported to 1.0 and 1.1

Copy link
Contributor

@Dyanngg Dyanngg left a comment

Choose a reason for hiding this comment

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

Thanks for the fix

Copy link
Contributor

@GraysonWu GraysonWu left a comment

Choose a reason for hiding this comment

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

LGTM

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

Successfully merging this pull request may close these issues.

error calling MarshalJSON when accessing NetworkPolicy.networking.antrea.tanzu.vmware.com
6 participants