mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #20730 from deads2k/add-string-for-debug
Auto commit by PR queue bot
This commit is contained in:
commit
1f113d6a38
@ -83,6 +83,10 @@ type DefaultRESTMapper struct {
|
|||||||
interfacesFunc VersionInterfacesFunc
|
interfacesFunc VersionInterfacesFunc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *DefaultRESTMapper) String() string {
|
||||||
|
return fmt.Sprintf("DefaultRESTMapper{kindToPluralResource=%v}", m.kindToPluralResource)
|
||||||
|
}
|
||||||
|
|
||||||
var _ RESTMapper = &DefaultRESTMapper{}
|
var _ RESTMapper = &DefaultRESTMapper{}
|
||||||
|
|
||||||
// VersionInterfacesFunc returns the appropriate typer, and metadata accessor for a
|
// VersionInterfacesFunc returns the appropriate typer, and metadata accessor for a
|
||||||
@ -511,6 +515,17 @@ func (m *DefaultRESTMapper) ResourceIsValid(resource unversioned.GroupVersionRes
|
|||||||
// MultiRESTMapper is a wrapper for multiple RESTMappers.
|
// MultiRESTMapper is a wrapper for multiple RESTMappers.
|
||||||
type MultiRESTMapper []RESTMapper
|
type MultiRESTMapper []RESTMapper
|
||||||
|
|
||||||
|
func (m MultiRESTMapper) String() string {
|
||||||
|
nested := []string{}
|
||||||
|
for _, t := range m {
|
||||||
|
currString := fmt.Sprintf("%v", t)
|
||||||
|
splitStrings := strings.Split(currString, "\n")
|
||||||
|
nested = append(nested, strings.Join(splitStrings, "\n\t"))
|
||||||
|
}
|
||||||
|
|
||||||
|
return fmt.Sprintf("MultiRESTMapper{\n\t%s\n}", strings.Join(nested, "\n\t"))
|
||||||
|
}
|
||||||
|
|
||||||
// ResourceSingularizer converts a REST resource name from plural to singular (e.g., from pods to pod)
|
// ResourceSingularizer converts a REST resource name from plural to singular (e.g., from pods to pod)
|
||||||
// This implementation supports multiple REST schemas and return the first match.
|
// This implementation supports multiple REST schemas and return the first match.
|
||||||
func (m MultiRESTMapper) ResourceSingularizer(resource string) (singular string, err error) {
|
func (m MultiRESTMapper) ResourceSingularizer(resource string) (singular string, err error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user