Documentation ¶
Index ¶
- Variables
- func CalculateWorkloadRuntimeObjectName[T string | WorkloadKind | WorkloadKindLowerCase](workloadName string, workloadKind T) string
- func ClientObjectFromWorkloadKind(kind WorkloadKind) client.Object
- func IgnoreErrorKindNotSupported(err error) error
- func IsErrorKindNotSupported(err error) bool
- func IsInstrumentationDisabledExplicitly(obj client.Object) bool
- func IsObjectLabeledForInstrumentation(obj client.Object) bool
- func IsWorkloadInstrumentationEffectiveEnabled(ctx context.Context, kubeClient client.Client, obj client.Object) (bool, error)
- type DaemonSetWorkload
- type DeploymentWorkload
- type PodWorkload
- type StatefulSetWorkload
- type Workload
- type WorkloadKind
- func ExtractWorkloadInfoFromRuntimeObjectName(runtimeObjectName string) (workloadName string, workloadKind WorkloadKind, err error)
- func GetWorkloadFromOwnerReference(ownerReference metav1.OwnerReference) (workloadName string, workloadKind WorkloadKind, err error)
- func GetWorkloadNameAndKind(ownerName, ownerKind string) (string, WorkloadKind, error)
- func WorkloadKindFromClientObject(w client.Object) WorkloadKind
- func WorkloadKindFromLowerCase(lowerCase WorkloadKindLowerCase) WorkloadKind
- func WorkloadKindFromString(kind string) WorkloadKind
- type WorkloadKindLowerCase
Constants ¶
This section is empty.
Variables ¶
var ErrKindNotSupported = errors.New("workload kind not supported")
Functions ¶
func CalculateWorkloadRuntimeObjectName ¶ added in v1.0.93
func CalculateWorkloadRuntimeObjectName[T string | WorkloadKind | WorkloadKindLowerCase](workloadName string, workloadKind T) string
func ClientObjectFromWorkloadKind ¶ added in v1.0.93
func ClientObjectFromWorkloadKind(kind WorkloadKind) client.Object
func IgnoreErrorKindNotSupported ¶ added in v1.0.93
func IsErrorKindNotSupported ¶ added in v1.0.93
func IsInstrumentationDisabledExplicitly ¶ added in v1.0.82
func IsObjectLabeledForInstrumentation ¶ added in v1.0.71
Types ¶
type DaemonSetWorkload ¶ added in v1.0.71
func (*DaemonSetWorkload) AvailableReplicas ¶ added in v1.0.71
func (d *DaemonSetWorkload) AvailableReplicas() int32
type DeploymentWorkload ¶ added in v1.0.71
type DeploymentWorkload struct {
*v1.Deployment
}
func (*DeploymentWorkload) AvailableReplicas ¶ added in v1.0.71
func (d *DeploymentWorkload) AvailableReplicas() int32
type PodWorkload ¶ added in v1.0.93
type PodWorkload struct { Name string `json:"name"` Namespace string `json:"namespace"` Kind WorkloadKind `json:"kind"` }
PodWorkload represents the higher-level controller managing a specific Pod within a Kubernetes cluster. It contains essential details about the controller such as its Name, Namespace, and Kind. 'Kind' refers to the type of controller, which can be a Deployment, StatefulSet, or DaemonSet. This struct is useful for identifying and interacting with the overarching entity that governs the lifecycle and behavior of a Pod, especially in contexts where understanding the relationship between a Pod and its controlling workload is crucial.
type StatefulSetWorkload ¶ added in v1.0.71
type StatefulSetWorkload struct {
*v1.StatefulSet
}
func (*StatefulSetWorkload) AvailableReplicas ¶ added in v1.0.71
func (s *StatefulSetWorkload) AvailableReplicas() int32
type WorkloadKind ¶ added in v1.0.93
type WorkloadKind string
1. the pascal case representation of the workload kind it is used in k8s api objects as the `Kind` field.
const ( WorkloadKindDeployment WorkloadKind = "Deployment" WorkloadKindDaemonSet WorkloadKind = "DaemonSet" WorkloadKindStatefulSet WorkloadKind = "StatefulSet" )
func ExtractWorkloadInfoFromRuntimeObjectName ¶ added in v1.0.93
func ExtractWorkloadInfoFromRuntimeObjectName(runtimeObjectName string) (workloadName string, workloadKind WorkloadKind, err error)
func GetWorkloadFromOwnerReference ¶ added in v1.0.93
func GetWorkloadFromOwnerReference(ownerReference metav1.OwnerReference) (workloadName string, workloadKind WorkloadKind, err error)
GetWorkloadFromOwnerReference retrieves both the workload name and workload kind from the provided owner reference.
func GetWorkloadNameAndKind ¶ added in v1.0.112
func GetWorkloadNameAndKind(ownerName, ownerKind string) (string, WorkloadKind, error)
func WorkloadKindFromClientObject ¶ added in v1.0.93
func WorkloadKindFromClientObject(w client.Object) WorkloadKind
func WorkloadKindFromLowerCase ¶ added in v1.0.93
func WorkloadKindFromLowerCase(lowerCase WorkloadKindLowerCase) WorkloadKind
func WorkloadKindFromString ¶ added in v1.0.93
func WorkloadKindFromString(kind string) WorkloadKind
type WorkloadKindLowerCase ¶ added in v1.0.93
type WorkloadKindLowerCase string
2. the lower case representation of the workload kind is used in odigos with the object name for instrumentation config and runtime details
const ( WorkloadKindLowerCaseDeployment WorkloadKindLowerCase = "deployment" WorkloadKindLowerCaseDaemonSet WorkloadKindLowerCase = "daemonset" WorkloadKindLowerCaseStatefulSet WorkloadKindLowerCase = "statefulset" )
func WorkloadKindLowerCaseFromKind ¶ added in v1.0.93
func WorkloadKindLowerCaseFromKind(pascalCase WorkloadKind) WorkloadKindLowerCase