mirror of
https://github.com/kreuzwerker/terraform-provider-docker.git
synced 2026-01-09 00:02:55 -05:00
fix: service state upgradeV2 for empty auth
which caused a panic. Closes #203.
This commit is contained in:
parent
a99c73c28b
commit
ebe61896e9
1 changed files with 2 additions and 2 deletions
|
|
@ -9,7 +9,7 @@ import (
|
|||
func resourceDockerServiceStateUpgradeV2(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) {
|
||||
taskSpec, _ := rawState["task_spec"].([]interface{})[0].(map[string]interface{})
|
||||
r, ok := taskSpec["restart_policy"]
|
||||
if !ok && r == nil {
|
||||
if !ok || r == nil {
|
||||
taskSpec["restart_policy"] = []interface{}{}
|
||||
} else {
|
||||
restartPolicy := r.(map[string]interface{})
|
||||
|
|
@ -20,7 +20,7 @@ func resourceDockerServiceStateUpgradeV2(ctx context.Context, rawState map[strin
|
|||
}
|
||||
|
||||
a, ok := rawState["auth"]
|
||||
if !ok && a == nil {
|
||||
if !ok || a == nil {
|
||||
rawState["auth"] = []interface{}{}
|
||||
} else {
|
||||
auth := a.(map[string]interface{})
|
||||
|
|
|
|||
Loading…
Reference in a new issue