Skip to content

Commit

Permalink
Fix pg config
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Saratura committed Oct 29, 2024
1 parent aee154d commit be710ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pkg/comp-functions/functions/vshnpostgres/extensions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down Expand Up @@ -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{}

Expand All @@ -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)
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit be710ac

Please sign in to comment.