provider/aws: Prevent panic when setting AWS CodeBuild Source to state (#12915)
Fixes: #12914 this is just a simple guard clause to prevent the hash from including an optional value by default
This commit is contained in:
parent
b7152c4405
commit
f0e7bc942b
|
@ -592,11 +592,11 @@ func resourceAwsCodeBuildProjectSourceAuthHash(v interface{}) int {
|
||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
m := v.(map[string]interface{})
|
m := v.(map[string]interface{})
|
||||||
|
|
||||||
authType := m["type"].(string)
|
buf.WriteString(fmt.Sprintf("%s-", m["type"].(string)))
|
||||||
authResource := m["resource"].(string)
|
|
||||||
|
|
||||||
buf.WriteString(fmt.Sprintf("%s-", authType))
|
if m["resource"] != nil {
|
||||||
buf.WriteString(fmt.Sprintf("%s-", authResource))
|
buf.WriteString(fmt.Sprintf("%s-", m["resource"].(string)))
|
||||||
|
}
|
||||||
|
|
||||||
return hashcode.String(buf.String())
|
return hashcode.String(buf.String())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue