objectcreate

package
v1.12.7 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

README

Object Template Plugin

The rigdev.object_create creates a new arbitrary Kubernetes object from a YAML spec. The YAML spec must contain group, version and kind.

The config can be templated with standard Go templating and has

.capsule

If the name is empty, it defaults to the capsule name.

Example

Config:

config:
  pipeline:
    steps:
      - plugins:
          - plugin: rigdev.object_create
            config: |
              object: |
                apiVersion: vpcresources.k8s.aws/v1beta1
                kind: SecurityGroupPolicy
                spec:
                  podSelector:
                    matchLabels:
                      rig.dev/owned-by-capsule: {{ .capsule.metadata.name }}
                    securityGroups:
                      groupIds: {{ .capsule.metadata.annotations.groupIDs }}

The resulting Service resource of the Capsule, if the Capsule is named my-capsule and has groupIDs: [id1, id2] in its annotations:

apiVersion: vpcresources.k8s.aws/v1beta1
kind: SecurityGroupPolicy
metadata:
  name: my-capsule
spec:
  podSelector:
    matchLabels:
      rig.dev/owned-by-capsule: my-capsule
    securityGroups:
      groupIds: [id1, id2]

Config

Configuration for the object_create plugin

Field Description
object string The yaml to apply as an object. The yaml can be templated.

Documentation

Overview

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

Index

Constants

View Source
const Name = "rigdev.object_create"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// The yaml to apply as an object. The yaml can be templated.
	Object string `json:"object,omitempty"`
}

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

type Plugin

type Plugin struct {
	plugin.NoWatchObjectStatus
	// contains filtered or unexported fields
}

func (*Plugin) ComputeConfig added in v1.12.0

func (p *Plugin) ComputeConfig(ctx context.Context, req pipeline.CapsuleRequest, logger hclog.Logger) (string, error)

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