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 `json:"namespaces,omitempty"` GroupResource string `json:"groupResource"` ResourceNameRegex string `json:"resourceNameRegex,omitempty"` LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"` }
func (*Conditions) Validate ¶
func (c *Conditions) Validate() error
type JSONPatch ¶
type ResourceModifierRule ¶
type ResourceModifierRule struct { Conditions Conditions `json:"conditions"` Patches []JSONPatch `json:"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)
PatchArrayToByteArray converts 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 `json:"version"` ResourceModifierRules []ResourceModifierRule `json:"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.