kube

package
v0.0.0-...-465b952 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ManagerPlaneName          = "eventexporter-manager-plane"
	ManagerPlaneClusterClient api.MingleClient
)

Functions

func GetGKindVersion

func GetGKindVersion(reference *corev1.ObjectReference) (schema.GroupKind, string)

func InitManagerPlaneClusterClient

func InitManagerPlaneClusterClient(ctx context.Context) (err error)

InitManagerPlaneClusterClient build manager-plane cluster client default use current env kubeconfig TODO: support kubeconfig configuration

func TransformRuntimeObjToUnstructured

func TransformRuntimeObjToUnstructured(obj runtime.Object) (*unstructured.Unstructured, error)

Types

type EnhancedEvent

type EnhancedEvent struct {
	corev1.Event   `json:",inline"`
	InvolvedObject EnhancedObjectReference `json:"involvedObject"`
}

func (*EnhancedEvent) GetTimestampMs

func (e *EnhancedEvent) GetTimestampMs() int64

func (*EnhancedEvent) ToJSON

func (e *EnhancedEvent) ToJSON() []byte

ToJSON does not return an error because we are %99 confident it is JSON serializable. TODO(makin) Is it a bad practice? It's open to discussion.

type EnhancedObjectReference

type EnhancedObjectReference struct {
	Labels      map[string]string `json:"labels,omitempty"`
	Annotations map[string]string `json:"annotations,omitempty"`
	ClusterName string            `json:"clusterName,omitempty"`
}

type MetadataHandler

type MetadataHandler struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewMetadataHandler

func NewMetadataHandler(ctx context.Context, cli api.MingleClient) *MetadataHandler

func (*MetadataHandler) GetAnnotations

func (m *MetadataHandler) GetAnnotations(reference *corev1.ObjectReference) (map[string]string, error)

func (*MetadataHandler) GetLabels

func (m *MetadataHandler) GetLabels(reference *corev1.ObjectReference) (map[string]string, error)

func (*MetadataHandler) GetlabelsAndAnnotations

func (m *MetadataHandler) GetlabelsAndAnnotations(reference *corev1.ObjectReference) (labels map[string]string, annotations map[string]string, err error)

Jump to

Keyboard shortcuts

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