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

卸载脚本语法不严格导致在OpenShift环境中内置user被删除 #2293

Open
klzsysy opened this issue Sep 6, 2024 · 0 comments
Open

Comments

@klzsysy
Copy link

klzsysy commented Sep 6, 2024

卸载脚本
https://github.com/kubesphere/ks-installer/blob/master/scripts/kubesphere-delete.sh#L176

# delete users
for user in `kubectl get users -o jsonpath="{.items[*].metadata.name}"`
do
  kubectl patch user $user -p '{"metadata":{"finalizers":null}}' --type=merge
done
kubectl delete users --all 2>/dev/null

会导致openshift 的user对象被删除,应该使用完整限定对象 users.iam.kubesphere.io

❯ oc get user                                                                                                                                                                                                      ─╯
NAME    UID                                    FULL NAME   IDENTITIES
sonny   ec6bcdfa-2f14-43e2-aec4-e416112705e4   sonny       gitlab:34

❯ oc get users.user.openshift.io                                                                                                                                                                                   ─╯
NAME    UID                                    FULL NAME   IDENTITIES
sonny   ec6bcdfa-2f14-43e2-aec4-e416112705e4   sonny       gitlab:34

❯ oc get users.iam.kubesphere.io                                                                                                                                                                                   ─╯
NAME              EMAIL                       STATUS
admin             [email protected]         Active
app-review        [email protected]
ivs               [email protected]
project-admin     [email protected]     Active
project-regular   [email protected]   Active
user-manager      [email protected]           Active
ws-admin          [email protected]          Active
ws-manager        [email protected]        Active
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

No branches or pull requests

1 participant