generator

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Overview

generator package provide an interface for creating custom resources from the provided one. It also contains some premade generator that can be used as is.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	// CanHandleResource will be called to check if calling the Generate function
	CanHandleResource(*metav1.PartialObjectMetadata) bool
	// Generate receive a resource and return an array of new resources or an error
	Generate(*unstructured.Unstructured, cache.RemoteResourceGetter) ([]*unstructured.Unstructured, error)
}

Interface defines the interface for a generator that can create new resources based on another

func NewJobGenerator

func NewJobGenerator(annotation string, value string) Interface

NewJobGenerator return a new generator.Interface that will create a Job from a CronJob mimicking the function of 'kubectl create job --from cronjob/'. It will done that only on CronJobs that will have a certain value in an annotation.

Jump to

Keyboard shortcuts

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