- Move ORM models from internal/model to pkg/model organized by module (auth/k8s/registry) - Add authentication module with login, user management handlers - Update all import paths to use new model locations - Add frontend auth pages (Login, UserManagement) and authStore - Remove deprecated internal/model/model.go
22 lines
388 B
Go
22 lines
388 B
Go
package k8s
|
|
|
|
import (
|
|
"context"
|
|
"log"
|
|
|
|
k8s "gitea.loveuer.com/loveuer/cluster/pkg/model/k8s"
|
|
"gitea.loveuer.com/loveuer/cluster/pkg/store"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
func Init(ctx context.Context, db *gorm.DB, store store.Store) error {
|
|
if err := db.AutoMigrate(
|
|
&k8s.ClusterConfig{},
|
|
); err != nil {
|
|
log.Fatalf("failed to migrate k8s database: %v", err)
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|