Skip to content

Commit

Permalink
fixup! Check DCA replicaset in validation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jennchenn committed Aug 30, 2024
1 parent 807e791 commit f35a065
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/clusteragent/autoscaling/workload/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,14 +394,12 @@ func (c *Controller) validateAutoscaler(podAutoscaler *datadoghq.DatadogPodAutos
return fmt.Errorf("Unable to get the cluster agent pod name: %w", err)
}

var resourceName = ""
var resourceName string
switch owner := podAutoscaler.Spec.TargetRef.Kind; owner {
case "Deployment":
resourceName = kubernetes.ParseDeploymentForPodName(clusterAgentPodName)
case "ReplicaSet":
resourceName = kubernetes.ParseReplicaSetForPodName(clusterAgentPodName)
default:
resourceName = ""
}

clusterAgentNs := common.GetMyNamespace()
Expand Down

0 comments on commit f35a065

Please sign in to comment.