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

charts/karmada: fix the creation condition of metrics-adapter related APIService #5378

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

iawia002
Copy link
Member

What type of PR is this?

/kind bug

What this PR does / why we need it:

I did not enable the metricsAdapter component, so the metrics adapter-related deployment was not created:

{{- if and (or (eq .Values.installMode "component") (eq .Values.installMode "host")) (has "metricsAdapter" .Values.components) }}

However, its APIService was still created, causing the controller-manager to continuously output the following error:

Discovery failed for some groups, 3 failing: unable to retrieve the complete list of server APIs: custom.metrics.k8s.io/v1beta1: stale GroupVersion discovery: custom.metrics.k8s.io/v1beta1, custom.metrics.k8s.io/v1beta2: stale GroupVersion discovery: custom.metrics.k8s.io/v1beta2, metrics.k8s.io/v1beta1: stale GroupVersion discovery: metrics.k8s.io/v1beta1
Screenshot 2024-08-15 at 17 10 45

This patch updates the creation condition of the related APIService, ensuring that they will be created together with the deployment.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Fix the creation condition of metrics-adapter related APIService.

@karmada-bot karmada-bot added the kind/bug Categorizes issue or PR as related to a bug. label Aug 15, 2024
@karmada-bot karmada-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Aug 15, 2024
@iawia002
Copy link
Member Author

/assign @chaosi-zju

@chaosi-zju
Copy link
Member

chaosi-zju commented Aug 15, 2024

great finding, I 've seen this error before, but I haven't gone into the cause.

@@ -32,6 +32,7 @@ metadata:
spec:
type: ExternalName
externalName: {{ $name }}-aggregated-apiserver.{{ include "karmada.namespace" . }}.svc.{{ .Values.clusterDomain }}
{{- if has "metricsAdapter" .Values.components }}
Copy link
Member

@chaosi-zju chaosi-zju Aug 15, 2024

Choose a reason for hiding this comment

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

I think it might be in the wrong position.

The outter condition is {{- if eq .Values.installMode "host" }}, then if my installMode is component, it will not run into this line?

Copy link
Member

Choose a reason for hiding this comment

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

I think this block should be on the same level as the below block {{- if has "search" .Values.components }}

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice catch! Fixed.

@codecov-commenter
Copy link

codecov-commenter commented Aug 15, 2024

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

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 29.40%. Comparing base (c575d4f) to head (f134f7f).

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

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5378   +/-   ##
=======================================
  Coverage   29.40%   29.40%           
=======================================
  Files         632      632           
  Lines       43835    43835           
=======================================
+ Hits        12890    12891    +1     
+ Misses      30004    30003    -1     
  Partials      941      941           
Flag Coverage Δ
unittests 29.40% <ø> (+<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.

@chaosi-zju
Copy link
Member

e2e failure rely on #5382

/retest

@chaosi-zju
Copy link
Member

Hi @a7i @XiShanYongYe-Chang this ci failure have occurred twice, which is introduced recently~

https://github.com/karmada-io/karmada/actions/runs/10401933004/job/28839752385?pr=5378

@a7i
Copy link
Contributor

a7i commented Aug 16, 2024

Hi @a7i @XiShanYongYe-Chang this ci failure have occurred twice, which is introduced recently~

https://github.com/karmada-io/karmada/actions/runs/10401933004/job/28839752385?pr=5378

taking a look!

Update: #5383

@chaosi-zju
Copy link
Member

/lgtm

cc @RainbowMango

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 16, 2024
@iawia002
Copy link
Member Author

/assign @RainbowMango
/unassign @chaosi-zju

@iawia002
Copy link
Member Author

ping @RainbowMango @XiShanYongYe-Chang

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.

/approve

That makes 100% sense. Sorry for the delay.

@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RainbowMango

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 Aug 26, 2024
@karmada-bot karmada-bot merged commit fe95aa0 into karmada-io:master Aug 26, 2024
13 checks passed
@iawia002 iawia002 deleted the metrics-adapter branch August 26, 2024 09:27
@RainbowMango RainbowMango added this to the v1.11 milestone Aug 31, 2024
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.

6 participants