Skip to content

Commit

Permalink
Revert "Merge pull request openshift#43 from deads2k/authz"
Browse files Browse the repository at this point in the history
This reverts commit 794f9de, reversing
changes made to 6ea3294.
  • Loading branch information
Prashant Balachandran committed Sep 20, 2021
1 parent 58e0929 commit 2210006
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 131 deletions.
8 changes: 2 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ import (

"github.com/brancz/kube-rbac-proxy/pkg/authn"
"github.com/brancz/kube-rbac-proxy/pkg/authz"
"github.com/brancz/kube-rbac-proxy/pkg/hardcodedauthorizer"
"github.com/brancz/kube-rbac-proxy/pkg/proxy"
rbac_proxy_tls "github.com/brancz/kube-rbac-proxy/pkg/tls"
)
Expand Down Expand Up @@ -192,7 +191,6 @@ func main() {

sarClient := kubeClient.AuthorizationV1().SubjectAccessReviews()
sarAuthorizer, err := authz.NewSarAuthorizer(sarClient)

if err != nil {
klog.Fatalf("Failed to create sar authorizer: %v", err)
}
Expand All @@ -205,8 +203,6 @@ func main() {
authorizer := union.New(
// prefix the authorizer with the permissions for metrics scraping which are well known.
// openshift RBAC policy will always allow this user to read metrics.
// TODO: remove this, once CMO lands static authorizer configuration.
hardcodedauthorizer.NewHardCodedMetricsAuthorizer(),
staticAuthorizer,
sarAuthorizer,
)
Expand Down Expand Up @@ -416,14 +412,14 @@ func initKubeConfig(kcLocation string) *rest.Config {
if kcLocation != "" {
kubeConfig, err := clientcmd.BuildConfigFromFlags("", kcLocation)
if err != nil {
klog.Fatalf("unable to build rest config based on provided path to kubeconfig file: %v", err)
klog.Fatalf("unable to build rest config based on provided path to kubeconfig file: %v",err)
}
return kubeConfig
}

kubeConfig, err := rest.InClusterConfig()
if err != nil {
klog.Fatalf("cannot find Service Account in pod to build in-cluster rest config: %v", err)
klog.Fatalf("cannot find Service Account in pod to build in-cluster rest config: %v",err)
}

return kubeConfig
Expand Down
58 changes: 0 additions & 58 deletions pkg/hardcodedauthorizer/metrics.go

This file was deleted.

67 changes: 0 additions & 67 deletions pkg/hardcodedauthorizer/metrics_test.go

This file was deleted.

0 comments on commit 2210006

Please sign in to comment.