Documentation ¶
Index ¶
Constants ¶
View Source
const ( ConfigmapRefType = "configmap" ResourceModifierSupportedVersionV1 = "v1" )
Variables ¶
This section is empty.
Functions ¶
func ApplyPatch ¶
func ApplyPatch(patch []byte, obj *unstructured.Unstructured, log logrus.FieldLogger) error
Types ¶
type Conditions ¶
type Conditions struct { Namespaces []string `yaml:"namespaces,omitempty"` GroupKind string `yaml:"groupKind"` ResourceNameRegex string `yaml:"resourceNameRegex"` }
func (*Conditions) Validate ¶
func (c *Conditions) Validate() error
type JSONPatch ¶
type ResourceModifierRule ¶
type ResourceModifierRule struct { Conditions Conditions `yaml:"conditions"` Patches []JSONPatch `yaml:"patches"` }
func (*ResourceModifierRule) Apply ¶
func (r *ResourceModifierRule) Apply(obj *unstructured.Unstructured, groupResource string, log logrus.FieldLogger) error
func (*ResourceModifierRule) PatchArrayToByteArray ¶
func (r *ResourceModifierRule) PatchArrayToByteArray() ([]byte, error)
convert all JsonPatch to string array with the format of jsonpatch.Patch and then convert it to byte array
func (*ResourceModifierRule) Validate ¶
func (r *ResourceModifierRule) Validate() error
type ResourceModifiers ¶
type ResourceModifiers struct { Version string `yaml:"version"` ResourceModifierRules []ResourceModifierRule `yaml:"resourceModifierRules"` }
func GetResourceModifiersFromConfig ¶
func GetResourceModifiersFromConfig(cm *v1.ConfigMap) (*ResourceModifiers, error)
func (*ResourceModifiers) ApplyResourceModifierRules ¶
func (p *ResourceModifiers) ApplyResourceModifierRules(obj *unstructured.Unstructured, groupResource string, log logrus.FieldLogger) []error
func (*ResourceModifiers) Validate ¶
func (p *ResourceModifiers) Validate() error
Click to show internal directories.
Click to hide internal directories.