Try using ids
This commit is contained in:
parent
657a269c3d
commit
d6095a2361
@ -66,7 +66,10 @@ func (e *EnvironmentsServer) Create(ctx context.Context, in *proto.CreateOptions
|
|||||||
}
|
}
|
||||||
return &proto.EnvironmentFull{
|
return &proto.EnvironmentFull{
|
||||||
Metadata: in.GetMetadata(),
|
Metadata: in.GetMetadata(),
|
||||||
Spec: in.GetSpec(),
|
Id: &proto.EnvironmentId{
|
||||||
|
Uuid: environment.Data.UUID,
|
||||||
|
},
|
||||||
|
Spec: in.GetSpec(),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,6 +96,7 @@ func (e *EnvironmentsServer) Update(ctx context.Context, in *proto.UpdateOptions
|
|||||||
|
|
||||||
data := &controllers.EnvironemntData{
|
data := &controllers.EnvironemntData{
|
||||||
Name: in.GetMetadata().GetName(),
|
Name: in.GetMetadata().GetName(),
|
||||||
|
UUID: in.GetId().GetUuid(),
|
||||||
Description: in.GetMetadata().GetDescription(),
|
Description: in.GetMetadata().GetDescription(),
|
||||||
Provider: provider.GetProviderName(),
|
Provider: provider.GetProviderName(),
|
||||||
Kubernetes: k8s.GetKubernetesName(),
|
Kubernetes: k8s.GetKubernetesName(),
|
||||||
@ -113,6 +117,7 @@ func (e *EnvironmentsServer) Update(ctx context.Context, in *proto.UpdateOptions
|
|||||||
}
|
}
|
||||||
return &proto.EnvironmentFull{
|
return &proto.EnvironmentFull{
|
||||||
Metadata: in.GetMetadata(),
|
Metadata: in.GetMetadata(),
|
||||||
|
Id: in.GetId(),
|
||||||
Spec: in.GetSpec(),
|
Spec: in.GetSpec(),
|
||||||
}, nil
|
}, nil
|
||||||
|
|
||||||
@ -121,6 +126,7 @@ func (e *EnvironmentsServer) Update(ctx context.Context, in *proto.UpdateOptions
|
|||||||
func (e *EnvironmentsServer) Delete(ctx context.Context, in *proto.DeleteOptions) (*empty.Empty, error) {
|
func (e *EnvironmentsServer) Delete(ctx context.Context, in *proto.DeleteOptions) (*empty.Empty, error) {
|
||||||
data := &controllers.EnvironemntData{
|
data := &controllers.EnvironemntData{
|
||||||
Name: in.GetMetadata().GetName(),
|
Name: in.GetMetadata().GetName(),
|
||||||
|
UUID: in.GetId().GetUuid(),
|
||||||
}
|
}
|
||||||
|
|
||||||
environment := &controllers.Environemnt{
|
environment := &controllers.Environemnt{
|
||||||
@ -138,7 +144,7 @@ func (e *EnvironmentsServer) Delete(ctx context.Context, in *proto.DeleteOptions
|
|||||||
|
|
||||||
func (e *EnvironmentsServer) Get(ctx context.Context, in *proto.GetOptions) (*proto.EnvironmentFull, error) {
|
func (e *EnvironmentsServer) Get(ctx context.Context, in *proto.GetOptions) (*proto.EnvironmentFull, error) {
|
||||||
data := &controllers.EnvironemntData{
|
data := &controllers.EnvironemntData{
|
||||||
Name: in.GetMetadata().GetName(),
|
UUID: in.GetId().GetUuid(),
|
||||||
}
|
}
|
||||||
|
|
||||||
environment := &controllers.Environemnt{
|
environment := &controllers.Environemnt{
|
||||||
@ -169,6 +175,7 @@ func (e *EnvironmentsServer) Get(ctx context.Context, in *proto.GetOptions) (*pr
|
|||||||
ServerLocation: proto.Location(proto.Location_value[provider.RawServerLocation(environment.Data.Location)]),
|
ServerLocation: proto.Location(proto.Location_value[provider.RawServerLocation(environment.Data.Location)]),
|
||||||
ServerType: proto.ServerType(proto.ServerType_value[provider.RawServerType(environment.Data.ServerType)]),
|
ServerType: proto.ServerType(proto.ServerType_value[provider.RawServerType(environment.Data.ServerType)]),
|
||||||
},
|
},
|
||||||
|
Id: in.GetId(),
|
||||||
Metadata: &proto.EnvironmentMetadata{
|
Metadata: &proto.EnvironmentMetadata{
|
||||||
Name: environment.Data.Name,
|
Name: environment.Data.Name,
|
||||||
Description: environment.Data.Description,
|
Description: environment.Data.Description,
|
||||||
@ -204,6 +211,9 @@ func (e *EnvironmentsServer) List(in *proto.ListOptions, stream proto.Environmen
|
|||||||
Name: env.Data.Name,
|
Name: env.Data.Name,
|
||||||
Description: env.Data.Description,
|
Description: env.Data.Description,
|
||||||
},
|
},
|
||||||
|
Id: &proto.EnvironmentId{
|
||||||
|
Uuid: env.Data.UUID,
|
||||||
|
},
|
||||||
Spec: &proto.EnvironmentSpec{
|
Spec: &proto.EnvironmentSpec{
|
||||||
Provider: proto.Provider(proto.Provider_value[provider.RawProviderName()]),
|
Provider: proto.Provider(proto.Provider_value[provider.RawProviderName()]),
|
||||||
Kubernetes: proto.Kubernetes(proto.Kubernetes_value[k8s.RawKubernetesName()]),
|
Kubernetes: proto.Kubernetes(proto.Kubernetes_value[k8s.RawKubernetesName()]),
|
||||||
|
@ -120,7 +120,7 @@ func (acc *Account) Create(ctx context.Context) error {
|
|||||||
Namespace: acc.Data.UUID,
|
Namespace: acc.Data.UUID,
|
||||||
},
|
},
|
||||||
Subjects: []rbacv1.Subject{
|
Subjects: []rbacv1.Subject{
|
||||||
rbacv1.Subject{
|
{
|
||||||
Kind: "ServiceAccount",
|
Kind: "ServiceAccount",
|
||||||
Name: acc.Data.UUID,
|
Name: acc.Data.UUID,
|
||||||
Namespace: acc.Data.UUID,
|
Namespace: acc.Data.UUID,
|
||||||
|
@ -40,13 +40,11 @@ func (e *EnvironemntData) buildVars() (string, error) {
|
|||||||
SP_PROVIDER=%s
|
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`,
|
|
||||||
e.Provider,
|
e.Provider,
|
||||||
e.Kubernetes,
|
e.Kubernetes,
|
||||||
e.ServerType,
|
e.ServerType,
|
||||||
e.Location,
|
e.Location,
|
||||||
e.Description,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
return vars, nil
|
return vars, nil
|
||||||
@ -281,7 +279,7 @@ func (env *Environemnt) Get(ctx context.Context) error {
|
|||||||
env.Data.Name = ""
|
env.Data.Name = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
if val, ok := res["SP_DESCRIPTION"]; ok {
|
if val, ok := envData.Data["description"]; ok {
|
||||||
env.Data.Description = val
|
env.Data.Description = val
|
||||||
} else {
|
} else {
|
||||||
env.Data.Description = ""
|
env.Data.Description = ""
|
||||||
|
Loading…
Reference in New Issue
Block a user