kube

package
v0.0.0-...-1f7aab1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKubeConfig

func GetKubeConfig(path string) (*rest.Config, error)

GetKubeConfig returns a Kubernetes configuration based on the provided path. If the path is empty, the function will try to use the in-cluster configuration or search for the kubeconfig in the default location.

Types

type Cluster

type Cluster struct {
	// Name is the name of the cluster.
	Name string
	// TargetNamespace is the namespace to watch for events.
	TargetNamespace string
}

type EnhancedEvent

type EnhancedEvent struct {
	corev1.Event `json:",inline"`
	ClusterName  string `json:"clusterName"`
}

EnhancedEvent is an event enriched with the cluster name and option to get the first occurrence timestamp in RFC3339 format. The enrichment with the cluster name allows to distinguish events from different clusters.

func (*EnhancedEvent) FirstOccurrence

func (ev *EnhancedEvent) FirstOccurrence() time.Time

func (*EnhancedEvent) GetRFC3339Timestamp

func (ev *EnhancedEvent) GetRFC3339Timestamp() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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