From 54fd6d7dd6dc4990a001244473c1fd18e72e6c3b Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Fri, 15 Nov 2024 10:44:12 -0500 Subject: [PATCH 01/10] wip --- .../examples/kind_local_operator_test.go | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 test/new-e2e/examples/kind_local_operator_test.go diff --git a/test/new-e2e/examples/kind_local_operator_test.go b/test/new-e2e/examples/kind_local_operator_test.go new file mode 100644 index 0000000000000..31a7ed42873df --- /dev/null +++ b/test/new-e2e/examples/kind_local_operator_test.go @@ -0,0 +1,122 @@ +// 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 examples + +import ( + "context" + "github.com/DataDog/test-infra-definitions/components/datadog/agent" + "github.com/DataDog/test-infra-definitions/components/datadog/agentwithoperatorparams" + fakeintakeComp "github.com/DataDog/test-infra-definitions/components/datadog/fakeintake" + "github.com/DataDog/test-infra-definitions/components/datadog/operatorparams" + compkube "github.com/DataDog/test-infra-definitions/components/kubernetes" + "github.com/DataDog/test-infra-definitions/resources/local" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "strings" + "testing" + + "github.com/stretchr/testify/assert" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes" +) + +type localOperatorKindSuite struct { + e2e.BaseSuite[environments.Kubernetes] +} + +func localKindOperatorProvisioner() e2e.PulumiEnvRunFunc[environments.Kubernetes] { + return func(ctx *pulumi.Context, env *environments.Kubernetes) error { + kindEnv, err := local.NewEnvironment(ctx) + if err != nil { + return err + } + + kindCluster, err := compkube.NewLocalKindCluster(&kindEnv, kindEnv.CommonNamer().ResourceName("kind"), "kind-operator", kindEnv.KubernetesVersion()) + if err != nil { + return err + } + + if &env.KubernetesCluster != nil && &env.KubernetesCluster.ClusterOutput != nil { + err = kindCluster.Export(ctx, &env.KubernetesCluster.ClusterOutput) + if err != nil { + return err + } + } + + // Building Kubernetes provider + kindKubeProvider, err := kubernetes.NewProvider(ctx, kindEnv.CommonNamer().ResourceName("k8s-provider"), &kubernetes.ProviderArgs{ + Kubeconfig: kindCluster.KubeConfig, + EnableServerSideApply: pulumi.BoolPtr(true), + DeleteUnreachable: pulumi.BoolPtr(true), + }) + if err != nil { + return err + } + + namespace := "datadog" // TODO: fix namespace for ddaw/operator component + + fakeIntake, err := fakeintakeComp.NewLocalDockerFakeintake(&kindEnv, "fakeintake") + if err != nil { + return err + } + err = fakeIntake.Export(ctx, &env.FakeIntake.FakeintakeOutput) + if err != nil { + return err + } + + // Setup operator options + operatorOpts := make([]operatorparams.Option, 0) + operatorOpts = append( + operatorOpts, + operatorparams.WithNamespace(namespace), + ) + // Setup DDA options + ddaOptions := make([]agentwithoperatorparams.Option, 0) + ddaOptions = append( + ddaOptions, + agentwithoperatorparams.WithNamespace(namespace), + agentwithoperatorparams.WithTLSKubeletVerify(false), + ) + + if fakeIntake != nil { + ddaOptions = append( + ddaOptions, + agentwithoperatorparams.WithFakeIntake(fakeIntake), + ) + } + + operatorAgentComponent, err := agent.NewDDAWithOperator(&kindEnv, kindEnv.CommonNamer().ResourceName("dd-operator-agent"), kindKubeProvider, operatorOpts, ddaOptions...) + + if err != nil { + return err + } + + if err := operatorAgentComponent.Export(kindEnv.Ctx(), nil); err != nil { + return err + } + + return nil + } +} + +func TestLocalOpKindSuite(t *testing.T) { + e2e.Run(t, &localOperatorKindSuite{}, e2e.WithPulumiProvisioner(localKindOperatorProvisioner(), nil), + e2e.WithDevMode()) +} + +func (v *localOperatorKindSuite) TestClusterAgentInstalled() { + res, _ := v.Env().KubernetesCluster.Client().CoreV1().Pods("datadog").List(context.TODO(), v1.ListOptions{}) + containsClusterAgent := false + for _, pod := range res.Items { + if strings.Contains(pod.Name, "cluster-agent") { + containsClusterAgent = true + break + } + } + assert.True(v.T(), containsClusterAgent, "Cluster Agent not found") +} From febebfc13f46476199731959a2df208987e194fc Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Mon, 18 Nov 2024 18:53:06 -0500 Subject: [PATCH 02/10] Add deployOperator option to aws kind provisioner, add examples --- .../examples/kind_local_operator_test.go | 46 +++++++-------- test/new-e2e/examples/kind_operator_test.go | 50 ++++++++++++++++ .../pkg/environments/aws/kubernetes/kind.go | 48 ++++++++++++++- .../pkg/environments/aws/kubernetes/params.go | 58 ++++++++++++++----- 4 files changed, 161 insertions(+), 41 deletions(-) create mode 100644 test/new-e2e/examples/kind_operator_test.go diff --git a/test/new-e2e/examples/kind_local_operator_test.go b/test/new-e2e/examples/kind_local_operator_test.go index 31a7ed42873df..dda9c1766a9e2 100644 --- a/test/new-e2e/examples/kind_local_operator_test.go +++ b/test/new-e2e/examples/kind_local_operator_test.go @@ -25,7 +25,7 @@ import ( "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes" ) -type localOperatorKindSuite struct { +type localKindOperatorSuite struct { e2e.BaseSuite[environments.Kubernetes] } @@ -36,29 +36,26 @@ func localKindOperatorProvisioner() e2e.PulumiEnvRunFunc[environments.Kubernetes return err } - kindCluster, err := compkube.NewLocalKindCluster(&kindEnv, kindEnv.CommonNamer().ResourceName("kind"), "kind-operator", kindEnv.KubernetesVersion()) + kindCluster, err := compkube.NewLocalKindCluster(&kindEnv, kindEnv.CommonNamer().ResourceName("kind-operator"), kindEnv.KubernetesVersion()) if err != nil { return err } - if &env.KubernetesCluster != nil && &env.KubernetesCluster.ClusterOutput != nil { - err = kindCluster.Export(ctx, &env.KubernetesCluster.ClusterOutput) - if err != nil { - return err - } + err = kindCluster.Export(ctx, &env.KubernetesCluster.ClusterOutput) + if err != nil { + return err } - // Building Kubernetes provider + // Build Kubernetes provider kindKubeProvider, err := kubernetes.NewProvider(ctx, kindEnv.CommonNamer().ResourceName("k8s-provider"), &kubernetes.ProviderArgs{ Kubeconfig: kindCluster.KubeConfig, EnableServerSideApply: pulumi.BoolPtr(true), - DeleteUnreachable: pulumi.BoolPtr(true), }) if err != nil { return err } - namespace := "datadog" // TODO: fix namespace for ddaw/operator component + namespace := "e2e-operator" fakeIntake, err := fakeintakeComp.NewLocalDockerFakeintake(&kindEnv, "fakeintake") if err != nil { @@ -75,28 +72,30 @@ func localKindOperatorProvisioner() e2e.PulumiEnvRunFunc[environments.Kubernetes operatorOpts, operatorparams.WithNamespace(namespace), ) + + customDDA := ` +spec: + features: + apm: + enabled: true +` // Setup DDA options ddaOptions := make([]agentwithoperatorparams.Option, 0) ddaOptions = append( ddaOptions, agentwithoperatorparams.WithNamespace(namespace), agentwithoperatorparams.WithTLSKubeletVerify(false), + agentwithoperatorparams.WithDDAConfig(customDDA), ) - if fakeIntake != nil { - ddaOptions = append( - ddaOptions, - agentwithoperatorparams.WithFakeIntake(fakeIntake), - ) - } - + // Create Datadog Agent with Operator component operatorAgentComponent, err := agent.NewDDAWithOperator(&kindEnv, kindEnv.CommonNamer().ResourceName("dd-operator-agent"), kindKubeProvider, operatorOpts, ddaOptions...) if err != nil { return err } - if err := operatorAgentComponent.Export(kindEnv.Ctx(), nil); err != nil { + if err := operatorAgentComponent.Export(ctx, &env.Agent.KubernetesAgentOutput); err != nil { return err } @@ -104,13 +103,12 @@ func localKindOperatorProvisioner() e2e.PulumiEnvRunFunc[environments.Kubernetes } } -func TestLocalOpKindSuite(t *testing.T) { - e2e.Run(t, &localOperatorKindSuite{}, e2e.WithPulumiProvisioner(localKindOperatorProvisioner(), nil), - e2e.WithDevMode()) +func TestOperatorKindSuite(t *testing.T) { + e2e.Run(t, &localKindOperatorSuite{}, e2e.WithPulumiProvisioner(localKindOperatorProvisioner(), nil)) } -func (v *localOperatorKindSuite) TestClusterAgentInstalled() { - res, _ := v.Env().KubernetesCluster.Client().CoreV1().Pods("datadog").List(context.TODO(), v1.ListOptions{}) +func (k *localKindOperatorSuite) TestClusterAgentInstalled() { + res, _ := k.Env().KubernetesCluster.Client().CoreV1().Pods("blahblah").List(context.TODO(), v1.ListOptions{}) containsClusterAgent := false for _, pod := range res.Items { if strings.Contains(pod.Name, "cluster-agent") { @@ -118,5 +116,5 @@ func (v *localOperatorKindSuite) TestClusterAgentInstalled() { break } } - assert.True(v.T(), containsClusterAgent, "Cluster Agent not found") + assert.True(k.T(), containsClusterAgent, "Cluster Agent not found") } diff --git a/test/new-e2e/examples/kind_operator_test.go b/test/new-e2e/examples/kind_operator_test.go new file mode 100644 index 0000000000000..95398ba062253 --- /dev/null +++ b/test/new-e2e/examples/kind_operator_test.go @@ -0,0 +1,50 @@ +// 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 examples + +import ( + "context" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" + "github.com/DataDog/test-infra-definitions/components/datadog/agentwithoperatorparams" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "strings" + "testing" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + "github.com/stretchr/testify/assert" +) + +type kindOperatorSuite struct { + e2e.BaseSuite[environments.Kubernetes] +} + +func TestKindOperatorSuite(t *testing.T) { + customDDA := ` +spec: + features: + apm: + enabled: true +` + + e2e.Run(t, &kindOperatorSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner( + awskubernetes.WithOperator(), + awskubernetes.WithOperatorDDAOptions(agentwithoperatorparams.WithDDAConfig(customDDA)), + )), + ) +} + +func (v *kindOperatorSuite) TestClusterAgentInstalled() { + res, _ := v.Env().KubernetesCluster.Client().CoreV1().Pods("datadog").List(context.TODO(), v1.ListOptions{}) + containsClusterAgent := false + for _, pod := range res.Items { + if strings.Contains(pod.Name, "cluster-agent") { + containsClusterAgent = true + break + } + } + assert.True(v.T(), containsClusterAgent, "Cluster Agent not found") +} diff --git a/test/new-e2e/pkg/environments/aws/kubernetes/kind.go b/test/new-e2e/pkg/environments/aws/kubernetes/kind.go index 53bc559b4db0e..19a0a82e46f9f 100644 --- a/test/new-e2e/pkg/environments/aws/kubernetes/kind.go +++ b/test/new-e2e/pkg/environments/aws/kubernetes/kind.go @@ -9,6 +9,10 @@ package awskubernetes import ( "context" "fmt" + "github.com/DataDog/test-infra-definitions/components/datadog/agent" + "github.com/DataDog/test-infra-definitions/components/datadog/agentwithoperatorparams" + "github.com/DataDog/test-infra-definitions/components/datadog/operator" + "github.com/DataDog/test-infra-definitions/components/datadog/operatorparams" "github.com/DataDog/test-infra-definitions/common/utils" @@ -88,7 +92,7 @@ func KindRunFunc(ctx *pulumi.Context, env *environments.Kubernetes, params *Prov return err } - kindCluster, err := kubeComp.NewKindCluster(&awsEnv, host, params.name, awsEnv.KubernetesVersion(), utils.PulumiDependsOn(installEcrCredsHelperCmd)) + kindCluster, err := kubeComp.NewKindCluster(&awsEnv, host, awsEnv.CommonNamer().ResourceName("kind"), awsEnv.KubernetesVersion(), utils.PulumiDependsOn(installEcrCredsHelperCmd)) if err != nil { return err } @@ -127,9 +131,10 @@ func KindRunFunc(ctx *pulumi.Context, env *environments.Kubernetes, params *Prov env.FakeIntake = nil } + kindClusterName := ctx.Stack() + var dependsOnCrd []pulumi.Resource - if params.agentOptions != nil { - kindClusterName := ctx.Stack() + if params.agentOptions != nil && !params.deployOperator { helmValues := fmt.Sprintf(` datadog: kubelet: @@ -150,6 +155,43 @@ agents: return err } dependsOnCrd = append(dependsOnCrd, agent) + } + + if params.deployOperator { + operatorOpts := make([]operatorparams.Option, 0) + operatorOpts = append( + operatorOpts, + params.operatorOptions..., + ) + + if params.operatorDDAOptions != nil && params.deployOperator { + ddaOptions := make([]agentwithoperatorparams.Option, 0) + ddaOptions = append( + ddaOptions, + params.operatorDDAOptions..., + ) + + ddaWithOperatorComp, err := agent.NewDDAWithOperator(&awsEnv, awsEnv.CommonNamer().ResourceName("dd-operator-agent"), kubeProvider, operatorOpts, ddaOptions...) + + if err != nil { + return err + } + + if err := ddaWithOperatorComp.Export(ctx, &env.Agent.KubernetesAgentOutput); err != nil { + return err + } + dependsOnCrd = append(dependsOnCrd, ddaWithOperatorComp) + + } else { + operatorComp, err := operator.NewOperator(&awsEnv, kindClusterName, kubeProvider, operatorOpts...) + if err != nil { + return err + } + err = operatorComp.Export(ctx, nil) + if err != nil { + return err + } + } } else { env.Agent = nil } diff --git a/test/new-e2e/pkg/environments/aws/kubernetes/params.go b/test/new-e2e/pkg/environments/aws/kubernetes/params.go index 9f7e9f1c394ff..8a3d67abbe483 100644 --- a/test/new-e2e/pkg/environments/aws/kubernetes/params.go +++ b/test/new-e2e/pkg/environments/aws/kubernetes/params.go @@ -8,6 +8,8 @@ package awskubernetes import ( "fmt" + "github.com/DataDog/test-infra-definitions/components/datadog/agentwithoperatorparams" + "github.com/DataDog/test-infra-definitions/components/datadog/operatorparams" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/optional" @@ -25,13 +27,15 @@ import ( // ProvisionerParams contains all the parameters needed to create the environment type ProvisionerParams struct { - name string - vmOptions []ec2.VMOption - agentOptions []kubernetesagentparams.Option - fakeintakeOptions []fakeintake.Option - eksOptions []eks.Option - extraConfigParams runner.ConfigMap - workloadAppFuncs []WorkloadAppFunc + name string + vmOptions []ec2.VMOption + agentOptions []kubernetesagentparams.Option + fakeintakeOptions []fakeintake.Option + eksOptions []eks.Option + extraConfigParams runner.ConfigMap + workloadAppFuncs []WorkloadAppFunc + operatorOptions []operatorparams.Option + operatorDDAOptions []agentwithoperatorparams.Option eksLinuxNodeGroup bool eksLinuxARMNodeGroup bool @@ -40,23 +44,27 @@ type ProvisionerParams struct { awsEnv *aws.Environment deployDogstatsd bool deployTestWorkload bool + deployOperator bool } func newProvisionerParams() *ProvisionerParams { return &ProvisionerParams{ - name: defaultVMName, - vmOptions: []ec2.VMOption{}, - agentOptions: []kubernetesagentparams.Option{}, - fakeintakeOptions: []fakeintake.Option{}, - eksOptions: []eks.Option{}, - extraConfigParams: runner.ConfigMap{}, - workloadAppFuncs: []WorkloadAppFunc{}, + name: defaultVMName, + vmOptions: []ec2.VMOption{}, + agentOptions: []kubernetesagentparams.Option{}, + fakeintakeOptions: []fakeintake.Option{}, + eksOptions: []eks.Option{}, + extraConfigParams: runner.ConfigMap{}, + workloadAppFuncs: []WorkloadAppFunc{}, + operatorOptions: []operatorparams.Option{}, + operatorDDAOptions: []agentwithoperatorparams.Option{}, eksLinuxNodeGroup: false, eksLinuxARMNodeGroup: false, eksBottlerocketNodeGroup: false, eksWindowsNodeGroup: false, deployDogstatsd: false, + deployOperator: false, } } @@ -171,3 +179,25 @@ func WithAwsEnv(env *aws.Environment) ProvisionerOption { return nil } } + +// WithOperator Deploys the Datadog Operator +func WithOperator() ProvisionerOption { + return func(params *ProvisionerParams) error { + params.deployOperator = true + return nil + } +} + +func WithOperatorOptions(opts ...operatorparams.Option) ProvisionerOption { + return func(params *ProvisionerParams) error { + params.operatorOptions = opts + return nil + } +} + +func WithOperatorDDAOptions(opts ...agentwithoperatorparams.Option) ProvisionerOption { + return func(params *ProvisionerParams) error { + params.operatorDDAOptions = opts + return nil + } +} From 24c789a5f4f9ae5456ff7b3934f0867a0ecf5e27 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Mon, 18 Nov 2024 19:09:14 -0500 Subject: [PATCH 03/10] fix namespace --- test/new-e2e/examples/kind_local_operator_test.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/test/new-e2e/examples/kind_local_operator_test.go b/test/new-e2e/examples/kind_local_operator_test.go index dda9c1766a9e2..49f3f7fb738b5 100644 --- a/test/new-e2e/examples/kind_local_operator_test.go +++ b/test/new-e2e/examples/kind_local_operator_test.go @@ -25,6 +25,8 @@ import ( "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes" ) +const namespace = "e2e-operator" + type localKindOperatorSuite struct { e2e.BaseSuite[environments.Kubernetes] } @@ -41,8 +43,7 @@ func localKindOperatorProvisioner() e2e.PulumiEnvRunFunc[environments.Kubernetes return err } - err = kindCluster.Export(ctx, &env.KubernetesCluster.ClusterOutput) - if err != nil { + if err := kindCluster.Export(ctx, &env.KubernetesCluster.ClusterOutput); err != nil { return err } @@ -55,14 +56,11 @@ func localKindOperatorProvisioner() e2e.PulumiEnvRunFunc[environments.Kubernetes return err } - namespace := "e2e-operator" - fakeIntake, err := fakeintakeComp.NewLocalDockerFakeintake(&kindEnv, "fakeintake") if err != nil { return err } - err = fakeIntake.Export(ctx, &env.FakeIntake.FakeintakeOutput) - if err != nil { + if err := fakeIntake.Export(ctx, &env.FakeIntake.FakeintakeOutput); err != nil { return err } @@ -108,7 +106,7 @@ func TestOperatorKindSuite(t *testing.T) { } func (k *localKindOperatorSuite) TestClusterAgentInstalled() { - res, _ := k.Env().KubernetesCluster.Client().CoreV1().Pods("blahblah").List(context.TODO(), v1.ListOptions{}) + res, _ := k.Env().KubernetesCluster.Client().CoreV1().Pods(namespace).List(context.TODO(), v1.ListOptions{}) containsClusterAgent := false for _, pod := range res.Items { if strings.Contains(pod.Name, "cluster-agent") { From f16fdfa22099f62e3eef84cbae6d83422a1fd285 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Tue, 3 Dec 2024 15:00:04 -0500 Subject: [PATCH 04/10] add ddaconfig --- .../examples/kind_local_operator_test.go | 25 ++++++++-- test/new-e2e/examples/kind_operator_test.go | 9 +++- test/new-e2e/go.mod | 1 + test/new-e2e/go.sum | 2 - test/new-e2e/pkg/components/operator.go | 15 ++++++ .../pkg/environments/aws/kubernetes/kind.go | 47 ++++++++++--------- 6 files changed, 67 insertions(+), 32 deletions(-) create mode 100644 test/new-e2e/pkg/components/operator.go diff --git a/test/new-e2e/examples/kind_local_operator_test.go b/test/new-e2e/examples/kind_local_operator_test.go index 49f3f7fb738b5..1c38f8d8212a7 100644 --- a/test/new-e2e/examples/kind_local_operator_test.go +++ b/test/new-e2e/examples/kind_local_operator_test.go @@ -10,6 +10,7 @@ import ( "github.com/DataDog/test-infra-definitions/components/datadog/agent" "github.com/DataDog/test-infra-definitions/components/datadog/agentwithoperatorparams" fakeintakeComp "github.com/DataDog/test-infra-definitions/components/datadog/fakeintake" + "github.com/DataDog/test-infra-definitions/components/datadog/operator" "github.com/DataDog/test-infra-definitions/components/datadog/operatorparams" compkube "github.com/DataDog/test-infra-definitions/components/kubernetes" "github.com/DataDog/test-infra-definitions/resources/local" @@ -71,12 +72,25 @@ func localKindOperatorProvisioner() e2e.PulumiEnvRunFunc[environments.Kubernetes operatorparams.WithNamespace(namespace), ) - customDDA := ` + // Create Operator component + _, err = operator.NewOperator(&kindEnv, kindEnv.CommonNamer().ResourceName("dd-operator-agent"), kindKubeProvider, operatorOpts...) + + if err != nil { + return err + } + + customDDA := agentwithoperatorparams.DDAConfig{ + Name: "apm-enabled-no-ccr", + YamlConfig: ` +apiVersion: datadoghq.com/v2alpha1 +kind: DatadogAgent spec: features: apm: enabled: true -` +`, + } + // Setup DDA options ddaOptions := make([]agentwithoperatorparams.Option, 0) ddaOptions = append( @@ -84,16 +98,17 @@ spec: agentwithoperatorparams.WithNamespace(namespace), agentwithoperatorparams.WithTLSKubeletVerify(false), agentwithoperatorparams.WithDDAConfig(customDDA), + agentwithoperatorparams.WithFakeIntake(fakeIntake), ) // Create Datadog Agent with Operator component - operatorAgentComponent, err := agent.NewDDAWithOperator(&kindEnv, kindEnv.CommonNamer().ResourceName("dd-operator-agent"), kindKubeProvider, operatorOpts, ddaOptions...) + agentComponent, err := agent.NewDDAWithOperator(&kindEnv, kindEnv.CommonNamer().ResourceName("dd-operator-agent"), kindKubeProvider, ddaOptions...) if err != nil { return err } - if err := operatorAgentComponent.Export(ctx, &env.Agent.KubernetesAgentOutput); err != nil { + if err = agentComponent.Export(ctx, &env.Agent.KubernetesAgentOutput); err != nil { return err } @@ -102,7 +117,7 @@ spec: } func TestOperatorKindSuite(t *testing.T) { - e2e.Run(t, &localKindOperatorSuite{}, e2e.WithPulumiProvisioner(localKindOperatorProvisioner(), nil)) + e2e.Run(t, &localKindOperatorSuite{}, e2e.WithPulumiProvisioner(localKindOperatorProvisioner(), nil), e2e.WithDevMode(), e2e.WithSkipDeleteOnFailure()) } func (k *localKindOperatorSuite) TestClusterAgentInstalled() { diff --git a/test/new-e2e/examples/kind_operator_test.go b/test/new-e2e/examples/kind_operator_test.go index 95398ba062253..ce7e8a68ce673 100644 --- a/test/new-e2e/examples/kind_operator_test.go +++ b/test/new-e2e/examples/kind_operator_test.go @@ -23,12 +23,17 @@ type kindOperatorSuite struct { } func TestKindOperatorSuite(t *testing.T) { - customDDA := ` + customDDA := agentwithoperatorparams.DDAConfig{ + Name: "apm-enabled-no-ccr", + YamlConfig: ` +apiVersion: datadoghq.com/v2alpha1 +kind: DatadogAgent spec: features: apm: enabled: true -` +`, +} e2e.Run(t, &kindOperatorSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner( awskubernetes.WithOperator(), diff --git a/test/new-e2e/go.mod b/test/new-e2e/go.mod index e47fe7ee5c9ec..2639211bcb5dd 100644 --- a/test/new-e2e/go.mod +++ b/test/new-e2e/go.mod @@ -42,6 +42,7 @@ replace ( github.com/DataDog/datadog-agent/pkg/util/winutil => ../../pkg/util/winutil github.com/DataDog/datadog-agent/pkg/version => ../../pkg/version github.com/DataDog/datadog-agent/test/fakeintake => ../fakeintake + github.com/DataDog/test-infra-definitions => ../../../test-infra-definitions ) require ( diff --git a/test/new-e2e/go.sum b/test/new-e2e/go.sum index 74832cbdfb656..345352c1510ed 100644 --- a/test/new-e2e/go.sum +++ b/test/new-e2e/go.sum @@ -16,8 +16,6 @@ github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= github.com/DataDog/mmh3 v0.0.0-20200805151601-30884ca2197a h1:m9REhmyaWD5YJ0P53ygRHxKKo+KM+nw+zz0hEdKztMo= github.com/DataDog/mmh3 v0.0.0-20200805151601-30884ca2197a/go.mod h1:SvsjzyJlSg0rKsqYgdcFxeEVflx3ZNAyFfkUHP0TxXg= -github.com/DataDog/test-infra-definitions v0.0.0-20241115164330-7cd5e8a62570 h1:vVkrzQIPIhgxZP+GMd+9UhILnZTj1Uf4wZlxhcDGysA= -github.com/DataDog/test-infra-definitions v0.0.0-20241115164330-7cd5e8a62570/go.mod h1:l0n0FQYdWWQxbI5a2EkuynRQIteUQcYOaOhdxD9TvJs= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/DataDog/zstd_0 v0.0.0-20210310093942-586c1286621f h1:5Vuo4niPKFkfwW55jV4vY0ih3VQ9RaQqeqY67fvRn8A= diff --git a/test/new-e2e/pkg/components/operator.go b/test/new-e2e/pkg/components/operator.go new file mode 100644 index 0000000000000..4fc9e4be0332f --- /dev/null +++ b/test/new-e2e/pkg/components/operator.go @@ -0,0 +1,15 @@ +// 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 components + +import ( + "github.com/DataDog/test-infra-definitions/components/datadog/operator" +) + +// Operator is a Datadog Operator running in a Kubernetes cluster +type Operator struct { + operator.OperatorOutput +} diff --git a/test/new-e2e/pkg/environments/aws/kubernetes/kind.go b/test/new-e2e/pkg/environments/aws/kubernetes/kind.go index 19a0a82e46f9f..c9fb1bb3cf0d8 100644 --- a/test/new-e2e/pkg/environments/aws/kubernetes/kind.go +++ b/test/new-e2e/pkg/environments/aws/kubernetes/kind.go @@ -9,6 +9,7 @@ package awskubernetes import ( "context" "fmt" + "github.com/DataDog/test-infra-definitions/components/datadog/agent" "github.com/DataDog/test-infra-definitions/components/datadog/agentwithoperatorparams" "github.com/DataDog/test-infra-definitions/components/datadog/operator" @@ -164,34 +165,34 @@ agents: params.operatorOptions..., ) - if params.operatorDDAOptions != nil && params.deployOperator { - ddaOptions := make([]agentwithoperatorparams.Option, 0) - ddaOptions = append( - ddaOptions, - params.operatorDDAOptions..., - ) + operatorComp, err := operator.NewOperator(&awsEnv, kindClusterName, kubeProvider, operatorOpts...) + if err != nil { + return err + } + err = operatorComp.Export(ctx, nil) + if err != nil { + return err + } + } - ddaWithOperatorComp, err := agent.NewDDAWithOperator(&awsEnv, awsEnv.CommonNamer().ResourceName("dd-operator-agent"), kubeProvider, operatorOpts, ddaOptions...) + if params.operatorDDAOptions != nil { + ddaOptions := make([]agentwithoperatorparams.Option, 0) + ddaOptions = append( + ddaOptions, + params.operatorDDAOptions..., + ) - if err != nil { - return err - } + ddaWithOperatorComp, err := agent.NewDDAWithOperator(&awsEnv, awsEnv.CommonNamer().ResourceName("dd-operator-agent"), kubeProvider, ddaOptions...) - if err := ddaWithOperatorComp.Export(ctx, &env.Agent.KubernetesAgentOutput); err != nil { - return err - } - dependsOnCrd = append(dependsOnCrd, ddaWithOperatorComp) + if err != nil { + return err + } - } else { - operatorComp, err := operator.NewOperator(&awsEnv, kindClusterName, kubeProvider, operatorOpts...) - if err != nil { - return err - } - err = operatorComp.Export(ctx, nil) - if err != nil { - return err - } + if err := ddaWithOperatorComp.Export(ctx, &env.Agent.KubernetesAgentOutput); err != nil { + return err } + dependsOnCrd = append(dependsOnCrd, ddaWithOperatorComp) + } else { env.Agent = nil } From 2373652952e43fe369c99f155d5563994d739824 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Mon, 9 Dec 2024 14:05:17 -0500 Subject: [PATCH 05/10] more refactor --- .../examples/kind_local_operator_test.go | 12 ++-- test/new-e2e/examples/kind_operator_test.go | 39 +++++++++---- test/new-e2e/go.mod | 13 ++--- test/new-e2e/go.sum | 28 ++++------ .../pkg/environments/aws/kubernetes/kind.go | 55 +++++++++---------- .../pkg/environments/aws/kubernetes/params.go | 11 ++++ 6 files changed, 90 insertions(+), 68 deletions(-) diff --git a/test/new-e2e/examples/kind_local_operator_test.go b/test/new-e2e/examples/kind_local_operator_test.go index 1c38f8d8212a7..3996002614363 100644 --- a/test/new-e2e/examples/kind_local_operator_test.go +++ b/test/new-e2e/examples/kind_local_operator_test.go @@ -26,7 +26,7 @@ import ( "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes" ) -const namespace = "e2e-operator" +const namespace = "datadog" type localKindOperatorSuite struct { e2e.BaseSuite[environments.Kubernetes] @@ -65,7 +65,7 @@ func localKindOperatorProvisioner() e2e.PulumiEnvRunFunc[environments.Kubernetes return err } - // Setup operator options + // Setup default operator options operatorOpts := make([]operatorparams.Option, 0) operatorOpts = append( operatorOpts, @@ -85,6 +85,9 @@ func localKindOperatorProvisioner() e2e.PulumiEnvRunFunc[environments.Kubernetes apiVersion: datadoghq.com/v2alpha1 kind: DatadogAgent spec: + global: + kubelet: + tlsVerify: false features: apm: enabled: true @@ -95,9 +98,8 @@ spec: ddaOptions := make([]agentwithoperatorparams.Option, 0) ddaOptions = append( ddaOptions, - agentwithoperatorparams.WithNamespace(namespace), - agentwithoperatorparams.WithTLSKubeletVerify(false), agentwithoperatorparams.WithDDAConfig(customDDA), + agentwithoperatorparams.WithNamespace(namespace), agentwithoperatorparams.WithFakeIntake(fakeIntake), ) @@ -117,7 +119,7 @@ spec: } func TestOperatorKindSuite(t *testing.T) { - e2e.Run(t, &localKindOperatorSuite{}, e2e.WithPulumiProvisioner(localKindOperatorProvisioner(), nil), e2e.WithDevMode(), e2e.WithSkipDeleteOnFailure()) + e2e.Run(t, &localKindOperatorSuite{}, e2e.WithPulumiProvisioner(localKindOperatorProvisioner(), nil)) } func (k *localKindOperatorSuite) TestClusterAgentInstalled() { diff --git a/test/new-e2e/examples/kind_operator_test.go b/test/new-e2e/examples/kind_operator_test.go index ce7e8a68ce673..50fe0b164d018 100644 --- a/test/new-e2e/examples/kind_operator_test.go +++ b/test/new-e2e/examples/kind_operator_test.go @@ -9,9 +9,11 @@ import ( "context" awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" "github.com/DataDog/test-infra-definitions/components/datadog/agentwithoperatorparams" + "github.com/DataDog/test-infra-definitions/components/datadog/operatorparams" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "strings" "testing" + "time" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" @@ -24,32 +26,45 @@ type kindOperatorSuite struct { func TestKindOperatorSuite(t *testing.T) { customDDA := agentwithoperatorparams.DDAConfig{ - Name: "apm-enabled-no-ccr", + Name: "apm-enabled", YamlConfig: ` apiVersion: datadoghq.com/v2alpha1 kind: DatadogAgent spec: + global: + kubelet: + tlsVerify: false features: apm: enabled: true `, -} + } e2e.Run(t, &kindOperatorSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner( awskubernetes.WithOperator(), - awskubernetes.WithOperatorDDAOptions(agentwithoperatorparams.WithDDAConfig(customDDA)), + awskubernetes.WithOperatorOptions([]operatorparams.Option{ + operatorparams.WithNamespace("datadog"), + }...), + awskubernetes.WithOperatorDDAOptions([]agentwithoperatorparams.Option{ + agentwithoperatorparams.WithNamespace("datadog"), + agentwithoperatorparams.WithDDAConfig(customDDA), + }...), )), - ) + e2e.WithDevMode(), e2e.WithSkipDeleteOnFailure()) } func (v *kindOperatorSuite) TestClusterAgentInstalled() { - res, _ := v.Env().KubernetesCluster.Client().CoreV1().Pods("datadog").List(context.TODO(), v1.ListOptions{}) - containsClusterAgent := false - for _, pod := range res.Items { - if strings.Contains(pod.Name, "cluster-agent") { - containsClusterAgent = true - break + v.EventuallyWithT(func(c *assert.CollectT) { + res, _ := v.Env().KubernetesCluster.Client().CoreV1().Pods("datadog").List(context.TODO(), v1.ListOptions{ + FieldSelector: "status.phase=Running", + }) + containsClusterAgent := false + for _, pod := range res.Items { + if strings.Contains(pod.Name, "cluster-agent") { + containsClusterAgent = true + break + } } - } - assert.True(v.T(), containsClusterAgent, "Cluster Agent not found") + assert.True(v.T(), containsClusterAgent, "Cluster Agent not found") + }, 30*time.Second, 15*time.Second) } diff --git a/test/new-e2e/go.mod b/test/new-e2e/go.mod index 4d89d9cd9c391..0e3356702c913 100644 --- a/test/new-e2e/go.mod +++ b/test/new-e2e/go.mod @@ -75,8 +75,7 @@ require ( github.com/pkg/sftp v1.13.6 github.com/pulumi/pulumi-aws/sdk/v6 v6.56.1 github.com/pulumi/pulumi-awsx/sdk/v2 v2.16.1 - github.com/pulumi/pulumi-eks/sdk/v2 v2.8.1 // indirect - github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.17.1 + github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.18.3 github.com/pulumi/pulumi/sdk/v3 v3.140.0 github.com/samber/lo v1.47.0 github.com/stretchr/testify v1.10.0 @@ -304,13 +303,13 @@ require ( github.com/moby/docker-image-spec v1.3.1 // indirect github.com/onsi/ginkgo/v2 v2.20.2 // indirect github.com/onsi/gomega v1.34.1 // indirect - github.com/pulumi/pulumi-azure-native-sdk/authorization/v2 v2.67.0 // indirect - github.com/pulumi/pulumi-azure-native-sdk/compute/v2 v2.56.0 // indirect - github.com/pulumi/pulumi-azure-native-sdk/containerservice/v2 v2.67.0 // indirect + github.com/pulumi/pulumi-azure-native-sdk/authorization/v2 v2.73.1 // indirect + github.com/pulumi/pulumi-azure-native-sdk/compute/v2 v2.73.1 // indirect + github.com/pulumi/pulumi-azure-native-sdk/containerservice/v2 v2.73.1 // indirect github.com/pulumi/pulumi-azure-native-sdk/managedidentity/v2 v2.73.1 // indirect - github.com/pulumi/pulumi-azure-native-sdk/network/v2 v2.67.0 // indirect + github.com/pulumi/pulumi-azure-native-sdk/network/v2 v2.73.1 // indirect github.com/pulumi/pulumi-azure-native-sdk/v2 v2.73.1 // indirect - github.com/pulumi/pulumi-gcp/sdk/v6 v6.67.1 // indirect + github.com/pulumi/pulumi-eks/sdk/v3 v3.3.0 // indirect github.com/pulumi/pulumi-gcp/sdk/v7 v7.38.0 // indirect github.com/twinj/uuid v0.0.0-20151029044442-89173bcdda19 // indirect github.com/x448/float16 v0.8.4 // indirect diff --git a/test/new-e2e/go.sum b/test/new-e2e/go.sum index e36e556cf02ed..bc044e2579ffa 100644 --- a/test/new-e2e/go.sum +++ b/test/new-e2e/go.sum @@ -17,8 +17,6 @@ github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= github.com/DataDog/mmh3 v0.0.0-20210722141835-012dc69a9e49 h1:EbzDX8HPk5uE2FsJYxD74QmMw0/3CqSKhEr6teh0ncQ= github.com/DataDog/mmh3 v0.0.0-20210722141835-012dc69a9e49/go.mod h1:SvsjzyJlSg0rKsqYgdcFxeEVflx3ZNAyFfkUHP0TxXg= -github.com/DataDog/test-infra-definitions v0.0.0-20241129143439-1f340fd450e3 h1:s+bNaiOoY3W7vCSQVqD4mU3mrtXsbkeRX+vVTwCyStQ= -github.com/DataDog/test-infra-definitions v0.0.0-20241129143439-1f340fd450e3/go.mod h1:7nVt9okOqKKC9B9YfKqk4jitYuv1I3q2Cd/yZWuViZU= github.com/DataDog/zstd v1.5.6 h1:LbEglqepa/ipmmQJUDnSsfvA8e8IStVcGaFWDuxvGOY= github.com/DataDog/zstd v1.5.6/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/DataDog/zstd_0 v0.0.0-20210310093942-586c1286621f h1:5Vuo4niPKFkfwW55jV4vY0ih3VQ9RaQqeqY67fvRn8A= @@ -405,30 +403,28 @@ github.com/pulumi/pulumi-aws/sdk/v6 v6.56.1 h1:wA38Ep4sEphX+3YGwFfaxRHs7NQv8dNOb github.com/pulumi/pulumi-aws/sdk/v6 v6.56.1/go.mod h1:m/ejZ2INurqq/ncDjJfgC1Ff/lnbt0J/uO33BnPVots= github.com/pulumi/pulumi-awsx/sdk/v2 v2.16.1 h1:6082hB+ILpPB/0V5F+LTmHbX1BO54tCVOQCVOL/FYI4= github.com/pulumi/pulumi-awsx/sdk/v2 v2.16.1/go.mod h1:z2bnBPHNYfk72IW1P01H9qikBtBSBhCwi3QpH6Y/38Q= -github.com/pulumi/pulumi-azure-native-sdk/authorization/v2 v2.67.0 h1:mgmmbFEoc1YOu81K9Bl/MVWE8cGloEdiCeIw394vXcM= -github.com/pulumi/pulumi-azure-native-sdk/authorization/v2 v2.67.0/go.mod h1:WmvulRFoc+dOk/el9y6u7z3CvA+yljL8HJXajmvZTYo= -github.com/pulumi/pulumi-azure-native-sdk/compute/v2 v2.56.0 h1:MFOd6X9FPlixzriy14fBHv7pFCCh/mu1pwHtSSjqfJ4= -github.com/pulumi/pulumi-azure-native-sdk/compute/v2 v2.56.0/go.mod h1:453Ff5wNscroYfq+zxME7Nbt7HdZv+dh0zLZwLyGBws= -github.com/pulumi/pulumi-azure-native-sdk/containerservice/v2 v2.67.0 h1:jvruQQSO1ESk7APFQ3mAge7C9SWKU9nbBHrilcyeSGU= -github.com/pulumi/pulumi-azure-native-sdk/containerservice/v2 v2.67.0/go.mod h1:d5nmekK1mrjM9Xo/JGGVlAs7mqqftBo3DmKji+1zbmw= +github.com/pulumi/pulumi-azure-native-sdk/authorization/v2 v2.73.1 h1:miIJy4njnFYw7VxMLvEztoMPr9zYC2kqBTwRlaFAf48= +github.com/pulumi/pulumi-azure-native-sdk/authorization/v2 v2.73.1/go.mod h1:LR1QBq0C1NIhmD9E0uKozCAu32j5qsamhrIsTSNVMS8= +github.com/pulumi/pulumi-azure-native-sdk/compute/v2 v2.73.1 h1:79HTKSE1uJQolCRUHRFnIbSPNSIhxekIhznHnjpLi6s= +github.com/pulumi/pulumi-azure-native-sdk/compute/v2 v2.73.1/go.mod h1:sN7rQ3n6T/KGaQqMXdoERPjiKzE8L89H6sFj1CSFk/U= +github.com/pulumi/pulumi-azure-native-sdk/containerservice/v2 v2.73.1 h1:8xyjq2nYeBNwqdIf0Su2DHprEMbW0Rs82ZliFNY+14o= +github.com/pulumi/pulumi-azure-native-sdk/containerservice/v2 v2.73.1/go.mod h1:UYRkyT4qRuQ39GPtyxE509zTVwbfunE/32npB0bhr1E= github.com/pulumi/pulumi-azure-native-sdk/managedidentity/v2 v2.73.1 h1:rkNZDAik+qlIhbmFoa09ln/oJMXey5+olw8ShmljgXc= github.com/pulumi/pulumi-azure-native-sdk/managedidentity/v2 v2.73.1/go.mod h1:P/N/xG2lVxsHdspmKjH+d8d4ln+2arXBmOl3zhjWnnw= -github.com/pulumi/pulumi-azure-native-sdk/network/v2 v2.67.0 h1:r26Xl6FdOJnbLs1ny9ekuRjFxAocZK8jS8SLrgXKEFE= -github.com/pulumi/pulumi-azure-native-sdk/network/v2 v2.67.0/go.mod h1:8yXZtmHe2Zet5pb8gZ7D730d0VAm4kYUdwCj7sjhz6g= +github.com/pulumi/pulumi-azure-native-sdk/network/v2 v2.73.1 h1:glI1LKNu/erhOZpHq7/tdwMwerZxHKv6Xaaz4ILvKAs= +github.com/pulumi/pulumi-azure-native-sdk/network/v2 v2.73.1/go.mod h1:Ckfh040vb9BE28NMNQcjYleSYAhaFhz2+E9gFYEDUGc= github.com/pulumi/pulumi-azure-native-sdk/v2 v2.73.1 h1:yzXxwwq3tHdtSOi5vjKmKXq7HyKvDaKulF53MFTMbh8= github.com/pulumi/pulumi-azure-native-sdk/v2 v2.73.1/go.mod h1:ChjIUNDNeN6jI33ZOivHUFqM6purDiLP01mghMGe1Fs= github.com/pulumi/pulumi-command/sdk v1.0.1 h1:ZuBSFT57nxg/fs8yBymUhKLkjJ6qmyN3gNvlY/idiN0= github.com/pulumi/pulumi-command/sdk v1.0.1/go.mod h1:C7sfdFbUIoXKoIASfXUbP/U9xnwPfxvz8dBpFodohlA= github.com/pulumi/pulumi-docker/sdk/v4 v4.5.5 h1:7OjAfgLz5PAy95ynbgPAlWls5WBe4I/QW/61TdPWRlQ= github.com/pulumi/pulumi-docker/sdk/v4 v4.5.5/go.mod h1:XZKLFXbw13olxuztlWnmVUPYZp2a+BqzqhuMl0j/Ow8= -github.com/pulumi/pulumi-eks/sdk/v2 v2.8.1 h1:upeongxe3/2oCO2BHq78qqQbO7SGJz9rnp/KyDmJwqs= -github.com/pulumi/pulumi-eks/sdk/v2 v2.8.1/go.mod h1:ARGNnIZENIpDUVSX21JEQJKrESj/0u0r0iT61rpb86I= -github.com/pulumi/pulumi-gcp/sdk/v6 v6.67.1 h1:PUH/sUbJmBmHjNFNthJ/dW2+riFuJV0FhrGAwuUuRIg= -github.com/pulumi/pulumi-gcp/sdk/v6 v6.67.1/go.mod h1:OmZeji3dNMwB1qldAlaQfcfJPc2BaZyweVGH7Ej4SJg= +github.com/pulumi/pulumi-eks/sdk/v3 v3.3.0 h1:F3xAOBZ/In4PqydTsKeg3tou/c5FZ+JTp5dQO0oMjqE= +github.com/pulumi/pulumi-eks/sdk/v3 v3.3.0/go.mod h1:QbAamxfUpDJC81BGtyEuV0P88RrdbOjQEhbgY+OOPpg= github.com/pulumi/pulumi-gcp/sdk/v7 v7.38.0 h1:21oSj+TKlKTzQcxN9Hik7iSNNHPUQXN4s3itOnahy/w= github.com/pulumi/pulumi-gcp/sdk/v7 v7.38.0/go.mod h1:YaEZms1NgXFqGhObKVofcAeWXu2V+3t/BAXdHQZq7fU= -github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.17.1 h1:VDX+hu+qK3fbf2FodgG5kfh2h1bHK0FKirW1YqKWkRc= -github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.17.1/go.mod h1:e69ohZtUePLLYNLXYgiOWp0FvRGg6ya/3fsq3o00nN0= +github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.18.3 h1:quqoGsLbF7lpGpGU4mi5WfVLIAo4gfvoQeYYmemx1Dg= +github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.18.3/go.mod h1:9dBA6+rtpKmyZB3k1XryUOHDOuNdoTODFKEEZZCtrz8= github.com/pulumi/pulumi-libvirt/sdk v0.4.7 h1:/BBnqqx/Gbg2vINvJxXIVb58THXzw2lSqFqxlRSXH9M= github.com/pulumi/pulumi-libvirt/sdk v0.4.7/go.mod h1:VKvjhAm1sGtzKZruYwIhgascabEx7+oVVRCoxp/cPi4= github.com/pulumi/pulumi-random/sdk/v4 v4.16.7 h1:39rhOe/PTUGMYia8pR5T2wbxxMt2pwrlonf0ncYKSzE= diff --git a/test/new-e2e/pkg/environments/aws/kubernetes/kind.go b/test/new-e2e/pkg/environments/aws/kubernetes/kind.go index 1e00b17f0c5b5..e77f05d3f8dcc 100644 --- a/test/new-e2e/pkg/environments/aws/kubernetes/kind.go +++ b/test/new-e2e/pkg/environments/aws/kubernetes/kind.go @@ -9,14 +9,12 @@ package awskubernetes import ( "context" "fmt" - + "github.com/DataDog/test-infra-definitions/common/utils" "github.com/DataDog/test-infra-definitions/components/datadog/agent" "github.com/DataDog/test-infra-definitions/components/datadog/agentwithoperatorparams" "github.com/DataDog/test-infra-definitions/components/datadog/operator" "github.com/DataDog/test-infra-definitions/components/datadog/operatorparams" - "github.com/DataDog/test-infra-definitions/common/utils" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/optional" @@ -128,12 +126,14 @@ func KindRunFunc(ctx *pulumi.Context, env *environments.Kubernetes, params *Prov newOpts := []kubernetesagentparams.Option{kubernetesagentparams.WithFakeintake(fakeIntake)} params.agentOptions = append(newOpts, params.agentOptions...) } + if params.operatorDDAOptions != nil { + newDdaOpts := []agentwithoperatorparams.Option{agentwithoperatorparams.WithFakeIntake(fakeIntake)} + params.operatorDDAOptions = append(newDdaOpts, params.operatorDDAOptions...) + } } else { env.FakeIntake = nil } - kindClusterName := ctx.Stack() - var dependsOnCrd []pulumi.Resource if params.agentOptions != nil && !params.deployOperator { helmValues := ` @@ -164,7 +164,7 @@ agents: params.operatorOptions..., ) - operatorComp, err := operator.NewOperator(&awsEnv, kindClusterName, kubeProvider, operatorOpts...) + operatorComp, err := operator.NewOperator(&awsEnv, awsEnv.Namer.ResourceName("dd-operator"), kubeProvider, operatorOpts...) if err != nil { return err } @@ -174,28 +174,6 @@ agents: } } - if params.operatorDDAOptions != nil { - ddaOptions := make([]agentwithoperatorparams.Option, 0) - ddaOptions = append( - ddaOptions, - params.operatorDDAOptions..., - ) - - ddaWithOperatorComp, err := agent.NewDDAWithOperator(&awsEnv, awsEnv.CommonNamer().ResourceName("dd-operator-agent"), kubeProvider, ddaOptions...) - - if err != nil { - return err - } - - if err := ddaWithOperatorComp.Export(ctx, &env.Agent.KubernetesAgentOutput); err != nil { - return err - } - dependsOnCrd = append(dependsOnCrd, ddaWithOperatorComp) - - } else { - env.Agent = nil - } - if params.deployDogstatsd { if _, err := dogstatsdstandalone.K8sAppDefinition(&awsEnv, kubeProvider, "dogstatsd-standalone", fakeIntake, false, ctx.Stack()); err != nil { return err @@ -250,5 +228,26 @@ agents: } } + if params.operatorDDAOptions != nil { + ddaOptions := make([]agentwithoperatorparams.Option, 0) + ddaOptions = append( + ddaOptions, + params.operatorDDAOptions..., + ) + + ddaWithOperatorComp, err := agent.NewDDAWithOperator(&awsEnv, awsEnv.CommonNamer().ResourceName("dd-operator-agent"), kubeProvider, ddaOptions...) + if err != nil { + return err + } + + if err := ddaWithOperatorComp.Export(ctx, &env.Agent.KubernetesAgentOutput); err != nil { + return err + } + dependsOnCrd = append(dependsOnCrd, ddaWithOperatorComp) + + } else { + env.Agent = nil + } + return nil } diff --git a/test/new-e2e/pkg/environments/aws/kubernetes/params.go b/test/new-e2e/pkg/environments/aws/kubernetes/params.go index 8a3d67abbe483..833899ce7b1f3 100644 --- a/test/new-e2e/pkg/environments/aws/kubernetes/params.go +++ b/test/new-e2e/pkg/environments/aws/kubernetes/params.go @@ -188,6 +188,7 @@ func WithOperator() ProvisionerOption { } } +// WithOperatorOptions Configures the Datadog Operator func WithOperatorOptions(opts ...operatorparams.Option) ProvisionerOption { return func(params *ProvisionerParams) error { params.operatorOptions = opts @@ -195,9 +196,19 @@ func WithOperatorOptions(opts ...operatorparams.Option) ProvisionerOption { } } +// WithOperatorDDAOptions Configures the DatadogAgent custom resource func WithOperatorDDAOptions(opts ...agentwithoperatorparams.Option) ProvisionerOption { return func(params *ProvisionerParams) error { params.operatorDDAOptions = opts return nil } } + +// WithoutDDA removes the DatadogAgent custom resource +func WithoutDDA() ProvisionerOption { + return func(params *ProvisionerParams) error { + params.operatorDDAOptions = nil + params.agentOptions = nil + return nil + } +} From d3460c157c8bf8a0f6b115f1df5d08f82054114c Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Mon, 9 Dec 2024 18:27:23 -0500 Subject: [PATCH 06/10] use default namespace --- test/new-e2e/examples/kind_operator_test.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/test/new-e2e/examples/kind_operator_test.go b/test/new-e2e/examples/kind_operator_test.go index 50fe0b164d018..d9a0eb1236a57 100644 --- a/test/new-e2e/examples/kind_operator_test.go +++ b/test/new-e2e/examples/kind_operator_test.go @@ -9,7 +9,6 @@ import ( "context" awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" "github.com/DataDog/test-infra-definitions/components/datadog/agentwithoperatorparams" - "github.com/DataDog/test-infra-definitions/components/datadog/operatorparams" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "strings" "testing" @@ -42,11 +41,7 @@ spec: e2e.Run(t, &kindOperatorSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner( awskubernetes.WithOperator(), - awskubernetes.WithOperatorOptions([]operatorparams.Option{ - operatorparams.WithNamespace("datadog"), - }...), awskubernetes.WithOperatorDDAOptions([]agentwithoperatorparams.Option{ - agentwithoperatorparams.WithNamespace("datadog"), agentwithoperatorparams.WithDDAConfig(customDDA), }...), )), From df5e41110ea1abe6bad9a1e781067f7a37ea3d09 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Tue, 17 Dec 2024 14:10:23 -0500 Subject: [PATCH 07/10] update kind operator tests, fix operator e2e component --- .gitlab/common/test_infra_version.yml | 2 +- .../examples/kind_local_operator_test.go | 28 ++++--- test/new-e2e/examples/kind_operator_test.go | 35 ++++---- test/new-e2e/go.mod | 45 +++++----- test/new-e2e/go.sum | 82 ++++++++++--------- test/new-e2e/pkg/components/operator.go | 2 +- .../pkg/environments/aws/kubernetes/kind.go | 4 +- 7 files changed, 98 insertions(+), 100 deletions(-) diff --git a/.gitlab/common/test_infra_version.yml b/.gitlab/common/test_infra_version.yml index 7844ff82e9ee3..e1cf4f424f04e 100644 --- a/.gitlab/common/test_infra_version.yml +++ b/.gitlab/common/test_infra_version.yml @@ -4,4 +4,4 @@ variables: # and check the job creating the image to make sure you have the right SHA prefix TEST_INFRA_DEFINITIONS_BUILDIMAGES_SUFFIX: "" # Make sure to update test-infra-definitions version in go.mod as well - TEST_INFRA_DEFINITIONS_BUILDIMAGES: 1f340fd450e3 + TEST_INFRA_DEFINITIONS_BUILDIMAGES: 10486aec63a8 diff --git a/test/new-e2e/examples/kind_local_operator_test.go b/test/new-e2e/examples/kind_local_operator_test.go index 3996002614363..ccb59885b7a35 100644 --- a/test/new-e2e/examples/kind_local_operator_test.go +++ b/test/new-e2e/examples/kind_local_operator_test.go @@ -14,6 +14,7 @@ import ( "github.com/DataDog/test-infra-definitions/components/datadog/operatorparams" compkube "github.com/DataDog/test-infra-definitions/components/kubernetes" "github.com/DataDog/test-infra-definitions/resources/local" + "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" "strings" "testing" @@ -23,7 +24,6 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes" ) const namespace = "datadog" @@ -57,6 +57,8 @@ func localKindOperatorProvisioner() e2e.PulumiEnvRunFunc[environments.Kubernetes return err } + kindCluster.KubeProvider = kindKubeProvider + fakeIntake, err := fakeintakeComp.NewLocalDockerFakeintake(&kindEnv, "fakeintake") if err != nil { return err @@ -73,14 +75,14 @@ func localKindOperatorProvisioner() e2e.PulumiEnvRunFunc[environments.Kubernetes ) // Create Operator component - _, err = operator.NewOperator(&kindEnv, kindEnv.CommonNamer().ResourceName("dd-operator-agent"), kindKubeProvider, operatorOpts...) + _, err = operator.NewOperator(&kindEnv, kindEnv.CommonNamer().ResourceName("dd-operator"), kindCluster.KubeProvider, operatorOpts...) if err != nil { return err } customDDA := agentwithoperatorparams.DDAConfig{ - Name: "apm-enabled-no-ccr", + Name: "ccr-enabled", YamlConfig: ` apiVersion: datadoghq.com/v2alpha1 kind: DatadogAgent @@ -89,8 +91,8 @@ spec: kubelet: tlsVerify: false features: - apm: - enabled: true + clusterChecks: + useClusterChecksRunners: true `, } @@ -104,13 +106,13 @@ spec: ) // Create Datadog Agent with Operator component - agentComponent, err := agent.NewDDAWithOperator(&kindEnv, kindEnv.CommonNamer().ResourceName("dd-operator-agent"), kindKubeProvider, ddaOptions...) + agentComponent, err := agent.NewDDAWithOperator(&kindEnv, ctx.Stack(), kindCluster.KubeProvider, ddaOptions...) if err != nil { return err } - - if err = agentComponent.Export(ctx, &env.Agent.KubernetesAgentOutput); err != nil { + err = agentComponent.Export(ctx, &env.Agent.KubernetesAgentOutput) + if err != nil { return err } @@ -122,14 +124,14 @@ func TestOperatorKindSuite(t *testing.T) { e2e.Run(t, &localKindOperatorSuite{}, e2e.WithPulumiProvisioner(localKindOperatorProvisioner(), nil)) } -func (k *localKindOperatorSuite) TestClusterAgentInstalled() { +func (k *localKindOperatorSuite) TestClusterChecksRunner() { res, _ := k.Env().KubernetesCluster.Client().CoreV1().Pods(namespace).List(context.TODO(), v1.ListOptions{}) - containsClusterAgent := false + containsCCR := false for _, pod := range res.Items { - if strings.Contains(pod.Name, "cluster-agent") { - containsClusterAgent = true + if strings.Contains(pod.Name, "cluster-checks-runner") { + containsCCR = true break } } - assert.True(k.T(), containsClusterAgent, "Cluster Agent not found") + assert.True(k.T(), containsCCR, "Cluster checks runner not found") } diff --git a/test/new-e2e/examples/kind_operator_test.go b/test/new-e2e/examples/kind_operator_test.go index d9a0eb1236a57..0241d966e8a6e 100644 --- a/test/new-e2e/examples/kind_operator_test.go +++ b/test/new-e2e/examples/kind_operator_test.go @@ -7,16 +7,14 @@ package examples import ( "context" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" "github.com/DataDog/test-infra-definitions/components/datadog/agentwithoperatorparams" + "github.com/stretchr/testify/assert" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "strings" "testing" - "time" - - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - "github.com/stretchr/testify/assert" ) type kindOperatorSuite struct { @@ -25,7 +23,7 @@ type kindOperatorSuite struct { func TestKindOperatorSuite(t *testing.T) { customDDA := agentwithoperatorparams.DDAConfig{ - Name: "apm-enabled", + Name: "ccr-enabled", YamlConfig: ` apiVersion: datadoghq.com/v2alpha1 kind: DatadogAgent @@ -34,8 +32,8 @@ spec: kubelet: tlsVerify: false features: - apm: - enabled: true + clusterChecks: + useClusterChecksRunners: true `, } @@ -44,22 +42,19 @@ spec: awskubernetes.WithOperatorDDAOptions([]agentwithoperatorparams.Option{ agentwithoperatorparams.WithDDAConfig(customDDA), }...), - )), - e2e.WithDevMode(), e2e.WithSkipDeleteOnFailure()) + ))) } -func (v *kindOperatorSuite) TestClusterAgentInstalled() { - v.EventuallyWithT(func(c *assert.CollectT) { - res, _ := v.Env().KubernetesCluster.Client().CoreV1().Pods("datadog").List(context.TODO(), v1.ListOptions{ - FieldSelector: "status.phase=Running", - }) - containsClusterAgent := false +func (k *kindOperatorSuite) TestClusterChecksRunner() { + { + res, _ := k.Env().KubernetesCluster.Client().CoreV1().Pods("datadog").List(context.TODO(), v1.ListOptions{}) + containsCCR := false for _, pod := range res.Items { - if strings.Contains(pod.Name, "cluster-agent") { - containsClusterAgent = true + if strings.Contains(pod.Name, "cluster-checks-runner") { + containsCCR = true break } } - assert.True(v.T(), containsClusterAgent, "Cluster Agent not found") - }, 30*time.Second, 15*time.Second) + assert.True(k.T(), containsCCR, "Cluster checks runner not found") + } } diff --git a/test/new-e2e/go.mod b/test/new-e2e/go.mod index 0e3356702c913..c0c3ed55dc644 100644 --- a/test/new-e2e/go.mod +++ b/test/new-e2e/go.mod @@ -40,13 +40,12 @@ replace ( github.com/DataDog/datadog-agent/pkg/util/winutil => ../../pkg/util/winutil github.com/DataDog/datadog-agent/pkg/version => ../../pkg/version github.com/DataDog/datadog-agent/test/fakeintake => ../fakeintake - github.com/DataDog/test-infra-definitions => ../../../test-infra-definitions ) require ( github.com/DataDog/agent-payload/v5 v5.0.137 github.com/DataDog/datadog-agent/comp/otelcol/ddflareextension/def v0.56.2 - github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.1 github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 github.com/DataDog/datadog-agent/pkg/util/testutil v0.56.2 @@ -59,9 +58,9 @@ require ( // `TEST_INFRA_DEFINITIONS_BUILDIMAGES` matches the commit sha in the module version // Example: github.com/DataDog/test-infra-definitions v0.0.0-YYYYMMDDHHmmSS-0123456789AB // => TEST_INFRA_DEFINITIONS_BUILDIMAGES: 0123456789AB - github.com/DataDog/test-infra-definitions v0.0.0-20241129143439-1f340fd450e3 - github.com/aws/aws-sdk-go-v2 v1.32.5 - github.com/aws/aws-sdk-go-v2/config v1.28.5 + github.com/DataDog/test-infra-definitions v0.0.0-20241217152533-10486aec63a8 + github.com/aws/aws-sdk-go-v2 v1.32.6 + github.com/aws/aws-sdk-go-v2/config v1.28.6 github.com/aws/aws-sdk-go-v2/service/ec2 v1.190.0 github.com/aws/aws-sdk-go-v2/service/eks v1.44.1 github.com/aws/aws-sdk-go-v2/service/ssm v1.50.7 @@ -110,23 +109,23 @@ require ( github.com/alessio/shellescape v1.4.2 // indirect github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect github.com/atotto/clipboard v0.1.4 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.6 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.17.46 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.20 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.24 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.24 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.17.47 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.21 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.19 // indirect - github.com/aws/aws-sdk-go-v2/service/ecr v1.36.2 // indirect - github.com/aws/aws-sdk-go-v2/service/ecs v1.47.4 + github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.25 // indirect + github.com/aws/aws-sdk-go-v2/service/ecr v1.36.7 // indirect + github.com/aws/aws-sdk-go-v2/service/ecs v1.52.2 github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.0 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.5 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.0 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.65.0 - github.com/aws/aws-sdk-go-v2/service/sso v1.24.6 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.5 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.33.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.6 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.71.0 + github.com/aws/aws-sdk-go-v2/service/sso v1.24.7 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.6 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.33.2 // indirect github.com/aws/smithy-go v1.22.1 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/blang/semver v3.5.1+incompatible // indirect @@ -220,8 +219,8 @@ require ( github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 // indirect github.com/pulumi/esc v0.10.0 // indirect github.com/pulumi/pulumi-command/sdk v1.0.1 // indirect - github.com/pulumi/pulumi-docker/sdk/v4 v4.5.5 // indirect - github.com/pulumi/pulumi-libvirt/sdk v0.4.7 // indirect + github.com/pulumi/pulumi-docker/sdk/v4 v4.5.7 // indirect + github.com/pulumi/pulumi-libvirt/sdk v0.5.3 // indirect github.com/pulumi/pulumi-random/sdk/v4 v4.16.7 // indirect github.com/pulumi/pulumi-tls/sdk/v4 v4.11.1 // indirect github.com/pulumiverse/pulumi-time/sdk v0.1.0 // indirect @@ -309,7 +308,7 @@ require ( github.com/pulumi/pulumi-azure-native-sdk/managedidentity/v2 v2.73.1 // indirect github.com/pulumi/pulumi-azure-native-sdk/network/v2 v2.73.1 // indirect github.com/pulumi/pulumi-azure-native-sdk/v2 v2.73.1 // indirect - github.com/pulumi/pulumi-eks/sdk/v3 v3.3.0 // indirect + github.com/pulumi/pulumi-eks/sdk/v3 v3.4.0 // indirect github.com/pulumi/pulumi-gcp/sdk/v7 v7.38.0 // indirect github.com/twinj/uuid v0.0.0-20151029044442-89173bcdda19 // indirect github.com/x448/float16 v0.8.4 // indirect diff --git a/test/new-e2e/go.sum b/test/new-e2e/go.sum index bc044e2579ffa..53d347f467e3f 100644 --- a/test/new-e2e/go.sum +++ b/test/new-e2e/go.sum @@ -17,6 +17,8 @@ github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= github.com/DataDog/mmh3 v0.0.0-20210722141835-012dc69a9e49 h1:EbzDX8HPk5uE2FsJYxD74QmMw0/3CqSKhEr6teh0ncQ= github.com/DataDog/mmh3 v0.0.0-20210722141835-012dc69a9e49/go.mod h1:SvsjzyJlSg0rKsqYgdcFxeEVflx3ZNAyFfkUHP0TxXg= +github.com/DataDog/test-infra-definitions v0.0.0-20241217152533-10486aec63a8 h1:PArQoDvQdOXM6SpGK3szo4NG49yen+WYIqwIdqz9SU4= +github.com/DataDog/test-infra-definitions v0.0.0-20241217152533-10486aec63a8/go.mod h1:1PAUwGjC25ACjfft4HrLEmHliuajlvjzcLFWpuqAIyk= github.com/DataDog/zstd v1.5.6 h1:LbEglqepa/ipmmQJUDnSsfvA8e8IStVcGaFWDuxvGOY= github.com/DataDog/zstd v1.5.6/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/DataDog/zstd_0 v0.0.0-20210310093942-586c1286621f h1:5Vuo4niPKFkfwW55jV4vY0ih3VQ9RaQqeqY67fvRn8A= @@ -50,50 +52,50 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU= github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= -github.com/aws/aws-sdk-go-v2 v1.32.5 h1:U8vdWJuY7ruAkzaOdD7guwJjD06YSKmnKCJs7s3IkIo= -github.com/aws/aws-sdk-go-v2 v1.32.5/go.mod h1:P5WJBrYqqbWVaOxgH0X/FYYD47/nooaPOZPlQdmiN2U= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.6 h1:pT3hpW0cOHRJx8Y0DfJUEQuqPild8jRGmSFmBgvydr0= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.6/go.mod h1:j/I2++U0xX+cr44QjHay4Cvxj6FUbnxrgmqN3H1jTZA= -github.com/aws/aws-sdk-go-v2/config v1.28.5 h1:Za41twdCXbuyyWv9LndXxZZv3QhTG1DinqlFsSuvtI0= -github.com/aws/aws-sdk-go-v2/config v1.28.5/go.mod h1:4VsPbHP8JdcdUDmbTVgNL/8w9SqOkM5jyY8ljIxLO3o= -github.com/aws/aws-sdk-go-v2/credentials v1.17.46 h1:AU7RcriIo2lXjUfHFnFKYsLCwgbz1E7Mm95ieIRDNUg= -github.com/aws/aws-sdk-go-v2/credentials v1.17.46/go.mod h1:1FmYyLGL08KQXQ6mcTlifyFXfJVCNJTVGuQP4m0d/UA= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.20 h1:sDSXIrlsFSFJtWKLQS4PUWRvrT580rrnuLydJrCQ/yA= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.20/go.mod h1:WZ/c+w0ofps+/OUqMwWgnfrgzZH1DZO1RIkktICsqnY= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.24 h1:4usbeaes3yJnCFC7kfeyhkdkPtoRYPa/hTmCqMpKpLI= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.24/go.mod h1:5CI1JemjVwde8m2WG3cz23qHKPOxbpkq0HaoreEgLIY= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.24 h1:N1zsICrQglfzaBnrfM0Ys00860C+QFwu6u/5+LomP+o= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.24/go.mod h1:dCn9HbJ8+K31i8IQ8EWmWj0EiIk0+vKiHNMxTTYveAg= +github.com/aws/aws-sdk-go-v2 v1.32.6 h1:7BokKRgRPuGmKkFMhEg/jSul+tB9VvXhcViILtfG8b4= +github.com/aws/aws-sdk-go-v2 v1.32.6/go.mod h1:P5WJBrYqqbWVaOxgH0X/FYYD47/nooaPOZPlQdmiN2U= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7 h1:lL7IfaFzngfx0ZwUGOZdsFFnQ5uLvR0hWqqhyE7Q9M8= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7/go.mod h1:QraP0UcVlQJsmHfioCrveWOC1nbiWUl3ej08h4mXWoc= +github.com/aws/aws-sdk-go-v2/config v1.28.6 h1:D89IKtGrs/I3QXOLNTH93NJYtDhm8SYa9Q5CsPShmyo= +github.com/aws/aws-sdk-go-v2/config v1.28.6/go.mod h1:GDzxJ5wyyFSCoLkS+UhGB0dArhb9mI+Co4dHtoTxbko= +github.com/aws/aws-sdk-go-v2/credentials v1.17.47 h1:48bA+3/fCdi2yAwVt+3COvmatZ6jUDNkDTIsqDiMUdw= +github.com/aws/aws-sdk-go-v2/credentials v1.17.47/go.mod h1:+KdckOejLW3Ks3b0E3b5rHsr2f9yuORBum0WPnE5o5w= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.21 h1:AmoU1pziydclFT/xRV+xXE/Vb8fttJCLRPv8oAkprc0= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.21/go.mod h1:AjUdLYe4Tgs6kpH4Bv7uMZo7pottoyHMn4eTcIcneaY= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25 h1:s/fF4+yDQDoElYhfIVvSNyeCydfbuTKzhxSXDXCPasU= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25/go.mod h1:IgPfDv5jqFIzQSNbUEMoitNooSMXjRSDkhXv8jiROvU= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25 h1:ZntTCl5EsYnhN/IygQEUugpdwbhdkom9uHcbCftiGgA= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25/go.mod h1:DBdPrgeocww+CSl1C8cEV8PN1mHMBhuCDLpXezyvWkE= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.19 h1:FKdiFzTxlTRO71p0C7VrLbkkdW8qfMKF5+ej6bTmkT0= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.19/go.mod h1:abO3pCj7WLQPTllnSeYImqFfkGrmJV0JovWo/gqT5N0= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.25 h1:r67ps7oHCYnflpgDy2LZU0MAQtQbYIOqNNnqGO6xQkE= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.25/go.mod h1:GrGY+Q4fIokYLtjCVB/aFfCVL6hhGUFl8inD18fDalE= github.com/aws/aws-sdk-go-v2/service/ec2 v1.190.0 h1:k97fGog9Tl0woxTiSIHN14Qs5ehqK6GXejUwkhJYyL0= github.com/aws/aws-sdk-go-v2/service/ec2 v1.190.0/go.mod h1:mzj8EEjIHSN2oZRXiw1Dd+uB4HZTl7hC8nBzX9IZMWw= -github.com/aws/aws-sdk-go-v2/service/ecr v1.36.2 h1:VDQaVwGOokbd3VUbHF+wupiffdrbAZPdQnr5XZMJqrs= -github.com/aws/aws-sdk-go-v2/service/ecr v1.36.2/go.mod h1:lvUlMghKYmSxSfv0vU7pdU/8jSY+s0zpG8xXhaGKCw0= -github.com/aws/aws-sdk-go-v2/service/ecs v1.47.4 h1:CTkPGE8fiElvLtYWl/U+Eu5+1fVXiZbJUjyVCRSRgxk= -github.com/aws/aws-sdk-go-v2/service/ecs v1.47.4/go.mod h1:sMFLFhL27cKYa/eQYZp4asvIwHsnJWrAzTUpy9AQdnU= +github.com/aws/aws-sdk-go-v2/service/ecr v1.36.7 h1:R+5XKIJga2K9Dkj0/iQ6fD/MBGo02oxGGFTc512lK/Q= +github.com/aws/aws-sdk-go-v2/service/ecr v1.36.7/go.mod h1:fDPQV/6ONOQOjvtKhtypIy1wcGLcKYtoK/lvZ9fyDGQ= +github.com/aws/aws-sdk-go-v2/service/ecs v1.52.2 h1:LRM6z+wmXqAgCvuH36RR+Wf8SZZhvOVjt6f5r38V2II= +github.com/aws/aws-sdk-go-v2/service/ecs v1.52.2/go.mod h1:Ghi1OWUv4+VMEULWiHsKH2gNA3KAcMoLWsvU0eRXvIA= github.com/aws/aws-sdk-go-v2/service/eks v1.44.1 h1:onUAzZXDsyXzyrmOGw/9p8Csl1NZkTDEs4URZ8covUY= github.com/aws/aws-sdk-go-v2/service/eks v1.44.1/go.mod h1:dg9l/W4hXygeRNydRB4LWKY/MwHJhfUomGJUBwI29Dw= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 h1:iXtILhvDxB6kPvEXgsDhGaZCSC6LQET5ZHSdJozeI0Y= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1/go.mod h1:9nu0fVANtYiAePIBh2/pFUSwtJ402hLnp854CNoDOeE= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.0 h1:FQNWhRuSq8QwW74GtU0MrveNhZbqvHsA4dkA9w8fTDQ= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.0/go.mod h1:j/zZ3zmWfGCK91K73YsfHP53BSTLSjL/y6YN39XbBLM= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.5 h1:wtpJ4zcwrSbwhECWQoI/g6WM9zqCcSpHDJIWSbMLOu4= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.5/go.mod h1:qu/W9HXQbbQ4+1+JcZp0ZNPV31ym537ZJN+fiS7Ti8E= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.0 h1:1NKXS8XfhMM0bg5wVYa/eOH8AM2f6JijugbKEyQFTIg= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.0/go.mod h1:ph931DUfVfgrhZR7py9olSvHCiRpvaGxNvlWBcXxFds= -github.com/aws/aws-sdk-go-v2/service/s3 v1.65.0 h1:2dSm7frMrw2tdJ0QvyccQNJyPGaP24dyDgZ6h1QJMGU= -github.com/aws/aws-sdk-go-v2/service/s3 v1.65.0/go.mod h1:4XSVpw66upN8wND3JZA29eXl2NOZvfFVq7DIP6xvfuQ= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.6 h1:HCpPsWqmYQieU7SS6E9HXfdAMSud0pteVXieJmcpIRI= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.6/go.mod h1:ngUiVRCco++u+soRRVBIvBZxSMMvOVMXA4PJ36JLfSw= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.6 h1:50+XsN70RS7dwJ2CkVNXzj7U2L1HKP8nqTd3XWEXBN4= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.6/go.mod h1:WqgLmwY7so32kG01zD8CPTJWVWM+TzJoOVHwTg4aPug= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.6 h1:BbGDtTi0T1DYlmjBiCr/le3wzhA37O8QTC5/Ab8+EXk= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.6/go.mod h1:hLMJt7Q8ePgViKupeymbqI0la+t9/iYFBjxQCFwuAwI= +github.com/aws/aws-sdk-go-v2/service/s3 v1.71.0 h1:nyuzXooUNJexRT0Oy0UQY6AhOzxPxhtt4DcBIHyCnmw= +github.com/aws/aws-sdk-go-v2/service/s3 v1.71.0/go.mod h1:sT/iQz8JK3u/5gZkT+Hmr7GzVZehUMkRZpOaAwYXeGY= github.com/aws/aws-sdk-go-v2/service/ssm v1.50.7 h1:GkRsyFS9MmX/ybCvOncmp1A4XYn75v0x/ReWnIUao6E= github.com/aws/aws-sdk-go-v2/service/ssm v1.50.7/go.mod h1:oBlt+H2x16bM5mSUNhmzIR2BWWnMsLUa1Qqs5auS1Bs= -github.com/aws/aws-sdk-go-v2/service/sso v1.24.6 h1:3zu537oLmsPfDMyjnUS2g+F2vITgy5pB74tHI+JBNoM= -github.com/aws/aws-sdk-go-v2/service/sso v1.24.6/go.mod h1:WJSZH2ZvepM6t6jwu4w/Z45Eoi75lPN7DcydSRtJg6Y= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.5 h1:K0OQAsDywb0ltlFrZm0JHPY3yZp/S9OaoLU33S7vPS8= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.5/go.mod h1:ORITg+fyuMoeiQFiVGoqB3OydVTLkClw/ljbblMq6Cc= -github.com/aws/aws-sdk-go-v2/service/sts v1.33.1 h1:6SZUVRQNvExYlMLbHdlKB48x0fLbc2iVROyaNEwBHbU= -github.com/aws/aws-sdk-go-v2/service/sts v1.33.1/go.mod h1:GqWyYCwLXnlUB1lOAXQyNSPqPLQJvmo8J0DWBzp9mtg= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.7 h1:rLnYAfXQ3YAccocshIH5mzNNwZBkBo+bP6EhIxak6Hw= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.7/go.mod h1:ZHtuQJ6t9A/+YDuxOLnbryAmITtr8UysSny3qcyvJTc= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.6 h1:JnhTZR3PiYDNKlXy50/pNeix9aGMo6lLpXwJ1mw8MD4= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.6/go.mod h1:URronUEGfXZN1VpdktPSD1EkAL9mfrV+2F4sjH38qOY= +github.com/aws/aws-sdk-go-v2/service/sts v1.33.2 h1:s4074ZO1Hk8qv65GqNXqDjmkf4HSQqJukaLuuW0TpDA= +github.com/aws/aws-sdk-go-v2/service/sts v1.33.2/go.mod h1:mVggCnIWoM09jP71Wh+ea7+5gAp53q+49wDFs1SW5z8= github.com/aws/session-manager-plugin v0.0.0-20241010233726-61cf1288c7c6 h1:iQc6pdTje/w3D3vrocVIvcosNVQGjoGxqBgPpwG28BY= github.com/aws/session-manager-plugin v0.0.0-20241010233726-61cf1288c7c6/go.mod h1:7n17tunRPUsniNBu5Ja9C7WwJWTdOzaLqr/H0Ns3uuI= github.com/aws/smithy-go v1.22.1 h1:/HPHZQ0g7f4eUeK6HKglFz8uwVfZKgoI25rb/J+dnro= @@ -417,16 +419,16 @@ github.com/pulumi/pulumi-azure-native-sdk/v2 v2.73.1 h1:yzXxwwq3tHdtSOi5vjKmKXq7 github.com/pulumi/pulumi-azure-native-sdk/v2 v2.73.1/go.mod h1:ChjIUNDNeN6jI33ZOivHUFqM6purDiLP01mghMGe1Fs= github.com/pulumi/pulumi-command/sdk v1.0.1 h1:ZuBSFT57nxg/fs8yBymUhKLkjJ6qmyN3gNvlY/idiN0= github.com/pulumi/pulumi-command/sdk v1.0.1/go.mod h1:C7sfdFbUIoXKoIASfXUbP/U9xnwPfxvz8dBpFodohlA= -github.com/pulumi/pulumi-docker/sdk/v4 v4.5.5 h1:7OjAfgLz5PAy95ynbgPAlWls5WBe4I/QW/61TdPWRlQ= -github.com/pulumi/pulumi-docker/sdk/v4 v4.5.5/go.mod h1:XZKLFXbw13olxuztlWnmVUPYZp2a+BqzqhuMl0j/Ow8= -github.com/pulumi/pulumi-eks/sdk/v3 v3.3.0 h1:F3xAOBZ/In4PqydTsKeg3tou/c5FZ+JTp5dQO0oMjqE= -github.com/pulumi/pulumi-eks/sdk/v3 v3.3.0/go.mod h1:QbAamxfUpDJC81BGtyEuV0P88RrdbOjQEhbgY+OOPpg= +github.com/pulumi/pulumi-docker/sdk/v4 v4.5.7 h1:cuIl5YyIghqtnFMGsdtPOeaNSix5S2CrqO0/UZ1Yjsc= +github.com/pulumi/pulumi-docker/sdk/v4 v4.5.7/go.mod h1:f2ek887nKRSwNtqTqCFENJSOH0PXm1b3FhzSXYL0IyM= +github.com/pulumi/pulumi-eks/sdk/v3 v3.4.0 h1:s2Cpu6E2lmADNUbutbJGm6O+O9j0mBLlrhQmc40ukt0= +github.com/pulumi/pulumi-eks/sdk/v3 v3.4.0/go.mod h1:QbAamxfUpDJC81BGtyEuV0P88RrdbOjQEhbgY+OOPpg= github.com/pulumi/pulumi-gcp/sdk/v7 v7.38.0 h1:21oSj+TKlKTzQcxN9Hik7iSNNHPUQXN4s3itOnahy/w= github.com/pulumi/pulumi-gcp/sdk/v7 v7.38.0/go.mod h1:YaEZms1NgXFqGhObKVofcAeWXu2V+3t/BAXdHQZq7fU= github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.18.3 h1:quqoGsLbF7lpGpGU4mi5WfVLIAo4gfvoQeYYmemx1Dg= github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.18.3/go.mod h1:9dBA6+rtpKmyZB3k1XryUOHDOuNdoTODFKEEZZCtrz8= -github.com/pulumi/pulumi-libvirt/sdk v0.4.7 h1:/BBnqqx/Gbg2vINvJxXIVb58THXzw2lSqFqxlRSXH9M= -github.com/pulumi/pulumi-libvirt/sdk v0.4.7/go.mod h1:VKvjhAm1sGtzKZruYwIhgascabEx7+oVVRCoxp/cPi4= +github.com/pulumi/pulumi-libvirt/sdk v0.5.3 h1:CiUGTweLLIxbAbADxxnwPv4BK8pxXfU8urokJvK1ihM= +github.com/pulumi/pulumi-libvirt/sdk v0.5.3/go.mod h1:gAhyIZKtzs4rknrl8fu8BQnyqijAmViFbaUkyuHt4xY= github.com/pulumi/pulumi-random/sdk/v4 v4.16.7 h1:39rhOe/PTUGMYia8pR5T2wbxxMt2pwrlonf0ncYKSzE= github.com/pulumi/pulumi-random/sdk/v4 v4.16.7/go.mod h1:cxxDhJzUPt/YElfvlWa15Q4NGF6XXS8kUs4OQsCxSBk= github.com/pulumi/pulumi-tls/sdk/v4 v4.11.1 h1:tXemWrzeVTqG8zq6hBdv1TdPFXjgZ+dob63a/6GlF1o= diff --git a/test/new-e2e/pkg/components/operator.go b/test/new-e2e/pkg/components/operator.go index 4fc9e4be0332f..eaa89c4239fcd 100644 --- a/test/new-e2e/pkg/components/operator.go +++ b/test/new-e2e/pkg/components/operator.go @@ -10,6 +10,6 @@ import ( ) // Operator is a Datadog Operator running in a Kubernetes cluster -type Operator struct { +type Operator struct { // nolint:revive, We want to keep the name as operator.OperatorOutput } diff --git a/test/new-e2e/pkg/environments/aws/kubernetes/kind.go b/test/new-e2e/pkg/environments/aws/kubernetes/kind.go index e77f05d3f8dcc..7d97e6fc45275 100644 --- a/test/new-e2e/pkg/environments/aws/kubernetes/kind.go +++ b/test/new-e2e/pkg/environments/aws/kubernetes/kind.go @@ -228,14 +228,14 @@ agents: } } - if params.operatorDDAOptions != nil { + if params.deployOperator && params.operatorDDAOptions != nil { ddaOptions := make([]agentwithoperatorparams.Option, 0) ddaOptions = append( ddaOptions, params.operatorDDAOptions..., ) - ddaWithOperatorComp, err := agent.NewDDAWithOperator(&awsEnv, awsEnv.CommonNamer().ResourceName("dd-operator-agent"), kubeProvider, ddaOptions...) + ddaWithOperatorComp, err := agent.NewDDAWithOperator(&awsEnv, awsEnv.CommonNamer().ResourceName("kind-with-operator"), kubeProvider, ddaOptions...) if err != nil { return err } From e6c3f90adafba0eb7705e8d93ace7c07e7ba9676 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Tue, 17 Dec 2024 15:16:23 -0500 Subject: [PATCH 08/10] fix aws kind env --- test/new-e2e/go.mod | 1 - test/new-e2e/go.sum | 5 ++--- test/new-e2e/pkg/environments/aws/kubernetes/kind.go | 2 -- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/test/new-e2e/go.mod b/test/new-e2e/go.mod index a8f423ebb2fb5..883c29221faa5 100644 --- a/test/new-e2e/go.mod +++ b/test/new-e2e/go.mod @@ -285,7 +285,6 @@ require ( github.com/DataDog/datadog-agent/pkg/trace v0.56.0-rc.3 github.com/DataDog/datadog-go/v5 v5.6.0 github.com/aws/aws-sdk-go v1.55.5 - github.com/aws/aws-sdk-go-v2/service/s3 v1.71.0 github.com/aws/session-manager-plugin v0.0.0-20241119210807-82dc72922492 github.com/digitalocean/go-libvirt v0.0.0-20240812180835-9c6c0a310c6c github.com/hairyhenderson/go-codeowners v0.7.0 diff --git a/test/new-e2e/go.sum b/test/new-e2e/go.sum index f69f3cfd27123..b6ae9711c9ea1 100644 --- a/test/new-e2e/go.sum +++ b/test/new-e2e/go.sum @@ -76,8 +76,6 @@ github.com/aws/aws-sdk-go-v2/service/ecr v1.36.7 h1:R+5XKIJga2K9Dkj0/iQ6fD/MBGo0 github.com/aws/aws-sdk-go-v2/service/ecr v1.36.7/go.mod h1:fDPQV/6ONOQOjvtKhtypIy1wcGLcKYtoK/lvZ9fyDGQ= github.com/aws/aws-sdk-go-v2/service/ecs v1.52.2 h1:LRM6z+wmXqAgCvuH36RR+Wf8SZZhvOVjt6f5r38V2II= github.com/aws/aws-sdk-go-v2/service/ecs v1.52.2/go.mod h1:Ghi1OWUv4+VMEULWiHsKH2gNA3KAcMoLWsvU0eRXvIA= -github.com/aws/aws-sdk-go-v2/service/eks v1.44.1 h1:onUAzZXDsyXzyrmOGw/9p8Csl1NZkTDEs4URZ8covUY= -github.com/aws/aws-sdk-go-v2/service/eks v1.44.1/go.mod h1:dg9l/W4hXygeRNydRB4LWKY/MwHJhfUomGJUBwI29Dw= github.com/aws/aws-sdk-go-v2/service/eks v1.51.0 h1:BYyB+byjQ7oyupe3v+YjTp1yfmfNEwChYA2naCc85xI= github.com/aws/aws-sdk-go-v2/service/eks v1.51.0/go.mod h1:oaPCqTzAe8C5RQZJGRD4RENcV7A4n99uGxbD4rULbNg= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 h1:iXtILhvDxB6kPvEXgsDhGaZCSC6LQET5ZHSdJozeI0Y= @@ -91,7 +89,8 @@ github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.6/go.mod h1:hLMJt7Q github.com/aws/aws-sdk-go-v2/service/s3 v1.71.0 h1:nyuzXooUNJexRT0Oy0UQY6AhOzxPxhtt4DcBIHyCnmw= github.com/aws/aws-sdk-go-v2/service/s3 v1.71.0/go.mod h1:sT/iQz8JK3u/5gZkT+Hmr7GzVZehUMkRZpOaAwYXeGY= github.com/aws/aws-sdk-go-v2/service/ssm v1.55.2 h1:z6Pq4+jtKlhK4wWJGHRGwMLGjC1HZwAO3KJr/Na0tSU= -github.com/aws/aws-sdk-go-v2/service/ssm v1.55.2/go.mod h1:DSmu/VZzpQlAubWBbAvNpt+S4k/XweglJi4XaDGyvQk=github.com/aws/aws-sdk-go-v2/service/sso v1.24.7 h1:rLnYAfXQ3YAccocshIH5mzNNwZBkBo+bP6EhIxak6Hw= +github.com/aws/aws-sdk-go-v2/service/ssm v1.55.2/go.mod h1:DSmu/VZzpQlAubWBbAvNpt+S4k/XweglJi4XaDGyvQk= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.7 h1:rLnYAfXQ3YAccocshIH5mzNNwZBkBo+bP6EhIxak6Hw= github.com/aws/aws-sdk-go-v2/service/sso v1.24.7/go.mod h1:ZHtuQJ6t9A/+YDuxOLnbryAmITtr8UysSny3qcyvJTc= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.6 h1:JnhTZR3PiYDNKlXy50/pNeix9aGMo6lLpXwJ1mw8MD4= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.6/go.mod h1:URronUEGfXZN1VpdktPSD1EkAL9mfrV+2F4sjH38qOY= diff --git a/test/new-e2e/pkg/environments/aws/kubernetes/kind.go b/test/new-e2e/pkg/environments/aws/kubernetes/kind.go index 1c2035c632947..4826b368f61d9 100644 --- a/test/new-e2e/pkg/environments/aws/kubernetes/kind.go +++ b/test/new-e2e/pkg/environments/aws/kubernetes/kind.go @@ -136,8 +136,6 @@ func KindRunFunc(ctx *pulumi.Context, env *environments.Kubernetes, params *Prov var dependsOnCrd []pulumi.Resource if params.agentOptions != nil && !params.deployOperator { - helmValues := ` - if params.agentOptions != nil { kindClusterName := ctx.Stack() helmValues := fmt.Sprintf(` datadog: From eb4e18a975b0205c8f381234ae85b458202d0644 Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Tue, 17 Dec 2024 16:29:35 -0500 Subject: [PATCH 09/10] remove unnecessary dependsOnCRD --- test/new-e2e/pkg/environments/aws/kubernetes/kind.go | 1 - 1 file changed, 1 deletion(-) diff --git a/test/new-e2e/pkg/environments/aws/kubernetes/kind.go b/test/new-e2e/pkg/environments/aws/kubernetes/kind.go index 4826b368f61d9..581e4829ca366 100644 --- a/test/new-e2e/pkg/environments/aws/kubernetes/kind.go +++ b/test/new-e2e/pkg/environments/aws/kubernetes/kind.go @@ -245,7 +245,6 @@ agents: if err := ddaWithOperatorComp.Export(ctx, &env.Agent.KubernetesAgentOutput); err != nil { return err } - dependsOnCrd = append(dependsOnCrd, ddaWithOperatorComp) } else { env.Agent = nil From bcad91f89e3b22f166a2021a32afb627bce8435b Mon Sep 17 00:00:00 2001 From: Fanny Jiang Date: Wed, 18 Dec 2024 10:41:08 -0500 Subject: [PATCH 10/10] remove extraneous nolint --- test/new-e2e/pkg/components/operator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/new-e2e/pkg/components/operator.go b/test/new-e2e/pkg/components/operator.go index eaa89c4239fcd..4fc9e4be0332f 100644 --- a/test/new-e2e/pkg/components/operator.go +++ b/test/new-e2e/pkg/components/operator.go @@ -10,6 +10,6 @@ import ( ) // Operator is a Datadog Operator running in a Kubernetes cluster -type Operator struct { // nolint:revive, We want to keep the name as +type Operator struct { operator.OperatorOutput }