Revert "Move email and uuid to labels"

This reverts commit 89dbe6120a.
This commit is contained in:
Nikolai Rodionov 2024-05-01 12:09:32 +02:00
parent a53d507d4b
commit e952ee40c1
Signed by: allanger
GPG Key ID: 0AA46A90E25592AD
2 changed files with 4 additions and 9 deletions

View File

@ -72,12 +72,10 @@ func (acc *Account) Create(ctx context.Context) error {
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: acc.Data.Username, Name: acc.Data.Username,
Namespace: "softplayer-accounts", Namespace: "softplayer-accounts",
Labels: map[string]string{
"softplayer.net/email": acc.Data.Email,
"softplayer.net/uuid": acc.Data.UUID,
},
}, },
StringData: map[string]string{ StringData: map[string]string{
"uuid": acc.Data.UUID,
"email": acc.Data.Email,
"password": passwordHash, "password": passwordHash,
}, },
} }
@ -189,7 +187,7 @@ func (acc *Account) Login(ctx context.Context) error {
return err return err
} }
acc.Data.UUID = string(sec.ObjectMeta.Labels["uuid"]) acc.Data.UUID = string(sec.Data["uuid"])
tokenName := fmt.Sprintf("sa-%s", acc.Data.UUID) tokenName := fmt.Sprintf("sa-%s", acc.Data.UUID)
saSec := &corev1.Secret{ saSec := &corev1.Secret{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{

View File

@ -26,7 +26,6 @@ type Environemnt struct {
type EnvironemntData struct { type EnvironemntData struct {
Name string Name string
FmtName string
Description string Description string
Provider string Provider string
Kubernetes string Kubernetes string
@ -40,14 +39,12 @@ SP_PROVIDER=%s
SP_KUBERNETES=%s SP_KUBERNETES=%s
SP_SERVER_TYPE=%s SP_SERVER_TYPE=%s
SP_SERVER_LOCATION=%s SP_SERVER_LOCATION=%s
SP_DESCRIPTION=%s SP_DESCRIPTION=%s`,
SP_NAME=%s`,
e.Provider, e.Provider,
e.Kubernetes, e.Kubernetes,
e.ServerType, e.ServerType,
e.Location, e.Location,
e.Description, e.Description,
e.Name,
) )
return vars, nil return vars, nil