Documentation
¶
Index ¶
- Variables
- func MatchesObject(obj Object, selector types.Selector) (bool, error)
- func SelectorFromObject(o Object) types.Selector
- func SelectorFromTarget(t Target) types.Selector
- func ValidateObject(o Object) error
- type JsonPatch
- type Object
- type ObjectStore
- func (s *ObjectStore) AddObject(yamlBytes []byte) error
- func (s *ObjectStore) AddObjectFromPath(path string) error
- func (s *ObjectStore) AddObjectFromURL(url string) error
- func (s *ObjectStore) AddObjectsFromDir(path string) error
- func (s *ObjectStore) FilterByKind(kind string) (ObjectStore, error)
- func (s *ObjectStore) JsonPatch(p []byte, t Target) error
- func (s *ObjectStore) Print(sort bool) error
- func (s *ObjectStore) StrategicPatch(p Object, t Target) error
- type Target
Constants ¶
This section is empty.
Variables ¶
View Source
var KindOrder = []string{
"Namespace",
"NetworkPolicy",
"ResourceQuota",
"LimitRange",
"PodSecurityPolicy",
"PodDisruptionBudget",
"ServiceAccount",
"Secret",
"SecretList",
"ConfigMap",
"StorageClass",
"PersistentVolume",
"PersistentVolumeClaim",
"CustomResourceDefinition",
"ClusterRole",
"ClusterRoleList",
"ClusterRoleBinding",
"ClusterRoleBindingList",
"Role",
"RoleList",
"RoleBinding",
"RoleBindingList",
"Service",
"DaemonSet",
"Pod",
"ReplicationController",
"ReplicaSet",
"Deployment",
"HorizontalPodAutoscaler",
"StatefulSet",
"Job",
"CronJob",
"IngressClass",
"Ingress",
"APIService",
}
Functions ¶
func SelectorFromObject ¶
func SelectorFromTarget ¶
func ValidateObject ¶
Validate that the Object has a few required fields set
Types ¶
type JsonPatch ¶
type JsonPatch struct { YamlPatch interface{} `yaml:"patch"` Patch json.RawMessage `json:"patch" yaml:"-"` Target Target `json:"target" yaml:"target"` }
type ObjectStore ¶
type ObjectStore []Object
func (*ObjectStore) AddObject ¶
func (s *ObjectStore) AddObject(yamlBytes []byte) error
Add object to store
func (*ObjectStore) AddObjectFromPath ¶
func (s *ObjectStore) AddObjectFromPath(path string) error
Read Object from Path
func (*ObjectStore) AddObjectFromURL ¶
func (s *ObjectStore) AddObjectFromURL(url string) error
Read Object from a URL
func (*ObjectStore) AddObjectsFromDir ¶
func (s *ObjectStore) AddObjectsFromDir(path string) error
Read Object/s from a Directory
func (*ObjectStore) FilterByKind ¶
func (s *ObjectStore) FilterByKind(kind string) (ObjectStore, error)
Filter ObjectStore by kind
func (*ObjectStore) JsonPatch ¶
func (s *ObjectStore) JsonPatch(p []byte, t Target) error
JsonPatch applies a json patch to selected Objects in the store.
func (*ObjectStore) StrategicPatch ¶
func (s *ObjectStore) StrategicPatch(p Object, t Target) error
StrategicPatch applies a strategic patch to selected Objects in the store.
type Target ¶
type Target struct { Group string `json:"group" yaml:"group"` Version string `json:"version" yaml:"version"` Kind string `json:"kind" yaml:"kind"` Name string `json:"name" yaml:"name"` Namespace string `json:"namespace" yaml:"namespace"` AnnotationSelector string `json:"annotationSelector" yaml:"annotationSelector"` LabelSelector string `json:"labelSelector" yaml:"labelSelector"` }
Click to show internal directories.
Click to hide internal directories.