Skip to content

Commit fa14a79

Browse files
author
Kubernetes Submit Queue
authored
Merge pull request kubernetes#61099 from hanxiaoshuai/cleanup0313
Automatic merge from submit-queue (batch tested with PRs 60519, 61099, 61218, 61166, 61714). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. remove unused func NewNamespacedNameFromString **What this PR does / why we need it**: remove unused func NewNamespacedNameFromString since v1.8.0 **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
2 parents 71050b6 + 04862d7 commit fa14a79

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

staging/src/k8s.io/apimachinery/pkg/types/namespacedname.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package types
1818

1919
import (
2020
"fmt"
21-
"strings"
2221
)
2322

2423
// NamespacedName comprises a resource name, with a mandatory namespace,
@@ -42,19 +41,3 @@ const (
4241
func (n NamespacedName) String() string {
4342
return fmt.Sprintf("%s%c%s", n.Namespace, Separator, n.Name)
4443
}
45-
46-
// NewNamespacedNameFromString parses the provided string and returns a NamespacedName.
47-
// The expected format is as per String() above.
48-
// If the input string is invalid, the returned NamespacedName has all empty string field values.
49-
// This allows a single-value return from this function, while still allowing error checks in the caller.
50-
// Note that an input string which does not include exactly one Separator is not a valid input (as it could never
51-
// have neem returned by String() )
52-
func NewNamespacedNameFromString(s string) NamespacedName {
53-
nn := NamespacedName{}
54-
result := strings.Split(s, string(Separator))
55-
if len(result) == 2 {
56-
nn.Namespace = result[0]
57-
nn.Name = result[1]
58-
}
59-
return nn
60-
}

0 commit comments

Comments
 (0)