diff --git a/cmd/instance/main.go b/cmd/instance/main.go index d205cea..f85c6d3 100644 --- a/cmd/instance/main.go +++ b/cmd/instance/main.go @@ -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) diff --git a/internal/cnpgi/instance/start.go b/internal/cnpgi/instance/start.go index 92459a0..c66c56c 100644 --- a/internal/cnpgi/instance/start.go +++ b/internal/cnpgi/instance/start.go @@ -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)