Dmitry Ukov 6c716e1a57 Add replacement transformer
* Replace paramter specified by JSON path with predefined value or
  with the value from another resource
* Replace substring in a paramter specified by JSON path with predefined
  value or with the value from another resource

Transformer copied from
https://github.com/mattmceuen/kustomize/tree/substring-subst

Closes: #174
Change-Id: I3a958a0df724fb2eb81bb199a02cf1db81bb0d2f
Co-Authored-By: Matt McEuen <matt.mceuen@att.com>
2020-04-22 11:51:05 +04:00

28 lines
952 B
Go

/*
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
https://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.
*/
package replacement
import (
"k8s.io/apimachinery/pkg/runtime/schema"
replv1alpha1 "opendev.org/airship/airshipctl/pkg/document/plugin/replacement/v1alpha1"
"opendev.org/airship/airshipctl/pkg/document/plugin/types"
)
// RegisterPlugin registers BareMetalHost generator plugin
func RegisterPlugin(registry map[schema.GroupVersionKind]types.Factory) {
registry[replv1alpha1.GetGVK()] = replv1alpha1.New
}