@@ -102,36 +102,35 @@ protected override async Task ProvisionAsync(CancellationToken cancellationToken
102102 $ "Stack deploy failed for '{ _config . StackName } ': { result . Error } ") ;
103103 }
104104
105- DeployResult = result . Data ;
105+ DeployResult = result . Data
106+ ?? throw new FluentDockerException (
107+ $ "Stack deploy for '{ _config . StackName } ' returned Success " +
108+ "but no result payload." ) ;
106109 ResourceName = _config . StackName ;
107110 }
108111
109112 /// <inheritdoc />
110- protected override async Task TeardownAsync ( )
113+ protected override async Task TeardownAsync ( CancellationToken cancellationToken )
111114 {
112- if ( DeployResult == null )
113- return ;
114-
115115 var driver = Kernel . SysCtl < IStackDriver > ( DriverId ) ;
116116 var context = new DriverContext ( DriverId ) ;
117- var result = await driver . RemoveAsync ( context , new [ ] { _config . StackName } ) ;
117+ var result = await driver . RemoveAsync (
118+ context , new [ ] { _config . StackName } , cancellationToken ) ;
118119 if ( ! result . Success )
119120 throw new FluentDockerException (
120121 $ "Failed to remove stack '{ _config . StackName } ': { result . Error } ") ;
121122 DeployResult = null ;
122123 }
123124
124125 /// <inheritdoc />
125- protected override async Task ForceRemoveAsync ( )
126+ protected override async Task ForceRemoveAsync ( CancellationToken cancellationToken )
126127 {
127- if ( DeployResult == null )
128- return ;
129-
130128 try
131129 {
132130 var driver = Kernel . SysCtl < IStackDriver > ( DriverId ) ;
133131 var context = new DriverContext ( DriverId ) ;
134- await driver . RemoveAsync ( context , new [ ] { _config . StackName } ) ;
132+ await driver . RemoveAsync (
133+ context , new [ ] { _config . StackName } , cancellationToken ) ;
135134 }
136135 catch
137136 {
0 commit comments