Allow to set deployment config uid during initialization (#1249)

This commit is contained in:
Ta-Ching Chen
2019-08-01 22:53:04 +08:00
committed by GitHub
parent ac21c037d6
commit 7bbcaf2174
2 changed files with 8 additions and 2 deletions
+6 -1
View File
@@ -168,6 +168,11 @@ func specInit(c *cli.Context) error {
name = util.KubifyName(basename)
}
deployID := c.String("deployid")
if len(deployID) == 0 {
deployID = uuid.NewV4().String()
}
// Create spec dir
fmt.Printf("Creating fission spec directory '%v'\n", specDir)
err := os.MkdirAll(specDir, 0755)
@@ -190,7 +195,7 @@ func specInit(c *cli.Context) error {
// All resources will be annotated with the UID when they're created. This allows
// us to be idempotent, as well as to delete resources when their specs are
// removed.
UID: uuid.NewV4().String(),
UID: deployID,
}
err = writeDeploymentConfig(specDir, &dc)
util.CheckErr(err, "write deployment config")