kubernetes

package
v0.0.0-...-d1d3f44 Latest Latest
Warning

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

Go to latest
Published: May 15, 2019 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const GIN = "[GIN]"
View Source
const (
	KiamConfig = "kiam-config"
)

Variables

This section is empty.

Functions

func Client

func Client() *kubernetes.Clientset

func FindTokenVolumeName

func FindTokenVolumeName(volumes []corev1.Volume) string

func FindVolumeMount

func FindVolumeMount(volumes []corev1.VolumeMount, name string) corev1.VolumeMount

func GetAnnotationValue

func GetAnnotationValue(pod corev1.Pod, name *registeredAnnotation, defaultValue string) string

func GetDeploymentName

func GetDeploymentName(name string) (string, error)

func InitLogrus

func InitLogrus(engine *gin.Engine)

func Load

func Load(file string, c interface{})

func Log

func Log() *logrus.Logger

func LoggerWithLogrus

func LoggerWithLogrus(log *logrus.Logger) gin.HandlerFunc

func Pod

func Pod(raw []byte, pod *corev1.Pod) error

func PotentialNamespace

func PotentialNamespace(req *v1beta1.AdmissionRequest, pod *corev1.Pod) string

func PotentialPodName

func PotentialPodName(metadata *metav1.ObjectMeta) string

Deal with potential empty fields, e.g., when the pod is created by a deployment

func ToAdmissionResponse

func ToAdmissionResponse(err error) *v1beta1.AdmissionResponse

Types

type KiamData

type KiamData struct {
	Name      string
	Container corev1.Container
}

type KiamInject

type KiamInject struct {
	Annotations map[string]string
}

type PatchOperation

type PatchOperation struct {
	Op    string      `json:"op"`
	Path  string      `json:"path"`
	Value interface{} `json:"value,omitempty"`
}

type WebHook

type WebHook struct {
	Config     *WebHookConfig
	KiamConfig *KiamInject
}

func (*WebHook) Mutate

func (wk *WebHook) Mutate(context *gin.Context)

type WebHookConfig

type WebHookConfig struct {
	Template   string `json:"template"`
	KiamConfig string `json:"kiam-config"`
}

Jump to

Keyboard shortcuts

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