ClusterVolumeSnapshot returns the ObjectMeta, including a random name, for a new pgdata VolumeSnapshot.
(cluster *v1beta1.PostgresCluster)
| 259 | // ClusterVolumeSnapshot returns the ObjectMeta, including a random name, for a |
| 260 | // new pgdata VolumeSnapshot. |
| 261 | func ClusterVolumeSnapshot(cluster *v1beta1.PostgresCluster) metav1.ObjectMeta { |
| 262 | return metav1.ObjectMeta{ |
| 263 | Namespace: cluster.Namespace, |
| 264 | Name: cluster.Name + "-pgdata-snapshot-" + rand.String(4), |
| 265 | } |
| 266 | } |
| 267 | |
| 268 | // GenerateInstance returns a random name for a member of cluster and set. |
| 269 | func GenerateInstance( |