Documentation ¶
Overview ¶
Copyright The Velero Contributors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright The Velero Contributors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
const ( ConfigmapRefType = "configmap" ResourceModifierSupportedVersionV1 = "v1" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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"` Matches []MatchRule `json:"matches,omitempty"` }
func (*Conditions) Validate ¶
func (c *Conditions) Validate() error
type JSONMergePatch ¶
type JSONMergePatch struct {
PatchData string `json:"patchData,omitempty"`
}
type JSONMergePatcher ¶
type JSONMergePatcher struct {
// contains filtered or unexported fields
}
func (*JSONMergePatcher) Patch ¶
func (p *JSONMergePatcher) Patch(u *unstructured.Unstructured, _ logrus.FieldLogger) (*unstructured.Unstructured, error)
type JSONPatch ¶
type JSONPatcher ¶
type JSONPatcher struct {
// contains filtered or unexported fields
}
func (*JSONPatcher) Patch ¶
func (p *JSONPatcher) Patch(u *unstructured.Unstructured, logger logrus.FieldLogger) (*unstructured.Unstructured, error)
type ResourceModifierRule ¶
type ResourceModifierRule struct { Conditions Conditions `json:"conditions"` Patches []JSONPatch `json:"patches,omitempty"` MergePatches []JSONMergePatch `json:"mergePatches,omitempty"` StrategicPatches []StrategicMergePatch `json:"strategicPatches,omitempty"` }
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, scheme *runtime.Scheme, log logrus.FieldLogger) []error
func (*ResourceModifiers) Validate ¶
func (p *ResourceModifiers) Validate() error
type StrategicMergePatch ¶
type StrategicMergePatch struct {
PatchData string `json:"patchData,omitempty"`
}
type StrategicMergePatcher ¶
type StrategicMergePatcher struct {
// contains filtered or unexported fields
}
func (*StrategicMergePatcher) Patch ¶
func (p *StrategicMergePatcher) Patch(u *unstructured.Unstructured, _ logrus.FieldLogger) (*unstructured.Unstructured, error)