Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: use default deployment config if not tenant mode (#7372)

Danny Xue1c5910b5556
diff --git a/backend/store/deploy.go b/backend/store/deploy.go
index 5ece0c34f9..2f08646ccd 100644
--- a/backend/store/deploy.go
+++ b/backend/store/deploy.go
@@ -119,6 +119,15 @@ type LabelSelectorRequirement struct {
// GetDeploymentConfigV2 returns the deployment config.
func (s *Store) GetDeploymentConfigV2(ctx context.Context, projectUID int) (*DeploymentConfigMessage, error) {
+ // Return the default deployment config if a project is not in tenant mode any more.
+ project, err := s.GetProjectV2(ctx, &FindProjectMessage{UID: &projectUID})
+ if err != nil {
+ return nil, err
+ }
+ if project.TenantMode != api.TenantModeTenant {
+ return s.getDefaultDeploymentConfigV2(ctx)
+ }
+
if deploymentConfig, ok := s.projectIDDeploymentConfigCache.Load(projectUID); ok {
return deploymentConfig.(*DeploymentConfigMessage), nil
}