Skip to content

Commit

Permalink
[2100] Reconcile a namespace again with missing rolebinding
Browse files Browse the repository at this point in the history
  • Loading branch information
jkhelil committed Apr 10, 2024
1 parent 7bc7f7e commit 09915b6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/reconciler/openshift/tektonconfig/rbac.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,14 @@ func (r *rbac) getNamespacesToBeReconciled(ctx context.Context) ([]corev1.Namesp
// We must make sure that the default SCC is in force via the ClusterRole.
sccRoleBinding, err := r.kubeClientSet.RbacV1().RoleBindings(ns.Name).Get(ctx, pipelinesSCCRoleBinding, metav1.GetOptions{})
if err != nil {
return nil, err
// https://github.com/tektoncd/operator/issues/2100
// Reconcile a namespace again with missing RoleBinding
if errors.IsNotFound(err) {
logger.Debugf("could not find roleBinding %s in namespace %s", pipelinesSCCRoleBinding, ns.Name)
namespaces = append(namespaces, ns)
continue
}
return nil, fmt.Errorf("error fetching rolebinding %s from namespace %s: %w", pipelinesSCCRoleBinding, ns.Name, err)
}
if sccRoleBinding.RoleRef.Kind != "ClusterRole" {
logger.Infof("RoleBinding %s in namespace: %s should have CluterRole with default SCC, will reconcile again...", pipelinesSCCRoleBinding, ns.Name)
Expand Down

0 comments on commit 09915b6

Please sign in to comment.