Skip to content

Commit ebdfc93

Browse files
authored
Remove manifest only could apply default namesapce resource (#63)
1 parent 4609fe0 commit ebdfc93

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

internal/util/k8s.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ package util
2121
import (
2222
"bytes"
2323
"context"
24-
"fmt"
2524
"io/ioutil"
2625
"os"
2726
"path/filepath"
@@ -146,10 +145,6 @@ func OperateManifest(c *kubernetes.Clientset, dc dynamic.Interface, manifest str
146145

147146
var dri dynamic.ResourceInterface
148147
if mapping.Scope.Name() == meta.RESTScopeNameNamespace {
149-
// constrict resources to the default namespace
150-
if unstructuredObj.GetNamespace() != "" && unstructuredObj.GetNamespace() != metav1.NamespaceDefault {
151-
return fmt.Errorf("all resources must in default namespace")
152-
}
153148
if unstructuredObj.GetNamespace() == "" {
154149
unstructuredObj.SetNamespace(metav1.NamespaceDefault)
155150
}

0 commit comments

Comments
 (0)