Return the created env on create req

This commit is contained in:
Nikolai Rodionov 2024-04-30 10:47:40 +02:00
parent e6e59badf9
commit 84819c5842
Signed by: allanger
GPG Key ID: 0AA46A90E25592AD

View File

@ -145,12 +145,12 @@ func (e *EnvironmentsServer) List(in *proto.ListOptions, stream proto.Environmen
}
for _, env := range envs {
provider, err := providers.GetProvider(environment.Data.Provider)
provider, err := providers.GetProvider(env.Data.Provider)
if err != nil {
return err
}
k8s, err := kubernetes.GetKubernetes(environment.Data.Kubernetes)
k8s, err := kubernetes.GetKubernetes(env.Data.Kubernetes)
if err != nil {
return err
}
@ -163,8 +163,8 @@ func (e *EnvironmentsServer) List(in *proto.ListOptions, stream proto.Environmen
Spec: &proto.EnvironmentSpec{
Provider: proto.Provider(proto.Provider_value[provider.RawProviderName()]),
Kubernetes: proto.Kubernetes(proto.Kubernetes_value[k8s.RawKubernetesName()]),
ServerLocation: proto.Location(proto.Location_value[provider.RawServerLocation(environment.Data.Location)]),
ServerType: proto.ServerType(proto.ServerType_value[provider.RawServerType(environment.Data.ServerType)]),
ServerLocation: proto.Location(proto.Location_value[provider.RawServerLocation(env.Data.Location)]),
ServerType: proto.ServerType(proto.ServerType_value[provider.RawServerType(env.Data.ServerType)]),
},
}); err != nil {
return err