diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 7a514799..2323bde3 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -25,6 +25,16 @@ rules: - patch - update - watch +- apiGroups: + - kustomize.toolkit.fluxcd.io + resources: + - kustomizations/finalizers + verbs: + - create + - delete + - get + - patch + - update - apiGroups: - kustomize.toolkit.fluxcd.io resources: @@ -42,3 +52,10 @@ rules: - get - list - watch +- apiGroups: + - source.toolkit.fluxcd.io + resources: + - buckets/status + - gitrepositories/status + verbs: + - get diff --git a/controllers/kustomization_controller.go b/controllers/kustomization_controller.go index aa3b5c80..3999758c 100644 --- a/controllers/kustomization_controller.go +++ b/controllers/kustomization_controller.go @@ -64,8 +64,10 @@ import ( // +kubebuilder:rbac:groups=kustomize.toolkit.fluxcd.io,resources=kustomizations,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=kustomize.toolkit.fluxcd.io,resources=kustomizations/status,verbs=get;update;patch -// +kubebuilder:rbac:groups="",resources=events,verbs=create;patch +// +kubebuilder:rbac:groups=kustomize.toolkit.fluxcd.io,resources=kustomizations/finalizers,verbs=get;create;update;patch;delete // +kubebuilder:rbac:groups=source.toolkit.fluxcd.io,resources=buckets;gitrepositories,verbs=get;list;watch +// +kubebuilder:rbac:groups=source.toolkit.fluxcd.io,resources=buckets/status;gitrepositories/status,verbs=get +// +kubebuilder:rbac:groups="",resources=events,verbs=create;patch // KustomizationReconciler reconciles a Kustomization object type KustomizationReconciler struct { @@ -875,6 +877,8 @@ func (r *KustomizationReconciler) kustomizationsForGitRepository(obj handler.Map for i := range sorted { reqs[i].NamespacedName.Name = sorted[i].Name reqs[i].NamespacedName.Namespace = sorted[i].Namespace + + r.Log.Info("requesting reconciliation", kustomizev1.KustomizationKind, reqs[i].NamespacedName) } return reqs } @@ -901,6 +905,8 @@ func (r *KustomizationReconciler) kustomizationsForBucket(obj handler.MapObject) for i := range sorted { reqs[i].NamespacedName.Name = sorted[i].Name reqs[i].NamespacedName.Namespace = sorted[i].Namespace + + r.Log.Info("requesting reconciliation", kustomizev1.KustomizationKind, reqs[i].NamespacedName) } return reqs }