Skip to content

Commit

Permalink
more cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Bryce Palmer <[email protected]>
  • Loading branch information
everettraven committed Jan 24, 2025
1 parent 8800674 commit 2750c09
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,15 @@ func Register(plugins *admission.Plugins) {
return nil, err
}

if cfg.OpenShiftOAuthDesiredState == v1alpha1.OpenShiftOAuthStateNotDesired {
if cfg != nil && cfg.OpenShiftOAuthDesiredState == v1alpha1.OpenShiftOAuthStateNotDesired {
klog.Infof("Admission plugin %q configured to expect the OpenShift oauth-apiserver as not being available. This is effectively the same as disabling the plugin, so it will be disabled.", RestrictSubjectBindingsPluginName)
return nil, nil
}
return nil, nil
}

return NewRestrictUsersAdmission()
})
}

func defaultConfig() *v1alpha1.RestrictSubjectBindingsAdmissionConfig {
return &v1alpha1.RestrictSubjectBindingsAdmissionConfig{
OpenShiftOAuthDesiredState: v1alpha1.OpenShiftOAuthStateDesired,
}
}

func readConfig(reader io.Reader) (*v1alpha1.RestrictSubjectBindingsAdmissionConfig, error) {
obj, err := helpers.ReadYAMLToInternal(reader, v1alpha1.Install)
if err != nil {
Expand Down

0 comments on commit 2750c09

Please sign in to comment.