security-profiles-operator icon indicating copy to clipboard operation
security-profiles-operator copied to clipboard

tests: Add the recording RBAC roles and SA dynamically, re-add on every operator redeploy

Open jhrozek opened this issue 3 years ago • 7 comments

What type of PR is this?

/kind bug /kind failing-test

What this PR does / why we need it:

No idea why we didn't catch this before when running the RBAC roles and SA on OCP before, but redeploying the operator wouldn't re-add the RBAC role, role binding and the SA required to grant the ability to use the SCC needed to record replicated controllers.

This patch adds the needed manifests as part of deploying the operator.

Note that most of the code is only executed on OCP, on other distros, only the SA is added so that we can always reference the SA regardless of the distribution.

Which issue(s) this PR fixes:

None

Does this PR have test?

N/A

Special notes for your reviewer:

N/A

Does this PR introduce a user-facing change?

NONE

jhrozek avatar Jul 01 '22 15:07 jhrozek

/hold for some reason the tests work fine for me locally, wtf. Submitted some extra debugging and marking as hold

jhrozek avatar Jul 30 '22 10:07 jhrozek

Codecov Report

Merging #1016 (31765ad) into main (3d7d017) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1016   +/-   ##
=======================================
  Coverage   50.43%   50.43%           
=======================================
  Files          42       42           
  Lines        4761     4761           
=======================================
  Hits         2401     2401           
  Misses       2281     2281           
  Partials       79       79           

codecov-commenter avatar Jul 30 '22 11:07 codecov-commenter

/hold cancel

jhrozek avatar Aug 04 '22 08:08 jhrozek

this PR now superseded PR #1015

jhrozek avatar Aug 04 '22 08:08 jhrozek

@saschagrunert can you review this PR, please?

jhrozek avatar Aug 05 '22 08:08 jhrozek

/lgtm /approve

JAORMX avatar Aug 12 '22 07:08 JAORMX

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JAORMX, jhrozek, saschagrunert

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • ~~OWNERS~~ [JAORMX,jhrozek,saschagrunert]

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Aug 12 '22 07:08 k8s-ci-robot