Skip to content
This repository was archived by the owner on Jul 10, 2024. It is now read-only.

Commit 9bfea7f

Browse files
committed
Delete unused function
1 parent 416839c commit 9bfea7f

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

cmd/internal/kube/util.go

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package kube
33
import (
44
"github.com/akitasoftware/akita-cli/cmd/internal/cmderr"
55
"github.com/pkg/errors"
6-
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
76
"os"
87
"path/filepath"
98
)
@@ -63,33 +62,3 @@ func createFile(path string) (*os.File, error) {
6362

6463
return outputFile, nil
6564
}
66-
67-
func mapUnstructured(
68-
root *unstructured.Unstructured,
69-
transformer func(*unstructured.Unstructured) (*unstructured.Unstructured, error),
70-
) (*unstructured.Unstructured, error) {
71-
if root == nil {
72-
return nil, nil
73-
}
74-
75-
if !root.IsList() {
76-
return transformer(root)
77-
}
78-
79-
list, err := root.ToList()
80-
if err != nil {
81-
return nil, err
82-
}
83-
84-
items := make([]unstructured.Unstructured, 0, len(list.Items))
85-
for _, item := range list.Items {
86-
transformed, err := transformer(&item)
87-
if err != nil {
88-
return nil, err
89-
}
90-
items = append(items, *transformed)
91-
}
92-
93-
list.Items = items
94-
return &unstructured.Unstructured{Object: list.Object}, nil
95-
}

0 commit comments

Comments
 (0)