diff --git a/charts/region/Chart.yaml b/charts/region/Chart.yaml index 2ce3208..14cec62 100644 --- a/charts/region/Chart.yaml +++ b/charts/region/Chart.yaml @@ -4,8 +4,8 @@ description: A Helm chart for deploying Unikorn's Region Controller type: application -version: v0.1.38 -appVersion: v0.1.38 +version: v0.1.39 +appVersion: v0.1.39 icon: https://raw.githubusercontent.com/unikorn-cloud/assets/main/images/logos/dark-on-light/icon.png diff --git a/pkg/providers/openstack/compute.go b/pkg/providers/openstack/compute.go index 3f5a709..073aebb 100644 --- a/pkg/providers/openstack/compute.go +++ b/pkg/providers/openstack/compute.go @@ -33,6 +33,7 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/trace" + "github.com/unikorn-cloud/core/pkg/util" "github.com/unikorn-cloud/core/pkg/util/cache" unikornv1 "github.com/unikorn-cloud/region/pkg/apis/unikorn/v1alpha1" "github.com/unikorn-cloud/region/pkg/constants" @@ -258,17 +259,17 @@ func (c *ComputeClient) DeleteServerGroup(ctx context.Context, id string) error return servergroups.Delete(ctx, c.client, id).ExtractErr() } -func (c *ComputeClient) TweakQuotas(ctx context.Context, projectID string) error { +func (c *ComputeClient) UpdateQuotas(ctx context.Context, projectID string) error { tracer := otel.GetTracerProvider().Tracer(constants.Application) _, span := tracer.Start(ctx, "PUT /compute/v2/os-quota-sets") defer span.End() - all := -1 - opts := "asets.UpdateOpts{ - Cores: &all, - RAM: &all, + // TODO: instances, cores and ram need to be driven by client input. + Instances: util.ToPointer(-1), + Cores: util.ToPointer(-1), + RAM: util.ToPointer(-1), } return quotasets.Update(ctx, c.client, projectID, opts).Err diff --git a/pkg/providers/openstack/provider.go b/pkg/providers/openstack/provider.go index 74b49b7..b86e35b 100644 --- a/pkg/providers/openstack/provider.go +++ b/pkg/providers/openstack/provider.go @@ -549,7 +549,11 @@ func (p *Provider) provisionQuotas(ctx context.Context, identity *unikornv1.Open return err } - return compute.TweakQuotas(ctx, *identity.Spec.ProjectID) + if err := compute.UpdateQuotas(ctx, *identity.Spec.ProjectID); err != nil { + return err + } + + return nil } func (p *Provider) createClientConfig(identity *unikornv1.OpenstackIdentity) error {