Use executor type as a delimiter to prevent deploy name conflict (#1009)

This commit is contained in:
Ta-Ching Chen
2018-11-30 13:04:44 +08:00
committed by GitHub
parent 19b52938c3
commit 72faa927de
2 changed files with 10 additions and 5 deletions
+5 -2
View File
@@ -462,8 +462,11 @@ func (gp *GenericPool) specializePod(pod *apiv1.Pod, metadata *metav1.ObjectMeta
}
func (gp *GenericPool) getPoolName() string {
return strings.ToLower(fmt.Sprintf("poolmgr-%v-%v-%v",
gp.env.Metadata.Name, gp.env.Metadata.Namespace, uniuri.NewLen(8)))
// Use executor type as delimiter between function name and namespace to prevent deployment name conflict.
// For example:
// 1. fn-name: a-b fn-namespace: c => a-b-poolmgr-c
// 2. fn-name: a fn-namespace: b-c => a-poolmgr-b-c
return strings.ToLower(fmt.Sprintf("%v-poolmgr-%v", gp.env.Metadata.Name, gp.env.Metadata.Namespace))
}
// A pool is a deployment of generic containers for an env. This