common

package
v0.0.0-...-6081c8a Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TypeMetaConfigmap = metav1.TypeMeta{
		APIVersion: "v1",
		Kind:       "ConfigMap",
	}
	TypeMetaBatchJob = metav1.TypeMeta{
		APIVersion: "batch/v1",
		Kind:       "Job",
	}
	TypeMetaNetworkPolicy = metav1.TypeMeta{
		APIVersion: "networking.k8s.io/v1",
		Kind:       "NetworkPolicy",
	}
)

TODO(cw): find a better way to do this. Those values must exist in the appropriate places already.

View Source
var (
	DeploymentType = metav1.TypeMeta{
		APIVersion: "apps/v1",
		Kind:       "Deployment",
	}
	ServiceType = metav1.TypeMeta{
		APIVersion: "v1",
		Kind:       "Service",
	}
)

Functions

func DeploymentStrategy

func DeploymentStrategy(maxSurge, maxUnavailability int32) appsv1.DeploymentStrategy

func DropMetricsRelabeling

func DropMetricsRelabeling(ctx *RenderContext) []*monitoringv1.RelabelConfig

func ImageName

func ImageName(imageURL, tag string) string

func Labels

func Labels(name, component, app, version string) map[string]string

func ToPointer

func ToPointer[T any](o T) *T

Types

type HelmConfig

type HelmConfig struct {
	Enabled bool
	Values  *values.Options
}

type HelmFunc

type HelmFunc func(cfg *RenderContext) ([]string, error)

func CompositeHelmFunc

func CompositeHelmFunc(f ...HelmFunc) HelmFunc

type RenderContext

type RenderContext struct {
	Config    config.Config
	Namespace string
}

func NewRenderContext

func NewRenderContext(cfg config.Config, namespace string) (*RenderContext, error)

NewRenderContext constructor function to create a new RenderContext with the values generated

type RenderFunc

type RenderFunc func(cfg *RenderContext) ([]runtime.Object, error)

Renderable turns the config into a set of Kubernetes runtime objects

func CompositeRenderFunc

func CompositeRenderFunc(f ...RenderFunc) RenderFunc

type RuntimeObject

type RuntimeObject struct {
	metav1.TypeMeta `json:",inline"`
	Metadata        metav1.ObjectMeta `json:"metadata"`
	Content         string            `json:"-"`
}

func DependencySortingRenderFunc

func DependencySortingRenderFunc(objects []RuntimeObject) ([]RuntimeObject, error)

func YamlToRuntimeObject

func YamlToRuntimeObject(objects []string) ([]RuntimeObject, error)

Jump to

Keyboard shortcuts

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