resourcemodifiers

package
v1.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

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

View Source
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 added in v1.12.2

type JSONMergePatch struct {
	PatchData string `json:"patchData,omitempty"`
}

type JSONMergePatcher added in v1.12.2

type JSONMergePatcher struct {
	// contains filtered or unexported fields
}

func (*JSONMergePatcher) Patch added in v1.12.2

type JSONPatch

type JSONPatch struct {
	Operation string `json:"operation"`
	From      string `json:"from,omitempty"`
	Path      string `json:"path"`
	Value     string `json:"value,omitempty"`
}

func (*JSONPatch) ToString

func (p *JSONPatch) ToString() string

func (*JSONPatch) Validate

func (p *JSONPatch) Validate() error

type JSONPatcher added in v1.12.2

type JSONPatcher struct {
	// contains filtered or unexported fields
}

func (*JSONPatcher) Patch added in v1.12.2

type MatchRule added in v1.12.2

type MatchRule struct {
	Path  string `json:"path,omitempty"`
	Value string `json:"value,omitempty"`
}

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 added in v1.12.2

type StrategicMergePatch struct {
	PatchData string `json:"patchData,omitempty"`
}

type StrategicMergePatcher added in v1.12.2

type StrategicMergePatcher struct {
	// contains filtered or unexported fields
}

func (*StrategicMergePatcher) Patch added in v1.12.2

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL