projectcontour / contour-operator

Experimental repository to explore an operator for deploying Contour
Apache License 2.0
43 stars 34 forks source link

remove BackendPolicy RBAC #435

Closed skriss closed 3 years ago

skriss commented 3 years ago

The upcoming v1alpha2 release of Gateway API drops BackendPolicy. Contour has dropped references to it in 7013489dac80e71b2373240a83fe451162f4a4c5. This PR removes RBAC setup for it from the operator.

Signed-off-by: Steve Kriss krisss@vmware.com

codecov[bot] commented 3 years ago

Codecov Report

Merging #435 (efe928f) into main (7c19eae) will decrease coverage by 3.26%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #435      +/-   ##
==========================================
- Coverage   79.73%   76.46%   -3.27%     
==========================================
  Files          29       29              
  Lines        2235     2231       -4     
==========================================
- Hits         1782     1706      -76     
- Misses        334      385      +51     
- Partials      119      140      +21     
Impacted Files Coverage Δ
internal/operator/operator.go 51.85% <ø> (+3.57%) :arrow_up:
internal/objects/clusterrole/cluster_role.go 90.17% <100.00%> (ø)
internal/status/status.go 43.24% <0.00%> (-29.73%) :arrow_down:
internal/controller/controller.go 65.57% <0.00%> (-14.76%) :arrow_down:
internal/objects/rbac.go 54.76% <0.00%> (-9.53%) :arrow_down:
internal/objects/configmap/configmap.go 70.12% <0.00%> (-6.50%) :arrow_down:
internal/objects/contour/contour.go 78.66% <0.00%> (-5.34%) :arrow_down:
internal/objects/job/job.go 76.52% <0.00%> (-5.22%) :arrow_down:
internal/objects/service/service.go 83.47% <0.00%> (-5.22%) :arrow_down:
internal/objects/daemonset/daemonset.go 93.21% <0.00%> (-2.50%) :arrow_down:
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7c19eae...efe928f. Read the comment docs.

skriss commented 3 years ago

Looks like the upgrade E2E test does not work well with changes like this, since when deploying the "old" version of the Operator, the old RBAC for the Operator itself isn't applied, so it's using the "new" RBAC with the "old" Operator.

skriss commented 3 years ago

We're going to need to fix the upgrade test at some point, but for now I added back in RBAC for the Operator to BackendPolicy, so the tests will continue to pass. This PR now just removes BackendPolicy from the ClusterRole that the Operator creates when instantiating a Contour. After v1.19 ships, can drop the RBAC for the Operator itself.