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

koord-manager: add elastic quota webhook #585

Merged
merged 1 commit into from
Sep 21, 2022

Conversation

xulinfei1996
Copy link
Contributor

Signed-off-by: xulinfei.xlf xulinfei.xlf@alibaba-inc.com

Ⅰ. Describe what this PR does

Ⅱ. Does this pull request fix one issue?

Ⅲ. Describe how to verify it

Ⅳ. Special notes for reviews

V. Checklist

  • I have written necessary docs and comments
  • I have added necessary unit tests and integration tests
  • All checks passed in make test

@codecov
Copy link

codecov bot commented Sep 6, 2022

Codecov Report

Base: 68.82% // Head: 68.78% // Decreases project coverage by -0.03% ⚠️

Coverage data is based on head (9560ef9) compared to base (ee9a26d).
Patch coverage: 70.43% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #585      +/-   ##
==========================================
- Coverage   68.82%   68.78%   -0.04%     
==========================================
  Files         196      203       +7     
  Lines       22323    22905     +582     
==========================================
+ Hits        15363    15756     +393     
- Misses       5883     6046     +163     
- Partials     1077     1103      +26     
Flag Coverage Δ
unittests 68.78% <70.43%> (-0.04%) ⬇️

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

Impacted Files Coverage Δ
...r/plugins/elasticquota/core/group_quota_manager.go 84.33% <0.00%> (-2.30%) ⬇️
...k/elasticquota/plugin_check_quota_meta_validate.go 0.00% <0.00%> (ø)
pkg/webhook/elasticquota/quota_topology_check.go 74.09% <74.09%> (ø)
...hook/elasticquota/validating/validating_handler.go 76.19% <76.19%> (ø)
pkg/webhook/elasticquota/quota_handler.go 79.31% <79.31%> (ø)
pkg/webhook/pod/validating/validating_handler.go 84.74% <79.31%> (-5.26%) ⬇️
pkg/webhook/elasticquota/quota_topology.go 83.49% <83.49%> (ø)
.../webhook/elasticquota/mutating/mutating_handler.go 83.87% <83.87%> (ø)
pkg/webhook/elasticquota/pod_check.go 85.71% <85.71%> (ø)
...kg/scheduler/plugins/elasticquota/plugin_helper.go 79.34% <100.00%> (-0.44%) ⬇️
... and 4 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@eahydra eahydra changed the title koord-webhook: add elastic quota webhook koord-manager: add elastic quota webhook Sep 6, 2022
@xulinfei1996 xulinfei1996 force-pushed the quota-webhook branch 5 times, most recently from c876b64 to 738b9cc Compare September 20, 2022 09:16
@xulinfei1996 xulinfei1996 force-pushed the quota-webhook branch 2 times, most recently from c36da49 to 5df1829 Compare September 20, 2022 12:18
Copy link
Contributor

@buptcozy buptcozy left a comment

Choose a reason for hiding this comment

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

/LGTM

Copy link
Contributor

@buptcozy buptcozy left a comment

Choose a reason for hiding this comment

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

/LGTM

return fmt.Errorf("BUG quotaMap and quotaTree information out of sync, losed :%v", quotaName)
}

delete(qt.quotaHierarchyInfo[quotaInfo.ParentName], quotaName)
Copy link
Member

Choose a reason for hiding this comment

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

validate 里修改内部状态是否合适?

@@ -57,6 +63,12 @@ func (h *PodValidatingHandler) validatingPodFn(ctx context.Context, req admissio
}

allowed, reason, err = h.clusterColocationProfileValidatingPod(ctx, req)
if err == nil {
plugin := elasticquota.NewPlugin(h.Decoder, h.Client)
if err = plugin.ValidatePod(ctx, req); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

因为尝试在这里维护内部状态,那这个插件就需要放在最后了。(如果集群还存在其他 webhook 组件,Pod 依然可能存在被拒绝的情形,这时内部的状态如何补偿)

Signed-off-by: xulinfei.xlf <xulinfei.xlf@alibaba-inc.com>
@hormes
Copy link
Member

hormes commented Sep 21, 2022

/lgtm
/approve

@koordinator-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: buptcozy, hormes

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants