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

Feat: support multi policies #5811

Merged
merged 1 commit into from
Apr 24, 2023

Conversation

Somefive
Copy link
Collaborator

@Somefive Somefive commented Apr 6, 2023

Description of your changes

This PR will allow users to add multiple same typed resource policies, including apply-once, garbage-collect, shard-resource, read-only, take-over. Previously, for each type of these policies, at most one such typed policy can be handled. But in the case there are various resource rules to be clarified in the policy, they might be grouped in different policies and therefore, this PR supports using multiple same typed policies, like adding two garbage-collect policy, one saying PVCs do not need to be recycled and the other saying ConfigMaps should be reserved until application deleted.

P.S. This PR fixes the incorrect cue definition for several types of policies.

I have:

  • Read and followed KubeVela's contribution process.
  • Related Docs updated properly. In a new feature or configuration option, an update to the documentation is necessary.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

Special notes for your reviewer

@codecov
Copy link

codecov bot commented Apr 6, 2023

Codecov Report

Patch coverage: 82.22% and project coverage change: +0.08 🎉

Comparison is base (b4e499b) 60.45% compared to head (301a7cc) 60.54%.

❗ Current head 301a7cc differs from pull request most recent head 5ce16dd. Consider uploading reports for the commit 5ce16dd to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5811      +/-   ##
==========================================
+ Coverage   60.45%   60.54%   +0.08%     
==========================================
  Files         224      224              
  Lines       31124    31162      +38     
==========================================
+ Hits        18816    18867      +51     
+ Misses      10529    10524       -5     
+ Partials     1779     1771       -8     
Flag Coverage Δ
core-unittests 55.69% <82.22%> (-0.05%) ⬇️
e2e-multicluster-test 24.77% <51.11%> (+0.10%) ⬆️
e2etests 25.22% <31.11%> (+0.06%) ⬆️

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

Impacted Files Coverage Δ
pkg/policy/common.go 80.85% <82.22%> (-19.15%) ⬇️

... and 12 files with indirect coverage changes

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 in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Hanmengnan Hanmengnan self-requested a review April 21, 2023 09:28
@Somefive Somefive force-pushed the feat/support-multi-policies branch from b63d6e9 to 301a7cc Compare April 24, 2023 02:56
@Somefive Somefive marked this pull request as ready for review April 24, 2023 02:56
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
@Somefive Somefive force-pushed the feat/support-multi-policies branch from 301a7cc to 5ce16dd Compare April 24, 2023 07:03
@FogDong FogDong merged commit bfb673e into kubevela:master Apr 24, 2023
23 checks passed
Kolossi pushed a commit to Kolossi/kubevela that referenced this pull request Apr 24, 2023
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
Signed-off-by: paul <paul@kolossi.co.uk>
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.

None yet

3 participants