mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-22 14:19:03 +00:00
DoNotRunExtensionsOnOverprovisionedVms must be false if Overprovision is false (#2375)
This commit is contained in:
@ -235,15 +235,15 @@ public class NodeOperations : StatefulOrm<Node, NodeState, NodeOperations>, INod
|
|||||||
List<string> queryParts = new();
|
List<string> queryParts = new();
|
||||||
|
|
||||||
if (poolId is not null) {
|
if (poolId is not null) {
|
||||||
queryParts.Add($"(pool_id eq '{poolId}')");
|
queryParts.Add(TableClient.CreateQueryFilter($"(pool_id eq {poolId})"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (poolName is not null) {
|
if (poolName is not null) {
|
||||||
queryParts.Add($"(pool_name eq '{poolName}')");
|
queryParts.Add(TableClient.CreateQueryFilter($"(pool_name eq {poolName.String})"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scalesetId is not null) {
|
if (scalesetId is not null) {
|
||||||
queryParts.Add($"(scaleset_id eq '{scalesetId}')");
|
queryParts.Add(TableClient.CreateQueryFilter($"(scaleset_id eq {scalesetId})"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (states is not null) {
|
if (states is not null) {
|
||||||
@ -469,7 +469,7 @@ public class NodeOperations : StatefulOrm<Node, NodeState, NodeOperations>, INod
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (poolName is not null) {
|
if (poolName is not null) {
|
||||||
queryParts.Add($"(PartitionKey eq '{poolName}')");
|
queryParts.Add($"(PartitionKey eq '{poolName.String}')");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scaleSetId is not null) {
|
if (scaleSetId is not null) {
|
||||||
@ -513,7 +513,7 @@ public class NodeOperations : StatefulOrm<Node, NodeState, NodeOperations>, INod
|
|||||||
}
|
}
|
||||||
|
|
||||||
public IAsyncEnumerable<Node> SearchByPoolName(PoolName poolName) {
|
public IAsyncEnumerable<Node> SearchByPoolName(PoolName poolName) {
|
||||||
return QueryAsync($"(pool_name eq '{poolName}')");
|
return QueryAsync(TableClient.CreateQueryFilter($"(pool_name eq {poolName.String})"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using ApiService.OneFuzzLib.Orm;
|
using ApiService.OneFuzzLib.Orm;
|
||||||
|
using Azure.Data.Tables;
|
||||||
using Azure.Storage.Sas;
|
using Azure.Storage.Sas;
|
||||||
|
|
||||||
namespace Microsoft.OneFuzz.Service;
|
namespace Microsoft.OneFuzz.Service;
|
||||||
@ -77,7 +78,7 @@ public class NotificationOperations : Orm<Notification>, INotificationOperations
|
|||||||
}
|
}
|
||||||
|
|
||||||
public IAsyncEnumerable<Notification> GetNotifications(Container container) {
|
public IAsyncEnumerable<Notification> GetNotifications(Container container) {
|
||||||
return QueryAsync(filter: $"container eq '{container}'");
|
return QueryAsync(filter: TableClient.CreateQueryFilter($"container eq {container.String}"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public IAsyncEnumerable<(Task, IEnumerable<Container>)> GetQueueTasks() {
|
public IAsyncEnumerable<(Task, IEnumerable<Container>)> GetQueueTasks() {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using ApiService.OneFuzzLib.Orm;
|
using ApiService.OneFuzzLib.Orm;
|
||||||
|
using Azure.Data.Tables;
|
||||||
|
|
||||||
namespace Microsoft.OneFuzz.Service;
|
namespace Microsoft.OneFuzz.Service;
|
||||||
|
|
||||||
@ -24,11 +25,11 @@ public class ProxyForwardOperations : Orm<ProxyForward>, IProxyForwardOperations
|
|||||||
|
|
||||||
var conditions =
|
var conditions =
|
||||||
new[] {
|
new[] {
|
||||||
scalesetId != null ? $"scaleset_id eq '{scalesetId}'" : null,
|
scalesetId is not null ? TableClient.CreateQueryFilter($"scaleset_id eq {scalesetId}") : null,
|
||||||
region != null ? $"PartitionKey eq '{region}'" : null ,
|
region is not null ? TableClient.CreateQueryFilter($"PartitionKey eq {region.String}") : null ,
|
||||||
machineId != null ? $"machine_id eq '{machineId}'" : null ,
|
machineId is not null ? TableClient.CreateQueryFilter($"machine_id eq {machineId}") : null ,
|
||||||
proxyId != null ? $"proxy_id eq '{proxyId}'" : null ,
|
proxyId is not null ? TableClient.CreateQueryFilter($"proxy_id eq {proxyId}") : null ,
|
||||||
dstPort != null ? $"dst_port eq {dstPort}" : null ,
|
dstPort is not null ? TableClient.CreateQueryFilter($"dst_port eq {dstPort}") : null ,
|
||||||
}.Where(x => x != null);
|
}.Where(x => x != null);
|
||||||
|
|
||||||
var filter = Query.And(conditions!);
|
var filter = Query.And(conditions!);
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using ApiService.OneFuzzLib.Orm;
|
using ApiService.OneFuzzLib.Orm;
|
||||||
|
using Azure.Data.Tables;
|
||||||
using Azure.ResourceManager.Compute;
|
using Azure.ResourceManager.Compute;
|
||||||
using Azure.ResourceManager.Compute.Models;
|
using Azure.ResourceManager.Compute.Models;
|
||||||
using Azure.Storage.Sas;
|
using Azure.Storage.Sas;
|
||||||
@ -42,7 +43,7 @@ public class ProxyOperations : StatefulOrm<Proxy, VmState, ProxyOperations>, IPr
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async Async.Task<Proxy?> GetOrCreate(Region region) {
|
public async Async.Task<Proxy?> GetOrCreate(Region region) {
|
||||||
var proxyList = QueryAsync(filter: $"region eq '{region}' and outdated eq false");
|
var proxyList = QueryAsync(filter: TableClient.CreateQueryFilter($"region eq {region.String} and outdated eq false"));
|
||||||
|
|
||||||
await foreach (var proxy in proxyList) {
|
await foreach (var proxy in proxyList) {
|
||||||
if (IsOutdated(proxy)) {
|
if (IsOutdated(proxy)) {
|
||||||
|
@ -271,7 +271,7 @@ public class VmssOperations : IVmssOperations {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var vmssData = new VirtualMachineScaleSetData(location) {
|
var vmssData = new VirtualMachineScaleSetData(location) {
|
||||||
DoNotRunExtensionsOnOverprovisionedVms = true,
|
DoNotRunExtensionsOnOverprovisionedVms = false,
|
||||||
UpgradePolicy = new() {
|
UpgradePolicy = new() {
|
||||||
Mode = UpgradeMode.Manual,
|
Mode = UpgradeMode.Manual,
|
||||||
},
|
},
|
||||||
@ -399,7 +399,7 @@ public class VmssOperations : IVmssOperations {
|
|||||||
entry.SetAbsoluteExpiration(TimeSpan.FromMinutes(10));
|
entry.SetAbsoluteExpiration(TimeSpan.FromMinutes(10));
|
||||||
|
|
||||||
var sub = _creds.GetSubscriptionResource();
|
var sub = _creds.GetSubscriptionResource();
|
||||||
var skus = sub.GetResourceSkusAsync(filter: TableClient.CreateQueryFilter($"location eq '{region}'"));
|
var skus = sub.GetResourceSkusAsync(filter: TableClient.CreateQueryFilter($"location eq {region.String}"));
|
||||||
|
|
||||||
var skuNames = new List<string>();
|
var skuNames = new List<string>();
|
||||||
await foreach (var sku in skus) {
|
await foreach (var sku in skus) {
|
||||||
|
Reference in New Issue
Block a user