Skip to content

Commit

Permalink
chore: add finalizer for ghost and anonymous users (#3386)
Browse files Browse the repository at this point in the history
#### What type of PR is this?
/kind improvement
/area core

#### What this PR does / why we need it:
为系统默认用户添加系统保护 finalizer,避免被删除

how to test it?
```shell
curl -u username:password --basic 'http://localhost:8090/api/v1alpha1/users/ghost'
curl -u username:password --basic 'http://localhost:8090/api/v1alpha1/users/anonymousUser'
```
将看到 
```json
"finalizers": [
  "...",
  "system-protection"
]
```
#### Which issue(s) this PR fixes:

Fixes #

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
None
```
  • Loading branch information
guqing authored Feb 24, 2023
1 parent 3330ff8 commit f1ec6ce
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/resources/extensions/user.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: v1alpha1
kind: User
metadata:
name: anonymousUser
finalizers:
- system-protection
spec:
displayName: Anonymous User
email: [email protected]
Expand All @@ -12,6 +14,8 @@ apiVersion: v1alpha1
kind: User
metadata:
name: ghost
finalizers:
- system-protection
spec:
displayName: 已删除用户
email: [email protected]
Expand Down

0 comments on commit f1ec6ce

Please sign in to comment.