chore: add server data

Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
This commit is contained in:
Armando Ruocco 2024-09-26 12:17:19 +02:00
parent c5f9869c16
commit 1bd96b0126
2 changed files with 20 additions and 8 deletions

View File

@ -55,9 +55,15 @@ func main() {
Namespace: namespace,
Name: boName,
},
// TODO: improve
PGDataPath: os.Getenv("PGDATA"),
PGWALPath: os.Getenv("PGWAL"),
SpoolDirectory: os.Getenv("SPOOL_DIRECTORY"),
ServerCertPath: os.Getenv("SERVER_CERT"),
ServerKeyPath: os.Getenv("SERVER_KEY"),
ClientCertPath: os.Getenv("CLIENT_CERT"),
ServerAddress: os.Getenv("SERVER_ADDRESS"),
PluginPath: os.Getenv("PLUGIN_PATH"),
}); err != nil {
setupLog.Error(err, "unable to create CNPGI runnable")
os.Exit(1)

View File

@ -15,6 +15,13 @@ type CNPGI struct {
PGDataPath string
PGWALPath string
SpoolDirectory string
ServerCertPath string
ServerKeyPath string
ClientCertPath string
// mutually exclusive with pluginPath
ServerAddress string
// mutually exclusive with serverAddress
PluginPath string
}
func (c *CNPGI) Start(ctx context.Context) error {
@ -31,14 +38,13 @@ func (c *CNPGI) Start(ctx context.Context) error {
}
srv := http.Server{
IdentityImpl: IdentityImplementation{},
Enrichers: []http.ServerEnricher{enrich},
// TODO: fille
ServerCertPath: "",
ServerKeyPath: "",
ClientCertPath: "",
ServerAddress: "",
PluginPath: "",
IdentityImpl: IdentityImplementation{},
Enrichers: []http.ServerEnricher{enrich},
ServerCertPath: c.ServerCertPath,
ServerKeyPath: c.ServerKeyPath,
ClientCertPath: c.ClientCertPath,
ServerAddress: c.ServerAddress,
PluginPath: c.PluginPath,
}
return srv.Start(ctx)