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:search http response add content-type header #3505

Merged
merged 1 commit into from
May 10, 2023

Conversation

callmeoldprince
Copy link

@callmeoldprince callmeoldprince commented May 9, 2023

What type of PR is this?
/kind bug

What this PR does / why we need it:
Adding HTTP response headers for k8s native clients to decode normally
Which issue(s) this PR fixes:
Fixes:Search service request returns text/plain by default

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

`karmada-search`: Fixed contecnt-type header issue in HTTP response.

@karmada-bot karmada-bot added the kind/bug Categorizes issue or PR as related to a bug. label May 9, 2023
@karmada-bot karmada-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label May 9, 2023
@XiShanYongYe-Chang
Copy link
Member

Hi @callmeoldpince, thanks for your feedback. Can you explain why it's set up to application/json by default? Will there be other format requirements? Do we need to add a new parameter to control this parameter?

@jwcesign
Copy link
Member

jwcesign commented May 9, 2023

I tried with kube-apiserver, the header is Content-Type: application/json.

I think the benefit is: make some json parse tools work fine. cc @callmeoldpince Do I understand correctly?

@callmeoldprince
Copy link
Author

callmeoldprince commented May 9, 2023

Hi @callmeoldpince, thanks for your feedback. Can you explain why it's set up to application/json by default? Will there be other format requirements? Do we need to add a new parameter to control this parameter?

I tried with kube-apiserver, the header is Content-Type: application/json.

I think the benefit is: make some json parse tools work fine. cc @callmeoldpince Do I understand correctly?

@jwcesign @XiShanYongYe-Chang
i use "sigs.k8s.io/controller-runtime/pkg/client/typed_client.go” link search-server,and call client Get(ctx context.Context, key ObjectKey, obj Object) error or List(ctx context.Context, list ObjectList, opts ...ListOption) func,If not set content-type,default value is text/plain; charset=utf-8, for sigs.k8s.io/controller-runtime/pkg/client,failure serializer for text/plain; charset=utf-8.
In summary, the sigs.k8s.io/controller-runtime/pkg/client is not implemented for type text/plain; charset=utf-8

@jwcesign
Copy link
Member

jwcesign commented May 9, 2023

@callmeoldpince I think this is not a bug.
cc @RainbowMango , do we need to cherry-pick this?

@RainbowMango
Copy link
Member

cc @RainbowMango , do we need to cherry-pick this?

Both are OK with me.

@callmeoldpince are you using Karmada in production? Do you need this patch on release branches?

1 similar comment
@RainbowMango
Copy link
Member

cc @RainbowMango , do we need to cherry-pick this?

Both are OK with me.

@callmeoldpince are you using Karmada in production? Do you need this patch on release branches?

@callmeoldprince
Copy link
Author

cc @RainbowMango , do we need to cherry-pick this?

Both are OK with me.

@callmeoldpince are you using Karmada in production? Do you need this patch on release branches?

yes,I hope it can be merged into release1.5

@XiShanYongYe-Chang
Copy link
Member

Thanks~ @callmeoldpince, I think we can do it. Can you help add a release-note here:
image

so that we can describe it in cherry-pick.

Signed-off-by: old.prince <di7zhang@gmail.com>
@jwcesign
Copy link
Member

/lgtm

Hi @callmeoldpince Can you help cherry-pick this PR to branch release-1.5/release-1.4?

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label May 10, 2023
@callmeoldprince
Copy link
Author

Thanks~ @callmeoldpince, I think we can do it. Can you help add a release-note here: image

so that we can describe it in cherry-pick.
done

@XiShanYongYe-Chang
Copy link
Member

Sorry, I didn't describe it clearly. Can you change it to something like this?

karmada-search: http response add content-type header

@callmeoldprince
Copy link
Author

/lgtm

Hi @callmeoldpince Can you help cherry-pick this PR to branch release-1.5/release-1.4?

I hope it can be merged into release1.5

@callmeoldprince
Copy link
Author

Sorry, I didn't describe it clearly. Can you change it to something like this?

karmada-search: http response add content-type header

done

@XiShanYongYe-Chang
Copy link
Member

I hope it can be merged into release1.5

We can sync it to all the versions we've affected before.

@XiShanYongYe-Chang
Copy link
Member

Ask @RainbowMango to help run the ci test.
/cc @RainbowMango

Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

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

Done.

Copy link
Member

@XiShanYongYe-Chang XiShanYongYe-Chang left a comment

Choose a reason for hiding this comment

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

/approve
Thanks~

Hi @callmeoldpince excuse me, would it be convenient to reveal the name of your company?

@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: XiShanYongYe-Chang

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 10, 2023
@karmada-bot karmada-bot merged commit 9bd709a into karmada-io:master May 10, 2023
@XiShanYongYe-Chang
Copy link
Member

Hi @callmeoldpince, thanks a lot.

This patch have been merged, would you like to help cherry-pick it to the previous branch: release-1.3, release-1.4, release-1.5. You can cherry-pick refer to: https://karmada.io/docs/next/contributor/cherry-picks/

@callmeoldprince
Copy link
Author

callmeoldprince commented May 10, 2023

Hi @callmeoldpince, thanks a lot.

This patch have been merged, would you like to help cherry-pick it to the previous branch: release-1.3, release-1.4, release-1.5. You can cherry-pick refer to: https://karmada.io/docs/next/contributor/cherry-picks/

@XiShanYongYe-Chang I refer to the document to operate

@XiShanYongYe-Chang
Copy link
Member

@XiShanYongYe-Chang I refer to the document to operate

Thanks~, please help update the release note in the new pr.

@callmeoldprince
Copy link
Author

@XiShanYongYe-Chang I refer to the document to operate

Thanks~, please help update the release note in the new pr.

ok,done

karmada-bot added a commit that referenced this pull request May 10, 2023
…-#3505-upstream-release-1.4

Automated cherry pick of #3505: fix:search http response add content-type header
@RainbowMango
Copy link
Member

Thanks @callmeoldpince and welcome to Karmada community~

karmada-bot added a commit that referenced this pull request May 10, 2023
…-#3505-upstream-release-1.3

Automated cherry pick of #3505: fix:search http response add content-type header
karmada-bot added a commit that referenced this pull request May 12, 2023
…f-#3505-upstream-release-1.5

Automated cherry pick of #3505: fix:search http response add content-type header
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants