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

[BUG]oracle-mysql addon enable failed when the env has mysql enabled #6140

Closed
ahjing99 opened this issue Dec 19, 2023 · 0 comments · Fixed by apecloud/kubeblocks-addons#103
Closed
Assignees
Labels
bug kind/bug Something isn't working severity/major Great chance user will encounter the same problem
Milestone

Comments

@ahjing99
Copy link
Collaborator

➜ ~ kbcli version
Kubernetes: v1.27.3-gke.100
KubeBlocks: 0.8.0-beta.10
kbcli: 0.8.0-beta.10

The env already has mysql installed with kbcli addon enable mysql, then enable oracle-mysql failed

➜  ~ k logs install-oracle-mysql-addon-8mhbq -n kb-system
Defaulted container "helm" out of: helm, copy-charts (init)
Release "kb-addon-oracle-mysql" does not exist. Installing it now.
Error: Unable to continue with install: ConfigMap "oracle-mysql-reload-script" in namespace "kb-system" exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: key "meta.helm.sh/release-name" must equal "kb-addon-oracle-mysql": current value is "kb-addon-mysql"

➜  ~ k get cm -n kb-system | grep mysql
apecloud-mysql-scripts                                 13     19m
apecloud-mysql8-agamotto-configuration                 2      19m
kb-addon-apecloud-mysql-grafana-mysql                  1      19m
kb-addon-apecloud-mysql-grafana-mysql-proxy            1      19m
kb-addon-mysql-grafana-mysql                           1      18m
mysql-agamotto-configuration                           2      18m
mysql-reload-script                                    2      19m
mysql-scripts                                          4      18m
mysql8.0-auditlog-config-template                      1      19m
mysql8.0-config-template                               1      19m
mysql8.0.33-config-template                            1      18m
oracle-mysql-reload-script                             2      18m
oracle-mysql5.7-config-template                        1      18m
oracle-mysql8.0-config-template                        1      18m

➜  ~ k get cm oracle-mysql-reload-script -n kb-system -o yaml
apiVersion: v1
data:
  reload.tpl: "{{- /* mysql global variable update */}}\n{{- /* mysql using system
    variables reference docs: https://dev.mysql.com/doc/refman/8.0/en/using-system-variables.html
    */}}\n{{- /*  1. system variable names must be written using underscores, not
    dashes. */}}\n{{- /*  2. string variable 'xxx' */}}\n{{- /*  3. type convert to
    number */}}\n{{- range $pk, $pv := $.arg0 }}\n\t{{- $pk = trimPrefix \"loose_\"
    $pk }}\n\t{{- $pk = replace \"-\" \"_\" $pk }}\n\t{{- $var_int := -1 }}\n    {{-
    if $pv | regexMatch \"^\\\\d+$\" }}\n\t\t{{- $var_int = atoi $pv }}\n\t{{- end}}\n\t{{-
    if lt $var_int 0 }}\n\t\t{{- $tmp := $pv | regexStringSubmatch \"^(\\\\d+)K$\"
    }}\n\t\t{{- if $tmp }}\n\t\t{{- $var_int = last $tmp | atoi | mul 1024 }}\n\t\t{{-
    end }}\n\t{{- end }}\n\t{{- if lt $var_int 0 }}\n\t\t{{- $tmp := $pv | regexStringSubmatch
    \"^(\\\\d+)M$\" }}\n\t\t{{- if $tmp }}\n\t\t{{- $var_int =  last $tmp | atoi |
    mul 1024 1024 }}\n\t\t{{- end }}\n\t{{- end }}\n\t{{- if lt $var_int 0 }}\n\t\t{{-
    $tmp := $pv | regexStringSubmatch \"^(\\\\d+)G$\" }}\n\t\t{{- if $tmp }}\n\t\t{{-
    $var_int = last $tmp | atoi | mul 1024 1024 1024 }}\n\t\t{{- end }}\n\t{{- end
    }}\n\t{{- if ge $var_int 0 }}\n\t\t{{- execSql ( printf \"SET GLOBAL %s = %d\"
    $pk $var_int ) }}\n\t{{- else }}\n\t\t{{- execSql ( printf \"SET GLOBAL %s = '%s'\"
    $pk $pv ) }}\n\t{{- end }}\n{{- end }}"
  reload.yaml: |-
    scripts: reload.tpl
    fileRegex: my.cnf
    formatterConfig:
      format: ini
      iniConfig:
        sectionName: mysqld
kind: ConfigMap
metadata:
  annotations:
    meta.helm.sh/release-name: kb-addon-mysql
    meta.helm.sh/release-namespace: kb-system
  creationTimestamp: "2023-12-19T02:43:16Z"
  labels:
    app.kubernetes.io/instance: kb-addon-mysql
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: mysql
    app.kubernetes.io/version: 5.7.42
    helm.sh/chart: mysql-0.7.0
  name: oracle-mysql-reload-script
  namespace: kb-system
  resourceVersion: "5410"
  uid: fe3d6bb0-0db9-4e41-b52d-021f31003cbc
@ahjing99 ahjing99 added kind/bug Something isn't working severity/major Great chance user will encounter the same problem labels Dec 19, 2023
@ahjing99 ahjing99 added this to the Release 0.8.0 milestone Dec 19, 2023
@ahjing99 ahjing99 assigned xuriwuyun and unassigned sophon-zt Dec 19, 2023
@xuriwuyun xuriwuyun linked a pull request Dec 19, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug kind/bug Something isn't working severity/major Great chance user will encounter the same problem
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants