-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Introduce the Features Factory (#412)
- Loading branch information
1 parent
7bdd616
commit 88fe849
Showing
83 changed files
with
4,828 additions
and
1,045 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// Unless explicitly stated otherwise all files in this repository are licensed | ||
// under the Apache License Version 2.0. | ||
// This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
// Copyright 2016-present Datadog, Inc. | ||
|
||
package common | ||
|
||
// Datadog const value | ||
const ( | ||
// AgentDeploymentNameLabelKey label key use to link a Resource to a DatadogAgent | ||
AgentDeploymentNameLabelKey = "agent.datadoghq.com/name" | ||
// AgentDeploymentComponentLabelKey label key use to know with component is it | ||
AgentDeploymentComponentLabelKey = "agent.datadoghq.com/component" | ||
// MD5AgentDeploymentAnnotationKey annotation key used on a Resource in order to identify which AgentDeployment have been used to generate it. | ||
MD5AgentDeploymentAnnotationKey = "agent.datadoghq.com/agentspechash" | ||
|
||
// DefaultAgentResourceSuffix use as suffix for agent resource naming | ||
DefaultAgentResourceSuffix = "agent" | ||
// DefaultClusterAgentResourceSuffix use as suffix for cluster-agent resource naming | ||
DefaultClusterAgentResourceSuffix = "cluster-agent" | ||
// DefaultClusterChecksRunnerResourceSuffix use as suffix for cluster-checks-runner resource naming | ||
DefaultClusterChecksRunnerResourceSuffix = "cluster-checks-runner" | ||
// DefaultMetricsServerResourceSuffix use as suffix for cluster-agent metrics-server resource naming | ||
DefaultMetricsServerResourceSuffix = "cluster-agent-metrics-server" | ||
// DefaultAPPKeyKey default app-key key (use in secret for instance). | ||
DefaultAPPKeyKey = "app_key" | ||
// DefaultAPIKeyKey default api-key key (use in secret for instance). | ||
DefaultAPIKeyKey = "api_key" | ||
// DefaultTokenKey default token key (use in secret for instance). | ||
DefaultTokenKey = "token" | ||
// DefaultClusterAgentServicePort default cluster-agent service port | ||
DefaultClusterAgentServicePort = 5005 | ||
// DefaultMetricsServerServicePort default metrics-server port | ||
DefaultMetricsServerServicePort = 443 | ||
// DefaultMetricsServerTargetPort default metrics-server pod port | ||
DefaultMetricsServerTargetPort = int(DefaultMetricsProviderPort) | ||
// DefaultAdmissionControllerServicePort default admission controller service port | ||
DefaultAdmissionControllerServicePort = 443 | ||
// DefaultAdmissionControllerTargetPort default admission controller pod port | ||
DefaultAdmissionControllerTargetPort = 8000 | ||
// DefaultDogstatsdPort default dogstatsd port | ||
DefaultDogstatsdPort = 8125 | ||
// DefaultDogstatsdPortName default dogstatsd port name | ||
DefaultDogstatsdPortName = "dogstatsd" | ||
// DefaultApmPortName default apm port name | ||
DefaultApmPortName = "apm" | ||
// DefaultMetricsProviderPort default metrics provider port | ||
DefaultMetricsProviderPort int32 = 8443 | ||
// DefaultKubeStateMetricsCoreConf default ksm core ConfigMap name | ||
DefaultKubeStateMetricsCoreConf string = "kube-state-metrics-core-config" | ||
) | ||
|
||
// Datadog volume names and mount paths | ||
const ( | ||
ConfdVolumeName = "confd" | ||
ConfdVolumePath = "/conf.d" | ||
ConfigVolumeName = "config" | ||
ConfigVolumePath = "/etc/datadog-agent" | ||
KubeStateMetricCoreVolumeName = "ksm-core-config" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Unless explicitly stated otherwise all files in this repository are licensed | ||
// under the Apache License Version 2.0. | ||
// This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
// Copyright 2016-present Datadog, Inc. | ||
|
||
package common | ||
|
||
// Datadog env var names | ||
const ( | ||
DDIgnoreAutoConf = "DD_IGNORE_AUTOCONF" | ||
DDKubeStateMetricsCoreEnabled = "DD_KUBE_STATE_METRICS_CORE_ENABLED" | ||
DDKubeStateMetricsCoreConfigMap = "DD_KUBE_STATE_METRICS_CORE_CONFIGMAP_NAME" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Unless explicitly stated otherwise all files in this repository are licensed | ||
// under the Apache License Version 2.0. | ||
// This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
// Copyright 2016-present Datadog, Inc. | ||
|
||
package common | ||
|
||
import ( | ||
"fmt" | ||
|
||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// GetConfName get the name of the Configmap for a CustomConfigSpec | ||
func GetConfName(owner metav1.Object, conf *CustomConfig, defaultName string) string { | ||
// `configData` and `configMap` can't be set together. | ||
// Return the default if the conf is not overridden or if it is just overridden with the ConfigData. | ||
if conf != nil && conf.ConfigMap != nil { | ||
return conf.ConfigMap.Name | ||
} | ||
return fmt.Sprintf("%s-%s", owner.GetName(), defaultName) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.