INNER CODE UNIT · Go
New
sighupio/permission-manager · internal/config/config.go:24
func New() *Config {
cfg := &Config{
Cluster: ClusterConfig{
Name: os.Getenv("CLUSTER_NAME"),
ControlPlaneAddress: os.Getenv("CONTROL_PLANE_ADDRESS"),
Namespace: os.Getenv("NAMESPACE"),
},
Backend: BackendConfig{
Port: os.Getenv("PORT"),
},
}
if cfg.Backend.Port == "" {
log.Fatal("PORT env cannot be empty")
}
if cfg.Cluster.Name == "" {
log.Fatal("CLUSTER_NAME env cannot be empty")