mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
kubectl: Move utility functions to util package
`parseFileSource()` and `parseLiteralSource()` are utility functions. We have a package already for utility functions, `kubectl/util/`. Move utility functions to `kubectl/util`, capitalize function names to export from package.
This commit is contained in:
@@ -26,6 +26,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/util/validation"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/kubectl/util"
|
||||
"k8s.io/kubernetes/pkg/kubectl/util/hash"
|
||||
)
|
||||
|
||||
@@ -173,7 +174,7 @@ func (s SecretGeneratorV1) validate() error {
|
||||
// handleFromLiteralSources adds the specified literal source information into the provided secret
|
||||
func handleFromLiteralSources(secret *api.Secret, literalSources []string) error {
|
||||
for _, literalSource := range literalSources {
|
||||
keyName, value, err := parseLiteralSource(literalSource)
|
||||
keyName, value, err := util.ParseLiteralSource(literalSource)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -187,7 +188,7 @@ func handleFromLiteralSources(secret *api.Secret, literalSources []string) error
|
||||
// handleFromFileSources adds the specified file source information into the provided secret
|
||||
func handleFromFileSources(secret *api.Secret, fileSources []string) error {
|
||||
for _, fileSource := range fileSources {
|
||||
keyName, filePath, err := parseFileSource(fileSource)
|
||||
keyName, filePath, err := util.ParseFileSource(fileSource)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user