Skip to content

Commit 20a0a0b

Browse files
authored
Deploy VPA CRD to prevent deploying unknown resource type on GCP (#1666)
When deploying test env on GCP, we deploy an nginx with a VerticalPodAutoscaler. To do so we must first deploy the CRD for the VerticalPodAutoscaler. Add the missing call to deploy such CRD. Signed-off-by: Alexandre Lavigne <alexandre.lavigne@datadoghq.com>
1 parent 701a8bf commit 20a0a0b

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

scenarios/gcp/gke/run.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"github.com/DataDog/test-infra-definitions/components/datadog/apps/tracegen"
1313
dogstatsdstandalone "github.com/DataDog/test-infra-definitions/components/datadog/dogstatsd-standalone"
1414
"github.com/DataDog/test-infra-definitions/components/datadog/kubernetesagentparams"
15+
"github.com/DataDog/test-infra-definitions/components/kubernetes/vpa"
1516
"github.com/DataDog/test-infra-definitions/resources/gcp"
1617
"github.com/DataDog/test-infra-definitions/scenarios/gcp/fakeintake"
1718

@@ -38,6 +39,12 @@ func Run(ctx *pulumi.Context) error {
3839
return err
3940
}
4041

42+
vpaCrd, err := vpa.DeployCRD(&env, cluster.KubeProvider)
43+
if err != nil {
44+
return err
45+
}
46+
dependsOnVPA := utils.PulumiDependsOn(vpaCrd)
47+
4148
var dependsOnDDAgent pulumi.ResourceOption
4249

4350
// Deploy the agent
@@ -91,7 +98,7 @@ func Run(ctx *pulumi.Context) error {
9198
// Deploy testing workload
9299
if env.TestingWorkloadDeploy() {
93100

94-
if _, err := nginx.K8sAppDefinition(&env, cluster.KubeProvider, "workload-nginx", "", true, dependsOnDDAgent /* for DDM */); err != nil {
101+
if _, err := nginx.K8sAppDefinition(&env, cluster.KubeProvider, "workload-nginx", "", true, dependsOnDDAgent /* for DDM */, dependsOnVPA); err != nil {
95102
return err
96103
}
97104

0 commit comments

Comments
 (0)