handler

package module
v0.0.0-...-1a1c726 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// ConfigmapEnvVarPostfix is a postfix for configmap envVar
	ConfigmapEnvVarPostfix = "CONFIGMAP"
	// SecretEnvVarPostfix is a postfix for secret envVar
	SecretEnvVarPostfix = "SECRET"
)

Variables

This section is empty.

Functions

func CanBeStarted

func CanBeStarted(deployment apps_v1.Deployment, clientSet kubernetes.Interface) bool

func ConfigMapExists

func ConfigMapExists(name string, clientSet kubernetes.Interface, namespace string) bool

func GetConfigMap

func GetConfigMap(name string, clientSet kubernetes.Interface, namespace string) (*v1.ConfigMap, error)

func GetDeploymentAnnotations

func GetDeploymentAnnotations(item interface{}) map[string]string

GetDeploymentAnnotations returns the annotations of given deployment

func GetDeploymentContainers

func GetDeploymentContainers(item interface{}) []v1.Container

GetDeploymentContainers returns the containers of given deployment

func GetDeploymentInitContainers

func GetDeploymentInitContainers(item interface{}) []v1.Container

GetDeploymentInitContainers returns the containers of given deployment

func GetDeploymentItems

func GetDeploymentItems(clientset kubernetes.Interface, namespace string, labelSelector string) []interface{}

GetDeploymentItems returns the deployments in given namespace

func GetDeploymentPodAnnotations

func GetDeploymentPodAnnotations(item interface{}) map[string]string

GetDeploymentPodAnnotations returns the pod's annotations of given deployment

func GetDeploymentVolumes

func GetDeploymentVolumes(item interface{}) []v1.Volume

GetDeploymentVolumes returns the Volumes of given deployment

func GetDeploymentsReferencingCm

func GetDeploymentsReferencingCm(clientSet kubernetes.Interface, configMapName string, namespace string, labelSelector string) ([]apps_v1.Deployment, error)

func GetReferencedConfigMaps

func GetReferencedConfigMaps(container v1.Container) []string

Does not return config maps whose only use is marked "optional"

func ReloadDeployment

func ReloadDeployment(deployment apps_v1.Deployment, clientSet kubernetes.Interface) error

Won't do anything for replicas that are scaled down

func ScaleDeployment

func ScaleDeployment(command ScaleCommand) error

func UpdateDeployment

func UpdateDeployment(clientset kubernetes.Interface, namespace string, labelSelector string, resource interface{}) error

UpdateDeployment performs rolling upgrade on deployment

Types

type AnnotationsFunc

type AnnotationsFunc func(interface{}) map[string]string

AnnotationsFunc is a generic func to return annotations

type Config

type Config struct {
	Namespace string
	Name      string
	SHAValue  string
	Type      string
}

Config contains rolling upgrade configuration parameters

type ContainersFunc

type ContainersFunc func(interface{}) []v1.Container

ContainersFunc is a generic func to return containers

type InitContainersFunc

type InitContainersFunc func(interface{}) []v1.Container

InitContainersFunc is a generic func to return containers

type ItemsFunc

type ItemsFunc func(kubernetes.Interface, string, string) []interface{}

ItemsFunc is a generic function to return a specific resource array in given namespace

type PodAnnotationsFunc

type PodAnnotationsFunc func(interface{}) map[string]string

PodAnnotationsFunc is a generic func to return annotations

type ScaleCommand

type ScaleCommand struct {
	ClientSet       kubernetes.Interface
	Namespace       string
	DeploymentName  string
	DesiredReplicas int32
}

type UpdateFunc

type UpdateFunc func(kubernetes.Interface, string, string, interface{}) error

UpdateFunc performs the resource update

type VolumesFunc

type VolumesFunc func(interface{}) []v1.Volume

VolumesFunc is a generic func to return volumes

Jump to

Keyboard shortcuts

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