This repository was archived by the owner on Jul 10, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +0
-31
lines changed Expand file tree Collapse file tree 1 file changed +0
-31
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ package kube
33import (
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- }
You can’t perform that action at this time.
0 commit comments