Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
SevenEarth committed Jan 9, 2025
1 parent 13296f2 commit ab2c1eb
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ func resourceTencentCloudKubernetesClusterCreatePostHandleResponse0(ctx context.
}

if _, ok := d.GetOk("auth_options"); ok {
request := tkeGetAuthOptions(d)
request := tkeGetAuthOptions(d, id)
if err := service.ModifyClusterAuthenticationOptions(ctx, request); err != nil {
return err
}
Expand Down Expand Up @@ -1397,7 +1397,7 @@ func resourceTencentCloudKubernetesClusterUpdateOnExit(ctx context.Context) erro
id := d.Id()

if d.HasChange("auth_options") {
request := tkeGetAuthOptions(d)
request := tkeGetAuthOptions(d, id)
err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError {
inErr := tkeService.ModifyClusterAuthenticationOptions(ctx, request)
if inErr != nil {
Expand Down Expand Up @@ -2275,12 +2275,12 @@ func tkeGetNodePoolGlobalConfig(d *schema.ResourceData) *tke.ModifyClusterAsGrou
return request
}

func tkeGetAuthOptions(d *schema.ResourceData) *tke.ModifyClusterAuthenticationOptionsRequest {
func tkeGetAuthOptions(d *schema.ResourceData, clusterId string) *tke.ModifyClusterAuthenticationOptionsRequest {
raw, ok := d.GetOk("auth_options")
options := raw.([]interface{})

request := tke.NewModifyClusterAuthenticationOptionsRequest()
request.ClusterId = helper.String(d.Id())
request.ClusterId = helper.String(clusterId)
request.ServiceAccounts = &tke.ServiceAccountAuthenticationOptions{
AutoCreateDiscoveryAnonymousAuth: helper.Bool(false),
}
Expand Down

0 comments on commit ab2c1eb

Please sign in to comment.