rancher_environment: do not crash on empty members
This commit is contained in:
parent
01e9011231
commit
d75ff93165
|
@ -114,13 +114,15 @@ func resourceRancherEnvironmentCreate(d *schema.ResourceData, meta interface{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
members := d.Get("members").([]interface{})
|
if v, ok := d.GetOk("members"); ok {
|
||||||
|
members := v.([]interface{})
|
||||||
_, err = envClient.Project.ActionSetmembers(&newEnv, &rancherClient.SetProjectMembersInput{
|
_, err = envClient.Project.ActionSetmembers(&newEnv, &rancherClient.SetProjectMembersInput{
|
||||||
Members: members,
|
Members: members,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return resourceRancherEnvironmentRead(d, meta)
|
return resourceRancherEnvironmentRead(d, meta)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue