utils

package
v0.0.0-...-a94344e Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Map

func Map(value interface{}) map[string]interface{}

func MapStrStr

func MapStrStr(value interface{}) map[string]string

func PatchPod

func PatchPod(ctx context.Context, k8sClient *kubernetes.Clientset, namespace, name string, option PatchOption) (*v1.Pod, error)

func String

func String(any interface{}) string

Types

type PatchOption

type PatchOption struct {
	Metadata struct {
		Annotations map[string]string `json:"annotations,omitempty"`
		Labels      map[string]string `json:"labels,omitempty"`
	} `json:"metadata"`
	Spec struct {
		Tolerations []v1.Toleration `json:"tolerations,omitempty"`
	} `json:"spec"`
}

func NewPatchOption

func NewPatchOption() *PatchOption

func (*PatchOption) WithAnnotations

func (o *PatchOption) WithAnnotations(annotations map[string]string) *PatchOption

func (*PatchOption) WithLabels

func (o *PatchOption) WithLabels(labels map[string]string) *PatchOption

func (*PatchOption) WithTolerations

func (o *PatchOption) WithTolerations(tolerations []v1.Toleration) *PatchOption

Jump to

Keyboard shortcuts

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