@@ -500,7 +500,7 @@ func resourceTencentCloudKubernetesClusterCreatePostHandleResponse0(ctx context.
500500 }
501501
502502 if _ , ok := d .GetOk ("auth_options" ); ok {
503- request := tkeGetAuthOptions (d )
503+ request := tkeGetAuthOptions (d , id )
504504 if err := service .ModifyClusterAuthenticationOptions (ctx , request ); err != nil {
505505 return err
506506 }
@@ -1397,7 +1397,7 @@ func resourceTencentCloudKubernetesClusterUpdateOnExit(ctx context.Context) erro
13971397 id := d .Id ()
13981398
13991399 if d .HasChange ("auth_options" ) {
1400- request := tkeGetAuthOptions (d )
1400+ request := tkeGetAuthOptions (d , id )
14011401 err := resource .Retry (tccommon .WriteRetryTimeout , func () * resource.RetryError {
14021402 inErr := tkeService .ModifyClusterAuthenticationOptions (ctx , request )
14031403 if inErr != nil {
@@ -2275,12 +2275,12 @@ func tkeGetNodePoolGlobalConfig(d *schema.ResourceData) *tke.ModifyClusterAsGrou
22752275 return request
22762276}
22772277
2278- func tkeGetAuthOptions (d * schema.ResourceData ) * tke.ModifyClusterAuthenticationOptionsRequest {
2278+ func tkeGetAuthOptions (d * schema.ResourceData , clusterId string ) * tke.ModifyClusterAuthenticationOptionsRequest {
22792279 raw , ok := d .GetOk ("auth_options" )
22802280 options := raw .([]interface {})
22812281
22822282 request := tke .NewModifyClusterAuthenticationOptionsRequest ()
2283- request .ClusterId = helper .String (d . Id () )
2283+ request .ClusterId = helper .String (clusterId )
22842284 request .ServiceAccounts = & tke.ServiceAccountAuthenticationOptions {
22852285 AutoCreateDiscoveryAnonymousAuth : helper .Bool (false ),
22862286 }
0 commit comments