util

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCronJob

func CreateCronJob(jobmergedata JobMergeData) (batchv1beta1.CronJob, error)

CreateCronJob returns a Job type from a template merge data

func CreateJob

func CreateJob(jobmergedata JobMergeData) (batch.Job, error)

CreateJob returns a Job type from a template merge data

func InitializeTemplates

func InitializeTemplates(jobTemplateFileName string, cronJobTemplateFileName string) error

InitializeTemplates initializes the templates needed by this controller, it must be called at controller boot time

Types

type JobMergeData

type JobMergeData struct {
	Config v1alpha1.GitOpsConfig `json:"config,omitempty"`

	// Action can be create, delete
	Action string `json:"action,omitempty"`
}

JobMergeData is the structs that will be used to merge with the job template

type NN added in v0.1.4

type NN = types.NamespacedName

NN is a shorthand alias for types.NamespacedName. It is intended to help reduce "visual stutter" when specifying NamespacedName structs, while retaining all the information. For example, function calls that require a types.NamespacedName can now be written in a way somewhat resembling "named arguments" syntax from other programming languages:

someFunc(..., util.NN{Name: "foobar", Namespace: "barfoo"}, ...)

compared to sample code it's intended to replace:

someFunc(..., types.NamespacedName{Name: "foobar", Namespace: "barfoo"}, ...)

func GetNN added in v0.1.4

func GetNN(obj NameNamespacer) NN

GetNN retrieves name & namespace from obj and wraps them in an NN object.

type NameNamespacer added in v0.1.4

type NameNamespacer interface {
	GetNamespace() string
	GetName() string
}

NameNamespacer is an interface for objects which provide functions retrieving name and namespace in a way common in kubernetes API.

Jump to

Keyboard shortcuts

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