objecttemplate

package
v1.8.17 Latest Latest
Warning

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

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

README

Object Template Plugin

The rigdev.object_template patches a YAML spec to a Kubernetes object defined by a Group, Kind and Name.

The config can be templated with standard Go templating and has

.capsule
.current

as its templating context where .current refers to the current version of the object being modified.

Example

Config (in context of the rig-operator Helm values):

config:
  pipeline:
    steps:
      - plugins:
        - name: rigdev.object_template
          config: |
            object: | 
              spec:
               externalName: some-name 
            group: core
            kind: Service
            name: {{ .capsule.metadata.name }}

The resulting Service resource of the Capsule, if the Capsule is named my-capsule

kind: Service
metadata:
  name: my-capsule
...
spec:
  externalName: some-name
  ...

Config

Configuration for the object_template plugin

Field Description
object string The yaml to apply to the object. The yaml can be templated.
group string Group to match, for which objects to apply the patch to.
kind string Kind to match, for which objects to apply the patch to.
name string Name of the object to match. Default to Capsule-name.

Documentation

Overview

+groupName=plugins.rig.dev -- Only used for config doc generation

Index

Constants

View Source
const Name = "rigdev.object_template"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// The yaml to apply to the object. The yaml can be templated.
	Object string `json:"object,omitempty"`
	// Group to match, for which objects to apply the patch to.
	Group string `json:"group,omitempty"`
	// Kind to match, for which objects to apply the patch to.
	Kind string `json:"kind,omitempty"`
	// Name of the object to match. Default to Capsule-name.
	Name string `json:"name,omitempty"`
}

Configuration for the object_template plugin +kubebuilder:object:root=true

type Plugin

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

func (*Plugin) Initialize

func (p *Plugin) Initialize(req plugin.InitializeRequest) error

func (*Plugin) Run

func (p *Plugin) Run(_ context.Context, req pipeline.CapsuleRequest, _ hclog.Logger) error

Jump to

Keyboard shortcuts

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