GenerateInstance returns a random name for a member of cluster and set.
( cluster *v1beta1.PostgresCluster, set *v1beta1.PostgresInstanceSetSpec, )
| 267 | |
| 268 | // GenerateInstance returns a random name for a member of cluster and set. |
| 269 | func GenerateInstance( |
| 270 | cluster *v1beta1.PostgresCluster, set *v1beta1.PostgresInstanceSetSpec, |
| 271 | ) metav1.ObjectMeta { |
| 272 | return metav1.ObjectMeta{ |
| 273 | Namespace: cluster.Namespace, |
| 274 | Name: cluster.Name + "-" + set.Name + "-" + rand.String(4), |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | // GenerateStartupInstance returns a stable name that's shaped like |
| 279 | // GenerateInstance above. The stable name is based on a four character |