Recreate Rancher stack if it was removed (#11539)

This commit is contained in:
Raphaël Pinson 2017-01-31 10:58:16 +01:00 committed by Paul Stack
parent 28cee57ef5
commit 2914a38202
1 changed files with 6 additions and 0 deletions

View File

@ -132,6 +132,12 @@ func resourceRancherStackRead(d *schema.ResourceData, meta interface{}) error {
return err
}
if stack.State == "removed" {
log.Printf("[INFO] Stack %s was removed on %v", d.Id(), stack.Removed)
d.SetId("")
return nil
}
config, err := client.Environment.ActionExportconfig(stack, &rancherClient.ComposeConfigInput{})
if err != nil {
return err