🌟 add support of workspace networkpolicy
This commit is contained in:
12
pkg/controller/network/testing/util.go
Normal file
12
pkg/controller/network/testing/util.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package testing
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"k8s.io/apimachinery/pkg/util/yaml"
|
||||
)
|
||||
|
||||
func StringToObject(data string, obj interface{}) error {
|
||||
reader := strings.NewReader(data)
|
||||
return yaml.NewYAMLOrJSONDecoder(reader, 10).Decode(obj)
|
||||
}
|
||||
Reference in New Issue
Block a user