mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-19 01:47:02 +00:00
17 lines
266 B
Go
17 lines
266 B
Go
package resource
|
|
|
|
import (
|
|
"sigs.k8s.io/yaml"
|
|
)
|
|
|
|
type Resource struct {
|
|
Path string
|
|
Bytes []byte
|
|
Err error
|
|
}
|
|
|
|
func (r Resource) AsMap() (map[string]interface{}, error) {
|
|
var res map[string]interface{}
|
|
err := yaml.Unmarshal(r.Bytes, &res)
|
|
return res, err
|
|
}
|