• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

KusionStack / karpor / 11929630776
64%

Build:
DEFAULT BRANCH: main
Ran 20 Nov 2024 08:39AM UTC
Jobs 1
Files 42
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

20 Nov 2024 08:36AM UTC coverage: 73.207% (-0.9%) from 74.136%
11929630776

push

github

web-flow
feat: soft delete (#622)

## What type of PR is this?

/kind feature

## What this PR does / why we need it:

In the current implementation, the lifecycle of storage data is bound to
object in cluster. When an object is deleted in cluster, the associated
data in storage will also be cleared.

Events in cluster are retained for one hour by default. As key
information for troubleshooting, it is usually hoped that events can be
retained for a longer time, which requires karpor to unbind the
lifecycle of specific types of resources from cluster.

This PR adds a `remainAfterDeleted` field in the SyncRegistry CRD to
control that a certain type of resources remain in storage after being
deleted in cluster.

If the user sets `remainAfterDeleted=true` for a type of resource, the
user needs to delete the associated data in the storage by himself.
Karpor only marks `deleted=true` for storage data when the object is
deleted in cluster.

For resources that leave `remainAfterDeleted` unset
(`remainAfterDeleted=false`), the data in storage will be deleted
immediately after the cluster object is deleted.

```yaml
apiVersion: search.karpor.io/v1beta1
kind: SyncRegistry
metadata:
  name: events-sync-rule
spec:
  clusters:
    - "*"
  syncResources:
    - apiVersion: v1
      resource: events
      trimRefName: for-events
      remainAfterDeleted: true
```

## Which issue(s) this PR fixes:

<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
_If PR is about `failing-tests or flakes`, please post the related
issues/tests in a comment and do not use `Fixes`_*
-->

Fixes #

---------

Co-authored-by: tianahi <wb-th358723@antgroup.com>

56 of 138 new or added lines in 6 files covered. (40.58%)

2 existing lines in 1 file now uncovered.

3440 of 4699 relevant lines covered (73.21%)

0.8 hits per line

Jobs
ID Job ID Ran Files Coverage
1 11929630776.1 20 Nov 2024 08:39AM UTC 0
73.21
GitHub Action Run
Source Files on build 11929630776
Detailed source file information is not available for this build.
  • Back to Repo
  • 78168bc7 on github
  • Prev Build on main (#11320425919)
  • Next Build on main (#11933461160)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc