Documentation ¶
Index ¶
- Constants
- func AddOrUpdate(envVars []corev1.EnvVar, desiredEnvVar corev1.EnvVar) []corev1.EnvVar
- func AffinityNodeRequirement() []corev1.NodeSelectorRequirement
- func AffinityNodeRequirementWithARM64() []corev1.NodeSelectorRequirement
- func AreConfigMapsEqual(configMap corev1.ConfigMap, other corev1.ConfigMap) bool
- func AreSecretsEqual(secret corev1.Secret, other corev1.Secret) bool
- func CheckIfOneAgentAPMExists(cfg *rest.Config) (bool, error)
- func ConfigMapDataEqual(map1, map2 *corev1.ConfigMap) bool
- func CreateConfigMap(scheme *runtime.Scheme, owner metav1.Object, mods ...configMapModifier) (*corev1.ConfigMap, error)
- func CreateOrUpdateDaemonSet(kubernetesClient client.Client, logger logr.Logger, ...) (bool, error)
- func CreateSecret(scheme *runtime.Scheme, owner metav1.Object, mods ...secretBuilderModifier) (*corev1.Secret, error)
- func DefaultNamespace() string
- func Delete(ctx context.Context, client client.Client, obj client.Object) error
- func EnvVarIsIn(envVars []corev1.EnvVar, envVarToCheck string) bool
- func ExtractField(configMap *corev1.ConfigMap, key string) (string, error)
- func ExtractToken(secret *corev1.Secret, key string) (string, error)
- func FindContainerInPod(pod corev1.Pod, name string) (*corev1.Container, error)
- func FindContainerInPodSpec(podSpec *corev1.PodSpec, containerName string) *corev1.Container
- func FindEnvVar(envVars []corev1.EnvVar, name string) *corev1.EnvVar
- func GenerateHash(ds any) (string, error)
- func GetDataFromSecretName(apiReader client.Reader, namespacedName types.NamespacedName, dataKey string, ...) (string, error)
- func GetDeployment(c client.Client, podName, namespace string) (*appsv1.Deployment, error)
- func GetField(values map[string]string, key string, defaultValue string) string
- func GetFieldBool(values map[string]string, key string, defaultValue bool) bool
- func GetPlatformFromEnv() string
- func GetPod(ctx context.Context, clt client.Reader, name, namespace string) (*corev1.Pod, error)
- func GetPodName(pod corev1.Pod) string
- func GetVolumeByName(volumes []corev1.Volume, volumeName string) (*corev1.Volume, error)
- func GetVolumeMountByName(mounts []corev1.VolumeMount, volumeName string) (*corev1.VolumeMount, error)
- func IsDifferent(a, b any) (bool, error)
- func IsHashAnnotationDifferent(a, b metav1.Object) bool
- func IsVolumeMountPresent(volumeMounts []corev1.VolumeMount, neededMount corev1.VolumeMount) bool
- func Key(object client.Object) client.ObjectKey
- func LabelsNotEqual(currentLabels, desiredLabels map[string]string) bool
- func MergeMap(maps ...map[string]string) map[string]string
- func MountPathIsIn(volumeMounts []corev1.VolumeMount, mountPathToCheck string) bool
- func MountPathIsReadOnlyOrReadWrite(volumeMounts []corev1.VolumeMount, mountPathToCheck string, mode bool) bool
- func NewEnvVarSourceForField(fieldPath string) *corev1.EnvVarSource
- func NewQuantity(serialized string) *resource.Quantity
- func NewResources(cpu, memory string) corev1.ResourceList
- func PortIsIn(ports []corev1.ContainerPort, portToCheck int32) bool
- func SwitchCapability(instance *dynatracev1beta1.DynaKube, ...)
- func TolerationForAmd() []corev1.Toleration
- func ValidateCertificateExpiration(certData []byte, renewalThreshold time.Duration, now time.Time, ...) (bool, error)
- func VolumeClaimIsDefined(claims []corev1.PersistentVolumeClaim, claimNameToCheck string) bool
- func VolumeIsDefined(volumes []corev1.Volume, volumeNameToCheck string) bool
- type AppLabels
- type ConfigMapDataModifier
- type ConfigMapNameModifier
- type ConfigMapNamespaceModifier
- type ConfigMapQuery
- func (query ConfigMapQuery) Create(configMap corev1.ConfigMap) error
- func (query ConfigMapQuery) CreateOrUpdate(configMap corev1.ConfigMap) error
- func (query ConfigMapQuery) Delete(configMap corev1.ConfigMap) error
- func (query ConfigMapQuery) Get(objectKey client.ObjectKey) (corev1.ConfigMap, error)
- func (query ConfigMapQuery) Update(configMap corev1.ConfigMap) error
- type CoreLabels
- type Platform
- type SecretDataModifier
- type SecretLabelsModifier
- type SecretNameModifier
- type SecretNamespaceModifier
- type SecretQuery
- func (query SecretQuery) Create(secret corev1.Secret) error
- func (query SecretQuery) CreateOrUpdate(secret corev1.Secret) error
- func (query SecretQuery) CreateOrUpdateForNamespacesList(newSecret corev1.Secret, namespaces []corev1.Namespace) error
- func (query SecretQuery) Get(objectKey client.ObjectKey) (corev1.Secret, error)
- func (query SecretQuery) GetAllFromNamespaces(secretName string) ([]corev1.Secret, error)
- func (query SecretQuery) Update(secret corev1.Secret) error
- type SecretTypeModifier
- type Tokens
Constants ¶
const ( EnvPodNamespace = "POD_NAMESPACE" EnvPodName = "POD_NAME" )
const ( AppNameLabel = "app.kubernetes.io/name" AppCreatedByLabel = "app.kubernetes.io/created-by" AppManagedByLabel = "app.kubernetes.io/managed-by" AppComponentLabel = "app.kubernetes.io/component" AppVersionLabel = "app.kubernetes.io/version" OneAgentComponentLabel = "oneagent" ActiveGateComponentLabel = "activegate" WebhookComponentLabel = "webhook" SyntheticComponentLabel = "synthetic" )
const ( ReadOnlyMountPath = true ReadWriteMountPath = false )
const AnnotationHash = dynatracev1beta1.InternalFlagPrefix + "template-hash"
const UnprivilegedGroup = int64(1000)
const UnprivilegedUser = int64(1000)
Variables ¶
This section is empty.
Functions ¶
func AddOrUpdate ¶ added in v0.11.0
func AffinityNodeRequirement ¶
func AffinityNodeRequirement() []corev1.NodeSelectorRequirement
func AffinityNodeRequirementWithARM64 ¶
func AffinityNodeRequirementWithARM64() []corev1.NodeSelectorRequirement
func AreConfigMapsEqual ¶ added in v0.10.1
func AreSecretsEqual ¶ added in v0.7.0
func CheckIfOneAgentAPMExists ¶
CheckIfOneAgentAPMExists checks if a OneAgentAPM object exists
func ConfigMapDataEqual ¶ added in v0.6.0
func CreateConfigMap ¶ added in v0.11.0
func CreateOrUpdateDaemonSet ¶
func CreateSecret ¶ added in v0.11.0
func DefaultNamespace ¶ added in v0.11.0
func DefaultNamespace() string
func EnvVarIsIn ¶ added in v0.5.0
func ExtractField ¶ added in v0.11.0
func FindContainerInPod ¶ added in v0.8.0
func FindContainerInPodSpec ¶ added in v0.10.0
func FindEnvVar ¶ added in v0.7.0
func GenerateHash ¶
func GetDataFromSecretName ¶ added in v0.7.0
func GetDeployment ¶
GetDeployment returns the Deployment object who is the owner of this pod.
func GetPlatformFromEnv ¶ added in v0.12.0
func GetPlatformFromEnv() string
func GetPodName ¶ added in v0.11.0
GetPodName returns the name of the pod. During the webhook injection the pod.Name is not always set yet, in which case it returns the pod.GeneraName
func GetVolumeByName ¶ added in v0.6.0
func GetVolumeMountByName ¶ added in v0.12.0
func GetVolumeMountByName(mounts []corev1.VolumeMount, volumeName string) (*corev1.VolumeMount, error)
func IsDifferent ¶ added in v0.10.0
func IsHashAnnotationDifferent ¶ added in v0.10.0
func IsVolumeMountPresent ¶ added in v0.10.0
func IsVolumeMountPresent(volumeMounts []corev1.VolumeMount, neededMount corev1.VolumeMount) bool
func LabelsNotEqual ¶ added in v0.6.0
func MountPathIsIn ¶ added in v0.5.0
func MountPathIsIn(volumeMounts []corev1.VolumeMount, mountPathToCheck string) bool
func MountPathIsReadOnlyOrReadWrite ¶ added in v0.6.0
func MountPathIsReadOnlyOrReadWrite(volumeMounts []corev1.VolumeMount, mountPathToCheck string, mode bool) bool
func NewEnvVarSourceForField ¶ added in v0.8.0
func NewEnvVarSourceForField(fieldPath string) *corev1.EnvVarSource
func NewQuantity ¶ added in v0.11.0
func NewResources ¶ added in v0.11.0
func NewResources(cpu, memory string) corev1.ResourceList
func SwitchCapability ¶ added in v0.9.0
func SwitchCapability(instance *dynatracev1beta1.DynaKube, capability dynatracev1beta1.ActiveGateCapability, wantEnabled bool)
func TolerationForAmd ¶ added in v0.9.0
func TolerationForAmd() []corev1.Toleration
func ValidateCertificateExpiration ¶ added in v0.5.0
func VolumeClaimIsDefined ¶ added in v0.11.0
func VolumeClaimIsDefined(claims []corev1.PersistentVolumeClaim, claimNameToCheck string) bool
Types ¶
type AppLabels ¶ added in v0.6.0
func NewAppLabels ¶ added in v0.6.0
NewAppLabels abstracts labels that are specific to an application managed by the operator which have their own version separate from the operator version. Follows the recommended label pattern: https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels
func (*AppLabels) BuildLabels ¶ added in v0.6.0
BuildLabels creates labels that include oneagent or activegate mode and version
func (*AppLabels) BuildMatchLabels ¶ added in v0.6.0
BuildMatchLabels creates labels that don't change when switching oneagent or activegate mode
type ConfigMapDataModifier ¶ added in v0.11.0
type ConfigMapDataModifier struct {
// contains filtered or unexported fields
}
func NewConfigMapDataModifier ¶ added in v0.11.0
func NewConfigMapDataModifier(data map[string]string) ConfigMapDataModifier
func (ConfigMapDataModifier) Enabled ¶ added in v0.11.0
func (mod ConfigMapDataModifier) Enabled() bool
type ConfigMapNameModifier ¶ added in v0.11.0
type ConfigMapNameModifier struct {
// contains filtered or unexported fields
}
func NewConfigMapNameModifier ¶ added in v0.11.0
func NewConfigMapNameModifier(name string) ConfigMapNameModifier
func (ConfigMapNameModifier) Enabled ¶ added in v0.11.0
func (mod ConfigMapNameModifier) Enabled() bool
type ConfigMapNamespaceModifier ¶ added in v0.11.0
type ConfigMapNamespaceModifier struct {
// contains filtered or unexported fields
}
func NewConfigMapNamespaceModifier ¶ added in v0.11.0
func NewConfigMapNamespaceModifier(namespaceName string) ConfigMapNamespaceModifier
func (ConfigMapNamespaceModifier) Enabled ¶ added in v0.11.0
func (mod ConfigMapNamespaceModifier) Enabled() bool
type ConfigMapQuery ¶ added in v0.10.1
type ConfigMapQuery struct {
// contains filtered or unexported fields
}
func NewConfigMapQuery ¶ added in v0.10.1
func (ConfigMapQuery) Create ¶ added in v0.10.1
func (query ConfigMapQuery) Create(configMap corev1.ConfigMap) error
func (ConfigMapQuery) CreateOrUpdate ¶ added in v0.10.1
func (query ConfigMapQuery) CreateOrUpdate(configMap corev1.ConfigMap) error
func (ConfigMapQuery) Delete ¶ added in v0.11.0
func (query ConfigMapQuery) Delete(configMap corev1.ConfigMap) error
type CoreLabels ¶ added in v0.6.0
type CoreLabels struct { Version string // contains filtered or unexported fields }
func NewCoreLabels ¶ added in v0.6.0
func NewCoreLabels(dynakubeName, component string) *CoreLabels
NewCoreLabels abstracts labels that are used for statefulsetreconciler functionality in the operator which are not specific to an application's version Follows the recommended label pattern: https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels
func (*CoreLabels) BuildLabels ¶ added in v0.6.0
func (labels *CoreLabels) BuildLabels() map[string]string
BuildLabels creates labels that include operator version
func (*CoreLabels) BuildMatchLabels ¶ added in v0.6.0
BuildMatchLabels creates labels that don't change when switching operator versions
type Platform ¶ added in v0.11.0
type Platform int
func ResolvePlatformFromEnv ¶ added in v0.11.0
func ResolvePlatformFromEnv() Platform
type SecretDataModifier ¶ added in v0.11.0
type SecretDataModifier struct {
// contains filtered or unexported fields
}
func NewSecretDataModifier ¶ added in v0.11.0
func NewSecretDataModifier(data map[string][]byte) SecretDataModifier
func (SecretDataModifier) Enabled ¶ added in v0.11.0
func (mod SecretDataModifier) Enabled() bool
type SecretLabelsModifier ¶ added in v0.11.0
type SecretLabelsModifier struct {
// contains filtered or unexported fields
}
func NewSecretLabelsModifier ¶ added in v0.11.0
func NewSecretLabelsModifier(labels map[string]string) SecretLabelsModifier
func (SecretLabelsModifier) Enabled ¶ added in v0.11.0
func (mod SecretLabelsModifier) Enabled() bool
type SecretNameModifier ¶ added in v0.11.0
type SecretNameModifier struct {
// contains filtered or unexported fields
}
func NewSecretNameModifier ¶ added in v0.11.0
func NewSecretNameModifier(name string) SecretNameModifier
func (SecretNameModifier) Enabled ¶ added in v0.11.0
func (mod SecretNameModifier) Enabled() bool
type SecretNamespaceModifier ¶ added in v0.11.0
type SecretNamespaceModifier struct {
// contains filtered or unexported fields
}
func NewSecretNamespaceModifier ¶ added in v0.11.0
func NewSecretNamespaceModifier(namespaceName string) SecretNamespaceModifier
func (SecretNamespaceModifier) Enabled ¶ added in v0.11.0
func (mod SecretNamespaceModifier) Enabled() bool
type SecretQuery ¶ added in v0.7.0
type SecretQuery struct {
// contains filtered or unexported fields
}
func NewSecretQuery ¶ added in v0.7.0
func (SecretQuery) Create ¶ added in v0.7.0
func (query SecretQuery) Create(secret corev1.Secret) error
func (SecretQuery) CreateOrUpdate ¶ added in v0.7.0
func (query SecretQuery) CreateOrUpdate(secret corev1.Secret) error
func (SecretQuery) CreateOrUpdateForNamespacesList ¶ added in v0.11.0
func (SecretQuery) GetAllFromNamespaces ¶ added in v0.11.0
func (query SecretQuery) GetAllFromNamespaces(secretName string) ([]corev1.Secret, error)
type SecretTypeModifier ¶ added in v0.11.0
type SecretTypeModifier struct {
// contains filtered or unexported fields
}
func NewSecretTypeModifier ¶ added in v0.11.0
func NewSecretTypeModifier(secretType corev1.SecretType) SecretTypeModifier
func (SecretTypeModifier) Enabled ¶ added in v0.11.0
func (mod SecretTypeModifier) Enabled() bool