Skip to content

Commit

Permalink
Use shared route validation and defaulting from library-go.
Browse files Browse the repository at this point in the history
  • Loading branch information
benluddy committed Oct 26, 2022
1 parent 503fdac commit aae527d
Show file tree
Hide file tree
Showing 16 changed files with 425 additions and 2,405 deletions.
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,5 @@ replace (
k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.25.2
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.25.2
)

replace github.com/openshift/library-go => github.com/benluddy/library-go v0.0.0-20221026132936-f03310f6a532
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ github.com/aws/aws-sdk-go v1.38.49/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2z
github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/benluddy/library-go v0.0.0-20221026132936-f03310f6a532 h1:YuXoj0JEwIVTtmrhhDkajdR7Pudsc3I9AhNhyKPOd00=
github.com/benluddy/library-go v0.0.0-20221026132936-f03310f6a532/go.mod h1:KPBAXGaq7pPmA+1wUVtKr5Axg3R68IomWDkzaOxIhxM=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
Expand Down Expand Up @@ -974,8 +976,6 @@ github.com/openshift/docker-distribution v0.0.0-20180925154709-d4c35485a70d h1:t
github.com/openshift/docker-distribution v0.0.0-20180925154709-d4c35485a70d/go.mod h1:XmfFzbwryblvZ29NebonirM7RBuNEO7+yVCOapaouAk=
github.com/openshift/kubernetes-apiserver v0.0.0-20221007080208-eb103c661ea4 h1:Xyqz395I3zystaGjouZPzeV/u6TOhdFUTZZfINkjKb8=
github.com/openshift/kubernetes-apiserver v0.0.0-20221007080208-eb103c661ea4/go.mod h1:30r7xyQTREWCkG2uSjgjhQcKVvAAlqoD+YyrqR6Cn+I=
github.com/openshift/library-go v0.0.0-20221019150005-7eb80051883f h1:D02A0d49BqUjhrH1DwCIKrtG3dyVEsncO8u5hqVz1t4=
github.com/openshift/library-go v0.0.0-20221019150005-7eb80051883f/go.mod h1:KPBAXGaq7pPmA+1wUVtKr5Axg3R68IomWDkzaOxIhxM=
github.com/openshift/moby-moby v0.0.0-20190308215630-da810a85109d h1:fLITXDjxMSvUDjnXs/zljIWktbST9+Om8XbrmmM7T4I=
github.com/openshift/moby-moby v0.0.0-20190308215630-da810a85109d/go.mod h1:LJM49W8fBVSj+rvcopJZu9mgH5Tx6HwLHySIYeGeu4k=
github.com/openshift/runtime-utils v0.0.0-20220926190846-5c488b20a19f h1:ubRzazPtplWWNWWX07v4ww74S9QL+B2RAxHJ8O00m7o=
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/openshift-apiserver/openshiftapiserver/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ import (
"github.com/openshift/library-go/pkg/apiserver/apiserverconfig"
"github.com/openshift/library-go/pkg/config/helpers"
"github.com/openshift/library-go/pkg/config/serving"
routehostassignment "github.com/openshift/library-go/pkg/route/hostassignment"
"github.com/openshift/openshift-apiserver/pkg/cmd/openshift-apiserver/openshiftadmission"
"github.com/openshift/openshift-apiserver/pkg/cmd/openshift-apiserver/openshiftapiserver/configprocessing"
"github.com/openshift/openshift-apiserver/pkg/image/apiserver/registryhostname"
"github.com/openshift/openshift-apiserver/pkg/route/apiserver/simplerouteallocation"
"github.com/openshift/openshift-apiserver/pkg/version"
)

Expand Down Expand Up @@ -214,7 +214,7 @@ func NewOpenshiftAPIConfig(config *openshiftcontrolplanev1.OpenShiftAPIServerCon
informers.GetKubernetesInformers().Rbac().V1(),
)

routeAllocator, err := simplerouteallocation.NewSimpleAllocationPlugin(config.RoutingConfig.Subdomain)
routeAllocator, err := routehostassignment.NewSimpleAllocationPlugin(config.RoutingConfig.Subdomain)
if err != nil {
return nil, err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
quotainformer "github.com/openshift/client-go/quota/informers/externalversions"
securityv1informer "github.com/openshift/client-go/security/informers/externalversions"
"github.com/openshift/library-go/pkg/quota/clusterquotamapping"
routehostassignment "github.com/openshift/library-go/pkg/route/hostassignment"
oappsapiserver "github.com/openshift/openshift-apiserver/pkg/apps/apiserver"
authorizationapiserver "github.com/openshift/openshift-apiserver/pkg/authorization/apiserver"
"github.com/openshift/openshift-apiserver/pkg/bootstrappolicy"
Expand All @@ -46,7 +47,6 @@ import (
projectcache "github.com/openshift/openshift-apiserver/pkg/project/cache"
quotaapiserver "github.com/openshift/openshift-apiserver/pkg/quota/apiserver"
routeapiserver "github.com/openshift/openshift-apiserver/pkg/route/apiserver"
"github.com/openshift/openshift-apiserver/pkg/route/apiserver/simplerouteallocation"
securityapiserver "github.com/openshift/openshift-apiserver/pkg/security/apiserver"
templateapiserver "github.com/openshift/openshift-apiserver/pkg/template/apiserver"
"github.com/openshift/openshift-apiserver/pkg/version"
Expand Down Expand Up @@ -78,7 +78,7 @@ type OpenshiftAPIExtraConfig struct {
MaxImagesBulkImportedPerRepository int
AdditionalTrustedCA []byte

RouteAllocator *simplerouteallocation.SimpleAllocationPlugin
RouteAllocator *routehostassignment.SimpleAllocationPlugin

ProjectAuthorizationCache *projectauth.AuthorizationCache
ProjectCache *projectcache.ProjectCache
Expand Down
Loading

0 comments on commit aae527d

Please sign in to comment.