Repository navigation
add reconcile-sccs command, create missing SCCs on server start - #5606
Conversation
There was a problem hiding this comment.
this needs more switches, since this object combines grants and bindings. I would expect to be able to reconcile the following things independently:
- SCC definitions
- SCC priorities
- SCC subjects, additive only
- SCC subjects, replace
There was a problem hiding this comment.
the things a cluster admin is likely to change are the priorities and users/groups... we need to make it possible to reset those without making it the default
There was a problem hiding this comment.
see also diagnostics/cluster/{roles,rolebindings}.go
There was a problem hiding this comment.
SCC subjects, replace
this one is a little tricky. We use the ensure method to craft additional SA user names to add to the SCC and replacing the groups/users would squash that. I'll see if there is a good way to do it. The other pieces seem easy to add flags for.
There was a problem hiding this comment.
I mean replacing what they have, in the case where they want to reset to defaults
There was a problem hiding this comment.
Yep, understood. The problem is here https://github.com/pweil-/origin/blob/6f86f784806558c188170ac235a994d3482c02f5/pkg/cmd/server/origin/ensure.go#L165-165. I can't just use what is in the default SCCs from bootstrap because we manipulate it with settings from the MasterConfig when installing defaults. I'll look for a better way to do it
There was a problem hiding this comment.
we need to be able to use this command on existing clusters to get SCCs in the shape we expect them. whatever inputs the ensure function uses to calculate default SCCs also needs to be inputs to this tool
There was a problem hiding this comment.
the PV controller service account will be another likely addition to that list
|
updated to use set methods and added flags for union and definitions. Still todo is priorities and getting the full config with additional service accounts |
7ccd224 to
8c24d75
Compare
|
@liggitt I picked in the minimal commit needed to get priorities in here, you can ignore the upstream commit. I was able to get away with some small refactorings rather than requiring the master config as input. I want to do some more thorough testing tomorrow but I have pretty good unit tests for the compute method. PTAL |
c426789 to
4e9f3c1
Compare
|
rebased since priorities just merged |
cb4b7f1 to
94feaab
Compare
|
@liggitt updated and squashed
Will create a bugzilla to get QE eyes on this |
|
[test] |
|
I will need to rebase when #5465 goes in, it was just tagged |
There was a problem hiding this comment.
sort.StringSlice(...).Sort()
|
exercise in delete a core scc and make sure reconcile recreates it (when --confirm) is passed add a custom user to a core scc and make sure reconcile does not remove it: delete a core user or group from a core scc and make sure reconcile readds it: |
|
rebased @markturansky - please double check the pv controller scc (moved into securitycontextconstraints.go) @liggitt added your snippets to |
|
[test] |
|
Evaluated for origin test up to c6cb469 |
|
LGTM |
|
[merge] |
|
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/6904/) (Image: devenv-rhel7_2638) |
|
Evaluated for origin merge up to c6cb469 |
|
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/6904/) |
|
Changes Unknown when pulling c6cb469 on pweil-:reconcile-scc into ** on openshift:master**. |
Add a command to reconcile cluster bootstrap SCCs with existing SCCs. I think this should be considered for a low risk addition. Still testing it out but first pass seems to work.
@liggitt @deads2k @smarterclayton