@@ -712,13 +712,13 @@ private async Task CreateContainerNetworksAsync(CancellationToken cancellationTo
712
712
713
713
private async Task CreateContainersAndExecutablesAsync ( CancellationToken cancellationToken )
714
714
{
715
- var toCreate = _appResources . Where ( r => r . DcpResource is Container || r . DcpResource is Executable || r . DcpResource is ExecutableReplicaSet ) ;
715
+ var toCreate = _appResources . Where ( r => r . DcpResource is Container || r . DcpResource is Executable ) ;
716
716
AddAllocatedEndpointInfo ( toCreate ) ;
717
717
718
718
await _executorEvents . PublishAsync ( new OnEndpointsAllocatedContext ( cancellationToken ) ) . ConfigureAwait ( false ) ;
719
719
720
720
var containersTask = CreateContainersAsync ( toCreate . Where ( ar => ar . DcpResource is Container ) , cancellationToken ) ;
721
- var executablesTask = CreateExecutablesAsync ( toCreate . Where ( ar => ar . DcpResource is Executable || ar . DcpResource is ExecutableReplicaSet ) , cancellationToken ) ;
721
+ var executablesTask = CreateExecutablesAsync ( toCreate . Where ( ar => ar . DcpResource is Executable ) , cancellationToken ) ;
722
722
723
723
await Task . WhenAll ( containersTask , executablesTask ) . ConfigureAwait ( false ) ;
724
724
}
@@ -1022,12 +1022,8 @@ private async Task CreateExecutableAsync(AppResource er, ILogger resourceLogger,
1022
1022
spec = exe . Spec ;
1023
1023
createResource = async ( ) => await _kubernetesService . CreateAsync ( exe , cancellationToken ) . ConfigureAwait ( false ) ;
1024
1024
break ;
1025
- case ExecutableReplicaSet ers :
1026
- spec = ers . Spec . Template . Spec ;
1027
- createResource = async ( ) => await _kubernetesService . CreateAsync ( ers , cancellationToken ) . ConfigureAwait ( false ) ;
1028
- break ;
1029
1025
default :
1030
- throw new InvalidOperationException ( $ "Expected an Executable-like resource, but got { er . DcpResource . Kind } instead") ;
1026
+ throw new InvalidOperationException ( $ "Expected an Executable resource, but got { er . DcpResource . Kind } instead") ;
1031
1027
}
1032
1028
1033
1029
var failedToApplyArgs = false ;
@@ -1603,10 +1599,6 @@ private void AddServicesProducedInfo(IResource modelResource, IAnnotationHolder
1603
1599
1604
1600
static bool HasMultipleReplicas ( CustomResource resource )
1605
1601
{
1606
- if ( resource is ExecutableReplicaSet ers && ers . Spec . Replicas > 1 )
1607
- {
1608
- return true ;
1609
- }
1610
1602
if ( resource is Executable exe && exe . Metadata . Annotations . TryGetValue ( CustomResource . ResourceReplicaCount , out var value ) && int . TryParse ( value , CultureInfo . InvariantCulture , out var replicas ) && replicas > 1 )
1611
1603
{
1612
1604
return true ;
@@ -1673,10 +1665,6 @@ public async Task StopResourceAsync(string resourceName, CancellationToken cance
1673
1665
patch = CreatePatch ( e , obj => obj . Spec . Stop = true ) ;
1674
1666
await _kubernetesService . PatchAsync ( e , patch , cancellationToken ) . ConfigureAwait ( false ) ;
1675
1667
break ;
1676
- case ExecutableReplicaSet rs :
1677
- patch = CreatePatch ( rs , obj => obj . Spec . Replicas = 0 ) ;
1678
- await _kubernetesService . PatchAsync ( rs , patch , cancellationToken ) . ConfigureAwait ( false ) ;
1679
- break ;
1680
1668
default :
1681
1669
throw new InvalidOperationException ( $ "Unexpected resource type: { matchingResource . DcpResource . GetType ( ) . FullName } ") ;
1682
1670
}
@@ -1710,12 +1698,6 @@ public async Task StartResourceAsync(string resourceName, CancellationToken canc
1710
1698
case Executable e :
1711
1699
await StartExecutableOrContainerAsync ( e ) . ConfigureAwait ( false ) ;
1712
1700
break ;
1713
- case ExecutableReplicaSet rs :
1714
- var replicas = matchingResource . ModelResource . GetReplicaCount ( ) ;
1715
- var patch = CreatePatch ( rs , obj => obj . Spec . Replicas = replicas ) ;
1716
-
1717
- await _kubernetesService . PatchAsync ( rs , patch , cancellationToken ) . ConfigureAwait ( false ) ;
1718
- break ;
1719
1701
default :
1720
1702
throw new InvalidOperationException ( $ "Unexpected resource type: { matchingResource . DcpResource . GetType ( ) . FullName } ") ;
1721
1703
}
0 commit comments