feat: customize name of secret (#125)
This commit is contained in:
parent
6832edc9e9
commit
35abbe3c5c
@ -6,6 +6,7 @@ package controllers
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/go-logr/logr"
|
"github.com/go-logr/logr"
|
||||||
@ -22,13 +23,18 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
ClientIDKey = "client_id"
|
DefaultClientID = "CLIENT_ID"
|
||||||
ClientSecretKey = "client_secret"
|
DefaultSecretKey = "CLIENT_SECRET"
|
||||||
FinalizerName = "finalizer.ory.hydra.sh"
|
FinalizerName = "finalizer.ory.hydra.sh"
|
||||||
|
|
||||||
DefaultNamespace = "default"
|
DefaultNamespace = "default"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
ClientIDKey = DefaultClientID
|
||||||
|
ClientSecretKey = DefaultSecretKey
|
||||||
|
)
|
||||||
|
|
||||||
type clientKey struct {
|
type clientKey struct {
|
||||||
url string
|
url string
|
||||||
port int
|
port int
|
||||||
@ -66,6 +72,15 @@ type Options struct {
|
|||||||
// Option is a functional option.
|
// Option is a functional option.
|
||||||
type Option func(*Options)
|
type Option func(*Options)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
if os.Getenv("CLIENT_ID_KEY") != "" {
|
||||||
|
ClientIDKey = os.Getenv("CLIENT_ID_KEY")
|
||||||
|
}
|
||||||
|
if os.Getenv("CLIENT_SECRET_KEY") != "" {
|
||||||
|
ClientSecretKey = os.Getenv("CLIENT_SECRET_KEY")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// WithNamespace sets the kubernetes namespace for the controller.
|
// WithNamespace sets the kubernetes namespace for the controller.
|
||||||
// The default is "default".
|
// The default is "default".
|
||||||
func WithNamespace(ns string) Option {
|
func WithNamespace(ns string) Option {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user