Skip to content

Commit

Permalink
perf: improve UX for default resources config
Browse files Browse the repository at this point in the history
changed `LOCALSANDBOX_DISABLE_DEFAULT_RESOURCES` to `LOCALSANDBOX_DEFAULT_RESOURCES`
  • Loading branch information
mxsdev committed Sep 20, 2024
1 parent 886e301 commit 12a7e64
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/csharp-test/AzureTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected async Task<string> CreateQueue(int? maxDeliveryCount = null, TimeSpan?
}
else
{
var queue = await serviceBusManagementClient.Value.Queues.CreateOrUpdateAsync(rg, ns, Guid.NewGuid().ToString(), new()
var queue = await serviceBusManagementClient.Value.Queues.CreateOrUpdateAsync(resourceGroupName: rg, namespaceName: ns, queueName: Guid.NewGuid().ToString(), new()
{
MaxDeliveryCount = maxDeliveryCount,
AutoDeleteOnIdle = autoDeleteOnIdle ?? TimeSpan.FromMinutes(10),
Expand Down Expand Up @@ -155,7 +155,7 @@ public AzureTests()
serviceBusManagementClient = new(() => new ServiceBusManagementClient(new TokenCredentials(subscriptionId))
{
SubscriptionId = subscriptionId,
BaseUri = !e2eMode ? new Uri($"https://localhost.localsandbox.sh:7329/azure") : null
BaseUri = !e2eMode ? new($"https://localhost.localsandbox.sh:7329/azure") : null
});
}

Expand Down
6 changes: 3 additions & 3 deletions src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ const getEnvironmentVariableHelp = (
}

const server_help = getEnvironmentVariableHelp({
LOCALSANDBOX_DISABLE_DEFAULT_RESOURCES: {
help: "Disable creation of default resources",
default: "false",
LOCALSANDBOX_DEFAULT_RESOURCES: {
help: "Enable creation of default resources",
default: "true",
},

LOCALSANDBOX_DEFAULT_LOCATION: {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/integration/azure/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const createAzureIntegration: IntegrationFactory<
const build = azure_routes.build()

if (
!env.LOCALSANDBOX_DISABLE_DEFAULT_RESOURCES &&
env.LOCALSANDBOX_DEFAULT_RESOURCES &&
env.LOCALSANDBOX_DEFAULT_SUBSCRIPTION_ID
) {
logger?.debug(
Expand Down
4 changes: 2 additions & 2 deletions src/lib/server/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ const envSchema = z.object({
LOCALSANDBOX_DEFAULT_LOCATION: z.string().optional().default("westus2"),

LOCALSANDBOX_DEFAULT_SUBSCRIPTION_ID: resource_name,
LOCALSANDBOX_DISABLE_DEFAULT_RESOURCES: z.coerce
LOCALSANDBOX_DEFAULT_RESOURCES: z.coerce
.string()
.optional()
.default("false")
.default("true")
.transform((v) => v.toLowerCase() === "true" || v === "1"),
LOCALSANDBOX_DEFAULT_RESOURCE_GROUP: resource_name,
LOCALSANDBOX_DEFAULT_NAMESPACE: resource_name,
Expand Down

0 comments on commit 12a7e64

Please sign in to comment.