From b3363f361c702b5ac03417b78930541af880dfd2 Mon Sep 17 00:00:00 2001 From: "febc.yamamoto" Date: Mon, 19 Jun 2017 22:04:01 +0900 Subject: [PATCH] Implements Destroy --- plugin.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugin.go b/plugin.go index 05316a6..d8aa088 100644 --- a/plugin.go +++ b/plugin.go @@ -54,6 +54,12 @@ func (p *plugin) Label(instance instance.ID, labels map[string]string) error { } func (p *plugin) Destroy(instance instance.ID, context instance.Context) error { + path := filepath.Join(instanceDir, string(instance)) + _, err := os.Stat(path) + if err == nil { + //ファイルが存在する場合は削除 + return os.Remove(path) + } return nil }