allow to set default env in project file

This commit is contained in:
Maidul Islam
2023-02-14 19:57:27 -08:00
parent c7dd028771
commit da857f321b
2 changed files with 6 additions and 1 deletions

View File

@@ -39,7 +39,8 @@ type Workspace struct {
}
type WorkspaceConfigFile struct {
WorkspaceId string `json:"workspaceId"`
WorkspaceId string `json:"workspaceId"`
DefaultEnvironment string `json:"defaultEnvironment"`
}
type SymmetricEncryptionResult struct {

View File

@@ -131,6 +131,10 @@ func GetAllEnvironmentVariables(params models.GetAllSecretsParameters) ([]models
return nil, err
}
if workspaceFile.DefaultEnvironment != "" {
params.Environment = workspaceFile.DefaultEnvironment
}
// Verify environment
err = ValidateEnvironmentName(params.Environment, workspaceFile.WorkspaceId, loggedInUserDetails.UserCredentials)
if err != nil {