Skip to content

Commit 094b3ef

Browse files
committed
Fix variable name to roleBinding
Signed-off-by: Ales Raszka <[email protected]>
1 parent ded04e9 commit 094b3ef

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

controllers/backupcronjob/backupcronjob_controller_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,6 @@ var _ = Describe("BackupCronJobReconciler", func() {
532532
}, sa)
533533
Expect(err).ToNot(HaveOccurred())
534534
Expect(sa.Labels).To(HaveKeyWithValue(constants.DevWorkspaceIDLabel, "id-rbac"))
535-
Expect(sa.Labels).To(HaveKeyWithValue(constants.DevWorkspaceWatchSecretLabel, "true"))
536535

537536
// Calling again should be idempotent
538537
err = reconciler.ensureJobRunnerRBAC(ctx, dw)

controllers/backupcronjob/rbac.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ func (r *BackupCronJobReconciler) ensureJobRunnerRBAC(ctx context.Context, works
8080
// ensureImagePushRoleBinding creates a ClusterRoleBinding to allow the given ServiceAccount to push images
8181
// to the OpenShift internal registry.
8282
func (r *BackupCronJobReconciler) ensureImagePushRoleBinding(ctx context.Context, saName string, workspace *dw.DevWorkspace, clusterAPI sync.ClusterAPI) error {
83-
// Create ClusterRoleBinding for system:image-builder role
84-
clusterRoleBinding := &rbacv1.RoleBinding{
83+
// Create RoleBinding for system:image-builder role
84+
roleBinding := &rbacv1.RoleBinding{
8585
ObjectMeta: metav1.ObjectMeta{
8686
Name: "devworkspace-image-builder-" + workspace.Status.DevWorkspaceId,
8787
Namespace: workspace.Namespace,
@@ -103,10 +103,10 @@ func (r *BackupCronJobReconciler) ensureImagePushRoleBinding(ctx context.Context
103103
},
104104
}
105105

106-
_, err := sync.SyncObjectWithCluster(clusterRoleBinding, clusterAPI)
106+
_, err := sync.SyncObjectWithCluster(roleBinding, clusterAPI)
107107
if err != nil {
108108
if _, ok := err.(*sync.NotInSyncError); !ok {
109-
return fmt.Errorf("ensuring ClusterRoleBinding: %w", err)
109+
return fmt.Errorf("ensuring RoleBinding: %w", err)
110110
}
111111
}
112112

0 commit comments

Comments
 (0)