kubevela / velaux

The KubeVela User Experience (UX) Platform
Apache License 2.0
138 stars 111 forks source link

not support datastore type mysql #901

Open huiwq1990 opened 8 months ago

huiwq1990 commented 8 months ago

Describe the bug

When I start velaux with command --datastore-type=mysql, the velaux pod start failed with message Error: not support datastore type mysql.

To Reproduce

Expected behavior

The velaux support mysql as datastore, as the code https://github.com/kubevela/velaux/blob/main/pkg/server/server.go#L146

    switch s.cfg.Datastore.Type {
    case "mongodb":
        ds, err = mongodb.New(context.Background(), s.cfg.Datastore)
        if err != nil {
            return fmt.Errorf("create mongodb datastore instance failure %w", err)
        }
    case "kubeapi":
        ds, err = kubeapi.New(context.Background(), s.cfg.Datastore, kubeClient)
        if err != nil {
            return fmt.Errorf("create kubeapi datastore instance failure %w", err)
        }
    case "mysql":
        ds, err = mysql.New(context.Background(), s.cfg.Datastore)
        if err != nil {
            return fmt.Errorf("create mysql datastore instance failure %w", err)
        }

Screenshots

image

image

KubeVela Version

latest version.

Additional context

It's caused by config validation not include mysql. https://github.com/kubevela/velaux/blob/v1.9.3/pkg/server/config/config.go#L110

StevenLeiZhang commented 8 months ago

need optimize the code, when new database type is involved, it should work for all validations.

am6737 commented 3 weeks ago

Hi, is there anything I can do to help? I'm available and would be happy to assist.