Documentation ¶
Index ¶
- func Add(mgr manager.Manager) error
- type Certificate
- func (cert Certificate) AsSecretReference() corev1.SecretReference
- func (cert *Certificate) CreateOrUpdate(deployment *Deployment) error
- func (cert *Certificate) Delete() error
- func (cert *Certificate) GetFrom(instance *kubicv1beta1.DexConfiguration) error
- func (cert Certificate) GetHashRequested() string
- func (cert Certificate) GetName() string
- func (cert Certificate) GetNamespace() string
- func (cert *Certificate) GetObject() metav1.Object
- func (cert Certificate) String() string
- func (cert Certificate) WasGenerated() bool
- type ConfigMap
- func (config *ConfigMap) CreateLocal(connectors []kubicv1beta1.LDAPConnector, ...) error
- func (config *ConfigMap) CreateOrUpdate() error
- func (config *ConfigMap) Delete() error
- func (config *ConfigMap) GetFrom(instance *kubicv1beta1.DexConfiguration) error
- func (config ConfigMap) GetHashGenerated() string
- func (config ConfigMap) GetName() string
- func (config ConfigMap) GetNamespace() string
- func (config *ConfigMap) GetObject() metav1.Object
- func (config ConfigMap) NeedsCreateOrUpdate() bool
- func (config ConfigMap) String() string
- type Deployment
- func (deploy *Deployment) CreateLocal(configMap *ConfigMap, cert *Certificate) error
- func (deploy *Deployment) CreateOrUpdate() error
- func (deploy *Deployment) Delete() error
- func (deploy *Deployment) GetFrom(instance *kubicv1beta1.DexConfiguration) error
- func (deploy Deployment) GetName() string
- func (deploy Deployment) GetNamespace() string
- func (deploy Deployment) GetObject() metav1.Object
- func (deploy *Deployment) IsRunning() bool
- func (deploy Deployment) NeedsCreateOrUpdate() bool
- func (deploy Deployment) String() string
- type ObjectVisitor
- type ReconcileDexConfiguration
- type StaticClientsPasswords
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Certificate ¶
type Certificate struct {
// contains filtered or unexported fields
}
Certificate struct
func NewCertificate ¶
func NewCertificate(instance *kubicv1beta1.DexConfiguration, reconciler *ReconcileDexConfiguration) (*Certificate, error)
NewCertificate returns a new *dex.Certificate struct
func (Certificate) AsSecretReference ¶
func (cert Certificate) AsSecretReference() corev1.SecretReference
AsSecretReference returns a SecretReference
func (*Certificate) CreateOrUpdate ¶
func (cert *Certificate) CreateOrUpdate(deployment *Deployment) error
CreateOrUpdate creates the Service in the apiserver, or updates an existing instance
func (*Certificate) GetFrom ¶
func (cert *Certificate) GetFrom(instance *kubicv1beta1.DexConfiguration) error
GetFrom obtains the existing cert from the GeneratedCertificate specified in the instance.Status or instance.Spec
func (Certificate) GetHashRequested ¶
func (cert Certificate) GetHashRequested() string
GetHashRequested get the requested hash
func (Certificate) GetName ¶
func (cert Certificate) GetName() string
GetName returns the cert name takes the form of [DefaultPrefix]-auto-cert
func (Certificate) GetNamespace ¶
func (cert Certificate) GetNamespace() string
GetNamespace returns the namespace as a string
func (*Certificate) GetObject ¶
func (cert *Certificate) GetObject() metav1.Object
GetObject returns the metav1.Object of the generated cert
func (Certificate) String ¶
func (cert Certificate) String() string
String returns the namespacedObj of the cert as a string
func (Certificate) WasGenerated ¶
func (cert Certificate) WasGenerated() bool
WasGenerated checks if the cert was generated
type ConfigMap ¶
type ConfigMap struct { FileName string // contains filtered or unexported fields }
ConfigMap struct
func NewDexConfigMapFor ¶
func NewDexConfigMapFor(instance *kubicv1beta1.DexConfiguration, reconciler *ReconcileDexConfiguration) (*ConfigMap, error)
NewDexConfigMapFor returns a new dex.ConfigMap
func (*ConfigMap) CreateLocal ¶
func (config *ConfigMap) CreateLocal(connectors []kubicv1beta1.LDAPConnector, staticClientsPasswords StaticClientsPasswords) error
CreateLocal generates a local ConfigMap instance. Note well that this instance is not published to the apiserver: users must use `CreateOrUpdate()` for doing that.
func (*ConfigMap) CreateOrUpdate ¶
CreateOrUpdate creates the ConfigMap in the apiserver, or updates an existing instance
func (*ConfigMap) GetFrom ¶
func (config *ConfigMap) GetFrom(instance *kubicv1beta1.DexConfiguration) error
GetFrom obtains the current configmap fromm the ConfigMap specified in the instance.Status
func (ConfigMap) GetHashGenerated ¶
GetHashGenerated returns the hash of the generated config map
func (ConfigMap) GetNamespace ¶
GetNamespace returns the default namespace
func (ConfigMap) NeedsCreateOrUpdate ¶
NeedsCreateOrUpdate returns true if the ConfigMap is not in the cluster or it needs to be updated CreateLocal() must have been previously
type Deployment ¶
type Deployment struct { DexCfg *kubicv1beta1.DexConfiguration // contains filtered or unexported fields }
Deployment struct
func NewDeploymentFor ¶
func NewDeploymentFor(instance *kubicv1beta1.DexConfiguration, reconciler *ReconcileDexConfiguration) (*Deployment, error)
NewDeploymentFor returns a new Deployment struct for the configuration
func (*Deployment) CreateLocal ¶
func (deploy *Deployment) CreateLocal(configMap *ConfigMap, cert *Certificate) error
CreateLocal generates a local Deployment instance. Note well that this instance is not published to the apiserver: users must use `CreateOrUpdate()` for doing that.
func (*Deployment) CreateOrUpdate ¶
func (deploy *Deployment) CreateOrUpdate() error
CreateOrUpdate creates or updates the deployment
func (*Deployment) Delete ¶
func (deploy *Deployment) Delete() error
Delete removes the current deployment as well as all the other resources created It will ignore IsNotFound errors.
func (*Deployment) GetFrom ¶
func (deploy *Deployment) GetFrom(instance *kubicv1beta1.DexConfiguration) error
GetFrom obtains the current deployment fromm the Deployment specified in the instance.Status
func (Deployment) GetName ¶
func (deploy Deployment) GetName() string
GetName returns the name of the dex config
func (Deployment) GetNamespace ¶
func (deploy Deployment) GetNamespace() string
GetNamespace returns the default dex Namespace
func (Deployment) GetObject ¶
func (deploy Deployment) GetObject() metav1.Object
GetObject returns the generated metav1.Object
func (*Deployment) IsRunning ¶
func (deploy *Deployment) IsRunning() bool
IsRunning returns true if the Deployment is not in the cluster or it needs to be updated
func (Deployment) NeedsCreateOrUpdate ¶
func (deploy Deployment) NeedsCreateOrUpdate() bool
NeedsCreateOrUpdate returns true if the Deployment is not in the cluster or it needs to be updated CreateLocal() must have been previously
func (Deployment) String ¶
func (deploy Deployment) String() string
String returns the Namespace object as a string
type ObjectVisitor ¶
ObjectVisitor interface
type ReconcileDexConfiguration ¶
type ReconcileDexConfiguration struct { client.Client Clientset clientset.Interface record.EventRecorder // contains filtered or unexported fields }
ReconcileDexConfiguration reconciles a DexConfiguration object
func (*ReconcileDexConfiguration) Reconcile ¶
Reconcile reads that state of the cluster for a DexConfiguration object and makes changes based on the state read and what is in the DexConfiguration.Spec
Automatically generate RBAC rules to allow the Controller to read and write Deployments +kubebuilder:rbac:groups=core,resources=configmaps;secrets;serviceaccounts;services,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=core,resources=events,verbs=create;update;patch +kubebuilder:rbac:groups=networking.k8s.io,resources=networkpolicies,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=roles;rolebindings,verbs=get;list;watch;create;update;patch;delete;deletecollection +kubebuilder:rbac:groups=certificates.k8s.io,resources=certificatesigningrequests,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=certificates.k8s.io,resources=certificatesigningrequests/approval;certificatesigningrequests/status,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=kubic.opensuse.org,resources=dexconfigurations;ldapconnectors,verbs=get;list;watch;create;update;patch;delete
type StaticClientsPasswords ¶
type StaticClientsPasswords struct { Passwords map[string]crypto.SharedPassword Prefix string Namespace string }
StaticClientsPasswords is a groups of static, shared passwords that can be saved to k8s Secrets.
func NewStaticClientsPasswords ¶
func NewStaticClientsPasswords(prefix string, namespace string) (StaticClientsPasswords, error)
NewStaticClientsPasswords creates all the shared passwords it tries to load those passwords from Secrets in the apiserver if they are not found, new random passwords are generated, but not persisted in the apiserver
func (StaticClientsPasswords) CreateOrUpdateToSecrets ¶
func (scp StaticClientsPasswords) CreateOrUpdateToSecrets(cli clientset.Interface) error
CreateOrUpdateToSecrets publishes all the shared passwords as Secrets in the apiserver
func (*StaticClientsPasswords) GetOrRandomFromSecrets ¶
func (scp *StaticClientsPasswords) GetOrRandomFromSecrets(cli clientset.Interface, names []string) error
GetOrRandomFromSecrets tries to get the passwords from Secrets or generate random values