Add new properties to CRDs
This commit is contained in:
parent
28381df56e
commit
fc6f1632da
9 changed files with 538 additions and 28 deletions
|
@ -25,13 +25,15 @@ import (
|
|||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
|
||||
keycloakv1alpha1 "git.zom.bi/images/keycloak-operator/api/v1alpha1"
|
||||
"git.zom.bi/images/keycloak-operator/controllers/keycloak"
|
||||
)
|
||||
|
||||
// KeycloakClientReconciler reconciles a KeycloakClient object
|
||||
type KeycloakClientReconciler struct {
|
||||
client.Client
|
||||
Log logr.Logger
|
||||
Scheme *runtime.Scheme
|
||||
Keycloak *keycloak.Keycloak
|
||||
Log logr.Logger
|
||||
Scheme *runtime.Scheme
|
||||
}
|
||||
|
||||
// +kubebuilder:rbac:groups=keycloak.bitmask.me,resources=keycloakclients,verbs=get;list;watch;create;update;patch;delete
|
||||
|
|
|
@ -63,10 +63,10 @@ func (r *KeycloakRealmReconciler) Reconcile(ctx context.Context, req ctrl.Reques
|
|||
}
|
||||
}
|
||||
|
||||
if realm.Status.ID != "" {
|
||||
if realm.Status.Available {
|
||||
// try to get existing realm
|
||||
log.Info("Would try to fetch the realm by its id.",
|
||||
"id", realm.Status.ID)
|
||||
"id", realm.Spec.RealmName)
|
||||
// if found {
|
||||
log.Info("will act like i found it, updating.")
|
||||
// update()
|
||||
|
@ -76,7 +76,6 @@ func (r *KeycloakRealmReconciler) Reconcile(ctx context.Context, req ctrl.Reques
|
|||
|
||||
log.Info("Would now create the realm.")
|
||||
|
||||
realm.Status.ID = "dummy"
|
||||
realm.Status.Available = true
|
||||
r.Status().Update(ctx, &realm)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue