Skip to content

Commit

Permalink
fix: rebase on main
Browse files Browse the repository at this point in the history
Signed-off-by: Wassim DHIF <wassim.dhif@datadoghq.com>
  • Loading branch information
wdhif committed Sep 25, 2024
1 parent 54cae7e commit c7d9777
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pkg/clusteragent/admission/controllers/webhook/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"fmt"
"strings"

"github.com/DataDog/datadog-agent/pkg/util/kubernetes/apiserver/common"
pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup"
"github.com/DataDog/datadog-agent/pkg/util/kubernetes/apiserver/common"
)

// Config contains config parameters
Expand Down
6 changes: 3 additions & 3 deletions pkg/clusteragent/admission/mutate/autoscaling/autoscaling.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
package autoscaling

import (
"k8s.io/client-go/dynamic"
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
admiv1 "k8s.io/api/admission/v1"
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/dynamic"

"github.com/DataDog/datadog-agent/cmd/cluster-agent/admission"
"github.com/DataDog/datadog-agent/pkg/clusteragent/admission/common"
"github.com/DataDog/datadog-agent/pkg/clusteragent/autoscaling/workload"
mutatecommon "github.com/DataDog/datadog-agent/pkg/clusteragent/admission/mutate/common"
"github.com/DataDog/datadog-agent/pkg/clusteragent/autoscaling/workload"
pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup"
)

Expand Down
16 changes: 8 additions & 8 deletions pkg/clusteragent/admission/mutate/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ import (
"fmt"
"strings"

"k8s.io/client-go/dynamic"
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
admiv1 "k8s.io/api/admission/v1"
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/dynamic"

"github.com/DataDog/datadog-agent/cmd/cluster-agent/admission"
workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def"
"github.com/DataDog/datadog-agent/pkg/clusteragent/admission/common"
"github.com/DataDog/datadog-agent/pkg/clusteragent/admission/metrics"
"github.com/DataDog/datadog-agent/pkg/util/log"
apiCommon "github.com/DataDog/datadog-agent/pkg/util/kubernetes/apiserver/common"
mutatecommon "github.com/DataDog/datadog-agent/pkg/clusteragent/admission/mutate/common"
pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup"
workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def"
apiCommon "github.com/DataDog/datadog-agent/pkg/util/kubernetes/apiserver/common"
"github.com/DataDog/datadog-agent/pkg/util/log"
)

const (
Expand Down Expand Up @@ -297,7 +297,7 @@ func injectSocketVolumes(pod *corev1.Pod) bool {

for volumeName, volumePath := range volumes {
volume, volumeMount := buildVolume(volumeName, volumePath, corev1.HostPathSocket, true)
injectedVol := common.InjectVolume(pod, volume, volumeMount)
injectedVol := mutatecommon.InjectVolume(pod, volume, volumeMount)
if injectedVol {
injectedVolNames = append(injectedVolNames, volumeName)
}
Expand All @@ -309,14 +309,14 @@ func injectSocketVolumes(pod *corev1.Pod) bool {
corev1.HostPathDirectoryOrCreate,
true,
)
injectedVol := common.InjectVolume(pod, volume, volumeMount)
injectedVol := mutatecommon.InjectVolume(pod, volume, volumeMount)
if injectedVol {
injectedVolNames = append(injectedVolNames, DatadogVolumeName)
}
}

for _, volName := range injectedVolNames {
common.MarkVolumeAsSafeToEvictForAutoscaler(pod, volName)
mutatecommon.MarkVolumeAsSafeToEvictForAutoscaler(pod, volName)
}

return len(injectedVolNames) > 0
Expand Down

0 comments on commit c7d9777

Please sign in to comment.