@@ -203,9 +203,9 @@ func resourceSettings() *schema.Resource {
203203 Optional : true ,
204204 Computed : true ,
205205 Sensitive : true ,
206- DiffSuppressFunc : func (k , old , new string , d * schema.ResourceData ) bool {
207- return old == "" || new == ""
208- },
206+ // DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
207+ // return old == "" || new == ""
208+ // },
209209 },
210210 "default_team_id" : {Type : schema .TypeInt , Optional : true , Computed : true },
211211 "logout_uri" : {Type : schema .TypeString , Optional : true , Computed : true },
@@ -238,9 +238,9 @@ func resourceSettings() *schema.Resource {
238238 Optional : true ,
239239 Computed : true ,
240240 Sensitive : true ,
241- DiffSuppressFunc : func (k , old , new string , d * schema.ResourceData ) bool {
242- return old == "" || new == ""
243- },
241+ // DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
242+ // return old == "" || new == ""
243+ // },
244244 },
245245 "reader_dn" : {Type : schema .TypeString , Optional : true , Computed : true },
246246 "start_tls" : {Type : schema .TypeBool , Optional : true , Computed : true },
@@ -561,11 +561,13 @@ func resourceSettingsRead(d *schema.ResourceData, meta interface{}) error {
561561 "kube_secret_key" : result .OAuthSettings .KubeSecretKey ,
562562 }
563563
564- if currentOAuth , ok := d .GetOk ("oauth_settings" ); ok {
565- if items := currentOAuth .([]interface {}); len (items ) > 0 {
566- if current := items [0 ].(map [string ]interface {}); current != nil {
567- if secret := current ["client_secret" ]; secret != "" {
568- oauth ["client_secret" ] = secret
564+ if currentOAuthRaw , ok := d .GetOk ("oauth_settings" ); ok {
565+ if list , ok := currentOAuthRaw .([]interface {}); ok && len (list ) > 0 && list [0 ] != nil {
566+ if currentMap , ok := list [0 ].(map [string ]interface {}); ok {
567+ if secretRaw , ok := currentMap ["client_secret" ]; ok {
568+ if secretStr , ok := secretRaw .(string ); ok && secretStr != "" {
569+ oauth ["client_secret" ] = secretStr
570+ }
569571 }
570572 }
571573 }
0 commit comments