mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Merge pull request #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 ```
This commit is contained in:
commit
fa14a79d35
@ -18,7 +18,6 @@ package types
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// NamespacedName comprises a resource name, with a mandatory namespace,
|
||||
@ -42,19 +41,3 @@ const (
|
||||
func (n NamespacedName) String() string {
|
||||
return fmt.Sprintf("%s%c%s", n.Namespace, Separator, n.Name)
|
||||
}
|
||||
|
||||
// NewNamespacedNameFromString parses the provided string and returns a NamespacedName.
|
||||
// The expected format is as per String() above.
|
||||
// If the input string is invalid, the returned NamespacedName has all empty string field values.
|
||||
// This allows a single-value return from this function, while still allowing error checks in the caller.
|
||||
// Note that an input string which does not include exactly one Separator is not a valid input (as it could never
|
||||
// have neem returned by String() )
|
||||
func NewNamespacedNameFromString(s string) NamespacedName {
|
||||
nn := NamespacedName{}
|
||||
result := strings.Split(s, string(Separator))
|
||||
if len(result) == 2 {
|
||||
nn.Namespace = result[0]
|
||||
nn.Name = result[1]
|
||||
}
|
||||
return nn
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user