Add disk size as an option

This commit is contained in:
2024-05-06 21:57:54 +02:00
parent bfd486568a
commit 4477c558f2
4 changed files with 18 additions and 3 deletions

View File

@ -58,6 +58,7 @@ func (e *EnvironmentsServer) Create(ctx context.Context, in *proto.CreateOptions
Kubernetes: k8s.GetKubernetesName(),
Location: location,
ServerType: serverType,
DiskSize: int(in.GetSpec().GetDiskSize()),
}
environment := &controllers.Environemnt{
@ -114,6 +115,7 @@ func (e *EnvironmentsServer) Update(ctx context.Context, in *proto.UpdateOptions
Kubernetes: k8s.GetKubernetesName(),
Location: location,
ServerType: serverType,
DiskSize: int(in.GetSpec().GetDiskSize()),
}
environment := &controllers.Environemnt{
@ -198,6 +200,7 @@ func (e *EnvironmentsServer) Get(ctx context.Context, in *proto.GetOptions) (*pr
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)]),
DiskSize: int32(environment.Data.DiskSize),
},
Id: in.GetId(),
Metadata: &proto.EnvironmentMetadata{
@ -248,6 +251,7 @@ func (e *EnvironmentsServer) List(in *proto.ListOptions, stream proto.Environmen
Kubernetes: proto.Kubernetes(proto.Kubernetes_value[k8s.RawKubernetesName()]),
ServerLocation: proto.Location(proto.Location_value[provider.RawServerLocation(env.Data.Location)]),
ServerType: proto.ServerType(proto.ServerType_value[provider.RawServerType(env.Data.ServerType)]),
DiskSize: int32(env.Data.DiskSize),
},
}); err != nil {
return err