Merge pull request #19381 from VladMasarik/add-docs-orphans2
Docs: Add docs about config option to auto clean up orphans
This commit is contained in:
@@ -123,3 +123,14 @@ source that should be mirrored into Backstage. To make Backstage a mirror of
|
||||
this remote source, users cannot also register new entities with e.g. the
|
||||
[catalog-import](https://github.com/backstage/backstage/tree/master/plugins/catalog-import)
|
||||
plugin.
|
||||
|
||||
## Clean up orphaned entities
|
||||
|
||||
In short entities can become orphaned through multiple means, such as when a catalog-info YAML file is moved from one place to another in the version control system without updating the registration in the catalog. For safety reasons the default behavior is to just tag the orphaned entities, and keep them around. You can read more about orphaned entities [here](life-of-an-entity.md#orphaning).
|
||||
|
||||
However, if you do with to automatically remove the orphaned entities, you can use the following configuration, and everything with an orphaned entity tag will be eventually deleted.
|
||||
|
||||
```
|
||||
catalog:
|
||||
orphanStrategy: delete
|
||||
```
|
||||
|
||||
@@ -222,7 +222,8 @@ either, it becomes _orphaned_. The end result is as follows:
|
||||
- The stitching process injects a `backstage.io/orphan: 'true'` annotation on
|
||||
the child entity.
|
||||
- The child entity is _not_ removed from the catalog, but stays around until
|
||||
explicitly deleted via the catalog API, or "reclaimed" by the original parent
|
||||
explicitly deleted via the catalog API, implicitly if `orphanStrategy: delete`
|
||||
configuration is set, or until it is "reclaimed" by the original parent
|
||||
or another parent starting to reference it.
|
||||
- The catalog page in Backstage for the child entity detects the new annotation
|
||||
and informs users about the orphan status.
|
||||
@@ -259,9 +260,13 @@ entities without explicit owner consent. The catalog therefore takes the stance
|
||||
that entities that often were added by direct user action should also be deleted
|
||||
only by direct user action.
|
||||
|
||||
It is possible to use the catalog API to build automated "reaper" systems that
|
||||
finally delete entities that are orphaned. This is however not something that's
|
||||
provided out of the box.
|
||||
However, if you want to delete orphaned entities automatically anyway, you can
|
||||
enable the automated clean up with the following app-config option.
|
||||
|
||||
```
|
||||
catalog:
|
||||
orphanStrategy: delete
|
||||
```
|
||||
|
||||
## Implicit Deletion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user