Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure openapi v3 #1551

Merged
merged 1 commit into from
Jan 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions pkg/cmds/server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,7 @@ func (o StashOptions) Config() (*server.StashConfig, error) {
// Fixes https://github.com/Azure/AKS/issues/522
clientcmd.Fix(serverConfig.ClientConfig)

serverConfig.OpenAPIConfig = genericapiserver.DefaultOpenAPIConfig(v1alpha1.GetOpenAPIDefinitions, openapinamer.NewDefinitionNamer(server.Scheme))
serverConfig.OpenAPIConfig.Info.Title = "stash-operator"
serverConfig.OpenAPIConfig.Info.Version = v1alpha1.SchemeGroupVersion.Version
serverConfig.OpenAPIConfig.IgnorePrefixes = []string{
ignorePrefixes := []string{
"/swaggerapi",
"/apis/admission.stash.appscode.com/v1alpha1",
"/apis/admission.stash.appscode.com/v1alpha1/resticvalidators",
Expand All @@ -112,6 +109,16 @@ func (o StashOptions) Config() (*server.StashConfig, error) {
"/apis/admission.stash.appscode.com/v1beta1/backupconfigurationvalidators",
}

serverConfig.OpenAPIConfig = genericapiserver.DefaultOpenAPIConfig(v1alpha1.GetOpenAPIDefinitions, openapinamer.NewDefinitionNamer(server.Scheme))
serverConfig.OpenAPIConfig.Info.Title = "stash-webhook-server"
serverConfig.OpenAPIConfig.Info.Version = v1alpha1.SchemeGroupVersion.Version
serverConfig.OpenAPIConfig.IgnorePrefixes = ignorePrefixes

serverConfig.OpenAPIV3Config = genericapiserver.DefaultOpenAPIV3Config(v1alpha1.GetOpenAPIDefinitions, openapinamer.NewDefinitionNamer(server.Scheme))
serverConfig.OpenAPIV3Config.Info.Title = "stash-webhook-server"
serverConfig.OpenAPIV3Config.Info.Version = v1alpha1.SchemeGroupVersion.Version
serverConfig.OpenAPIV3Config.IgnorePrefixes = ignorePrefixes

extraConfig := controller.NewConfig(serverConfig.ClientConfig)
if err := o.ExtraOptions.ApplyTo(extraConfig); err != nil {
return nil, err
Expand Down
Loading