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

chore: fix install 1.0 bug when existing KB 0.9 #8457

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions deploy/helm/templates/conversion-patch-hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ spec:
old_kb_json=$(kubectl get deployment ${name} -n ${namespace} -o json)
version=$(echo ${old_kb_json} | jq '.metadata.labels["app.kubernetes.io/version"]' | tr -d '"')
replicas=$(echo ${old_kb_json} | jq '.spec.replicas')
statusReplicas=$(echo ${old_kb_json} | jq '.status.replicas')
if echo "$version" | grep -q '^0\.9'; then
echo "TODO: add it when released 0.9.2"
# patch_num=$(echo $version | awk -F. '{print $3}' | awk -F- '{print $1}')
Expand All @@ -59,6 +60,11 @@ spec:
echo "ERROR: You must stop the existing ${namespace}/${name} version (${version}) before installing version 1.0."
exit 1
fi
echo "status: $statusReplicas"
if [ "$statusReplicas" != "null" ] || [ $statusReplicas -ne 0 ]; then
echo "ERROR: You must stop the existing ${namespace}/${name} version (${version}) before installing version 1.0."
exit 1
fi
done
IFS=$OLD_IFS
# 2. patch crds
Expand Down
26 changes: 26 additions & 0 deletions deploy/helm/templates/rbac/shardingdefinition_editor_role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# permissions for end users to edit shardingdefinitions.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "kubeblocks.fullname" . }}-shardingdefinition-editor-role
labels:
{{- include "kubeblocks.labels" . | nindent 4 }}
rules:
- apiGroups:
- apps.kubeblocks.io
resources:
- shardingdefinitions
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps.kubeblocks.io
resources:
- shardingdefinitions/status
verbs:
- get
Loading