mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-04 11:01:38 +02:00
Create human users from teams api
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"time"
|
||||
|
||||
"k8s.io/client-go/pkg/api/v1"
|
||||
)
|
||||
|
||||
var passwordChars = []byte("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
|
||||
@@ -19,3 +22,16 @@ func RandomPassword(n int) string {
|
||||
|
||||
return string(b)
|
||||
}
|
||||
|
||||
func FullObjectNameFromMeta(meta v1.ObjectMeta) string {
|
||||
return FullObjectName(meta.Namespace, meta.Name)
|
||||
}
|
||||
|
||||
//TODO: Remove in favour of FullObjectNameFromMeta
|
||||
func FullObjectName(ns, name string) string {
|
||||
if ns == "" {
|
||||
ns = "default"
|
||||
}
|
||||
|
||||
return fmt.Sprintf("%s / %s", ns, name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user