Remove unused selflink parameters from ContextBasedNaming

Kubernetes-commit: 1e0b9c6e20a07f706e7ace39f417ea746fa05a3b
This commit is contained in:
Wojciech Tyczyński 2022-01-14 10:00:04 +01:00 committed by Kubernetes Publisher
parent 5e8e1ff118
commit 8268596b30
2 changed files with 4 additions and 12 deletions

View File

@ -41,9 +41,6 @@ type ScopeNamer interface {
type ContextBasedNaming struct { type ContextBasedNaming struct {
Namer runtime.Namer Namer runtime.Namer
ClusterScoped bool ClusterScoped bool
SelfLinkPathPrefix string
SelfLinkPathSuffix string
} }
// ContextBasedNaming implements ScopeNamer // ContextBasedNaming implements ScopeNamer

View File

@ -19,7 +19,6 @@ package endpoints
import ( import (
"fmt" "fmt"
"net/http" "net/http"
gpath "path"
"reflect" "reflect"
"sort" "sort"
"strings" "strings"
@ -428,10 +427,8 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
apiResource.Namespaced = false apiResource.Namespaced = false
apiResource.Kind = resourceKind apiResource.Kind = resourceKind
namer := handlers.ContextBasedNaming{ namer := handlers.ContextBasedNaming{
Namer: a.group.Namer, Namer: a.group.Namer,
ClusterScoped: true, ClusterScoped: true,
SelfLinkPathPrefix: gpath.Join(a.prefix, resource) + "/",
SelfLinkPathSuffix: suffix,
} }
// Handler for standard REST verbs (GET, PUT, POST and DELETE). // Handler for standard REST verbs (GET, PUT, POST and DELETE).
@ -477,10 +474,8 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
apiResource.Namespaced = true apiResource.Namespaced = true
apiResource.Kind = resourceKind apiResource.Kind = resourceKind
namer := handlers.ContextBasedNaming{ namer := handlers.ContextBasedNaming{
Namer: a.group.Namer, Namer: a.group.Namer,
ClusterScoped: false, ClusterScoped: false,
SelfLinkPathPrefix: gpath.Join(a.prefix, namespaceParamName) + "/",
SelfLinkPathSuffix: itemPathSuffix,
} }
actions = appendIf(actions, action{"LIST", resourcePath, resourceParams, namer, false}, isLister) actions = appendIf(actions, action{"LIST", resourcePath, resourceParams, namer, false}, isLister)