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

karmada-webhook: fix the no such host error #6079

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zhzhuang-zju
Copy link
Contributor

@zhzhuang-zju zhzhuang-zju commented Jan 23, 2025

What type of PR is this?
/kind bug

What this PR does / why we need it:
when deploying karmada instance by operator or karmadactl init,karmada-apiserver will report dial tcp: lookup karmada-webhook.karmada-system.svc on x.x.x.x: no such host error if the namespace of karmada instance is not karmada-system.

# The following patch enables conversion webhook for CRD
# CRD conversion requires k8s 1.13 or later.
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: resourcebindings.work.karmada.io
spec:
conversion:
strategy: Webhook
webhook:
clientConfig:
url: https://karmada-webhook.karmada-system.svc:443/convert
caBundle: {{caBundle}}
conversionReviewVersions: ["v1"]

The webhook url is hardcoded and actually needs to be entered via a variable.

Which issue(s) this PR fixes:
Fixes #4893

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

`karmada-operator`: fix the "no such host" error when accessing the /convert webhook.

@karmada-bot karmada-bot added the kind/bug Categorizes issue or PR as related to a bug. label Jan 23, 2025
@karmada-bot karmada-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 23, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 23, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 16.66667% with 35 lines in your changes missing coverage. Please review.

Project coverage is 48.35%. Comparing base (07747ed) to head (61b4b4c).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
operator/pkg/tasks/init/karmadaresource.go 0.00% 16 Missing ⚠️
operator/pkg/util/util.go 0.00% 10 Missing ⚠️
pkg/karmadactl/cmdinit/karmada/deploy.go 43.75% 7 Missing and 2 partials ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6079      +/-   ##
==========================================
+ Coverage   48.33%   48.35%   +0.01%     
==========================================
  Files         666      666              
  Lines       54874    54908      +34     
==========================================
+ Hits        26525    26549      +24     
- Misses      26623    26631       +8     
- Partials     1726     1728       +2     
Flag Coverage Δ
unittests 48.35% <16.66%> (+0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from zhzhuang-zju and additionally assign poor12, prodanlabs for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

operator: dial tcp: lookup karmada-webhook.karmada-system.svc on x.x.x.x: no such host
4 participants