diff --git a/pkg/comp-functions/functions/vshnpostgres/extensions.go b/pkg/comp-functions/functions/vshnpostgres/extensions.go index 1b027e53e..93780cf1e 100644 --- a/pkg/comp-functions/functions/vshnpostgres/extensions.go +++ b/pkg/comp-functions/functions/vshnpostgres/extensions.go @@ -52,7 +52,7 @@ func AddExtensions(ctx context.Context, comp *vshnv1.VSHNPostgreSQL, svc *runtim return runtime.NewFatalResult(fmt.Errorf("cannot add timescaldb to config: %w", err)) } } else { - err := disableTimescaleDB(ctx, svc) + err := disableTimescaleDB(ctx, svc, comp.GetName()) if err != nil { return runtime.NewFatalResult(fmt.Errorf("cannot ensure timescaldb absent from config: %w", err)) } @@ -105,10 +105,10 @@ func enableTimescaleDB(ctx context.Context, svc *runtime.ServiceRuntime, name st config.Spec.PostgresqlConf[sharedLibraries] = fmt.Sprintf("%s,%s", toAppend, timescaleExtName) } - return svc.SetDesiredKubeObjectWithName(config, name+"-"+configResourceName, configResourceName) + return svc.SetDesiredKubeObject(config, name+"-"+configResourceName) } -func disableTimescaleDB(ctx context.Context, svc *runtime.ServiceRuntime) error { +func disableTimescaleDB(ctx context.Context, svc *runtime.ServiceRuntime, name string) error { config := &stackgresv1.SGPostgresConfig{} @@ -135,5 +135,5 @@ func disableTimescaleDB(ctx context.Context, svc *runtime.ServiceRuntime) error config.Spec.PostgresqlConf[sharedLibraries] = strings.Join(finalElements, ", ") - return svc.SetDesiredKubeObject(config, configResourceName) + return svc.SetDesiredKubeObject(config, name+"-"+configResourceName) } diff --git a/pkg/comp-functions/functions/vshnpostgres/postgresql_deploy.go b/pkg/comp-functions/functions/vshnpostgres/postgresql_deploy.go index 36df5ca6f..2e1f7870c 100644 --- a/pkg/comp-functions/functions/vshnpostgres/postgresql_deploy.go +++ b/pkg/comp-functions/functions/vshnpostgres/postgresql_deploy.go @@ -334,7 +334,7 @@ func createSgPostgresConfig(comp *vshnv1.VSHNPostgreSQL, svc *runtime.ServiceRun }, } - err := svc.SetDesiredKubeObjectWithName(sgPostgresConfig, comp.GetName()+"-pgconf", "pg-conf") + err := svc.SetDesiredKubeObject(sgPostgresConfig, comp.GetName()+"-"+configResourceName) if err != nil { err = fmt.Errorf("cannot create sgInstanceProfile: %w", err) return err