utils

package
v1.32.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MonitorDefinitionFields = []string{
	"name", "type", "query", "message", "tags", "options", "priority", "restricted_roles", "draft_status",
}

MonitorDefinitionFields are the top-level monitor fields that creates and updates set. State, timestamps and other server-managed fields are excluded so that only edits to the definition change the hash. DatadogMonitor tests check that this list matches the fields its update requests send.

Functions

func GetRequiredTags

func GetRequiredTags() []string

func GetTagsToAdd

func GetTagsToAdd(tags []string) []string

func MergeAffinity added in v1.32.0

func MergeAffinity(base, override *corev1.Affinity) (*corev1.Affinity, error)

MergeAffinity merges affinity fields, with override fields taking precedence.

func MergeEnv added in v1.32.0

func MergeEnv(base, override []corev1.EnvVar) []corev1.EnvVar

MergeEnv merges environment variables by name, with override values taking precedence.

func MergeStringMaps added in v1.32.0

func MergeStringMaps(values ...map[string]string) map[string]string

MergeStringMaps merges maps in order, with later values taking precedence.

func MergeTopologySpreadConstraints added in v1.32.0

func MergeTopologySpreadConstraints(base, override []corev1.TopologySpreadConstraint) []corev1.TopologySpreadConstraint

MergeTopologySpreadConstraints merges topology spread constraints by topology key and action.

func MergeVolumeMounts added in v1.32.0

func MergeVolumeMounts(base, override []corev1.VolumeMount) []corev1.VolumeMount

MergeVolumeMounts merges volume mounts by mount path, with override values taking precedence.

func MergeVolumes added in v1.32.0

func MergeVolumes(base, override []corev1.Volume) []corev1.Volume

MergeVolumes merges volumes by name, with override values taking precedence.

func MonitorDefinitionHash added in v1.32.0

func MonitorDefinitionHash(monitor datadogV1.Monitor, extraFields ...string) (string, error)

MonitorDefinitionHash returns a hash of the definition of a monitor returned by the Datadog API. A write response and a later read of the same definition hash the same, so the hash recorded after a write detects out-of-band edits. extraFields adds fields, such as "assets", that the caller reads on every request that it hashes.

Types

type EventInfo

type EventInfo struct {
	// contains filtered or unexported fields
}

EventInfo contains the required information to create Kubernetes and Datadog events.

func BuildEventInfo

func BuildEventInfo(name, ns, kind string, eventType datadog.EventType) EventInfo

BuildEventInfo creates a new EventInfo instance.

func (*EventInfo) GetDDEvent

func (ei *EventInfo) GetDDEvent() datadog.Event

GetDDEvent builds and returns a Datadog event.

func (*EventInfo) GetMessage

func (ei *EventInfo) GetMessage() string

GetMessage returns the event message.

func (*EventInfo) GetReason

func (ei *EventInfo) GetReason() string

GetReason returns the event reason.

Jump to

Keyboard shortcuts

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