Skip to content

Commit

Permalink
AET-203 Change stack definition to use the version of the agent corre…
Browse files Browse the repository at this point in the history
…sponding to the current pipeline by default (#18772)

* Inject pipeline id variable directly in the config map

* Update test

* Fix tests

* Re add pipeline ID
  • Loading branch information
KevinFairise2 authored Aug 31, 2023
1 parent 807289b commit 3ff5c02
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitlab/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ k8s-e2e-otlp-main:
E2E_PUBLIC_KEY_PATH: /tmp/agent-qa-ssh-key.pub
E2E_PRIVATE_KEY_PATH: /tmp/agent-qa-ssh-key
E2E_KEY_PAIR_NAME: datadog-agent-ci
E2E_PIPELINE_ID: $CI_PIPELINE_ID
script:
- inv -e new-e2e-tests.run --targets $TARGETS $CONFIGPARAMS --junit-tar "junit-${CI_JOB_NAME}.tgz" ${EXTRA_PARAMS}
artifacts:
Expand Down
6 changes: 6 additions & 0 deletions test/new-e2e/pkg/runner/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ const (
AgentAPIKey = commonconfig.DDAgentConfigNamespace + ":" + commonconfig.DDAgentAPIKeyParamName
// AgentAPPKey pulumi config paramater name
AgentAPPKey = commonconfig.DDAgentConfigNamespace + ":" + commonconfig.DDAgentAPPKeyParamName
// AgentPipelineID pulumi config parameter name
AgentPipelineID = commonconfig.DDAgentConfigNamespace + ":" + commonconfig.DDAgentPipelineID

// InfraEnvironmentVariables pulumi config paramater name
InfraEnvironmentVariables = commonconfig.DDInfraConfigNamespace + ":" + commonconfig.DDInfraEnvironment
Expand Down Expand Up @@ -109,6 +111,10 @@ func BuildStackParameters(profile Profile, scenarioConfig ConfigMap) (ConfigMap,
if err != nil {
return nil, err
}
err = SetConfigMapFromParameter(profile.ParamStore(), cm, parameters.PipelineID, AgentPipelineID)
if err != nil {
return nil, err
}
// Secret parameters from profile store
err = SetConfigMapFromSecret(profile.SecretStore(), cm, parameters.APIKey, AgentAPIKey)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions test/new-e2e/pkg/runner/configmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ func Test_BuildStackParameters(t *testing.T) {
"ddinfra:extraResourcesTags": auto.ConfigValue{Value: "extra_resources_tags", Secret: false},
"ddinfra:aws/defaultPublicKeyPath": auto.ConfigValue{Value: "public_key_path", Secret: false},
"ddinfra:aws/defaultPrivateKeyPath": auto.ConfigValue{Value: "private_key_path", Secret: false},
"ddagent:pipeline_id": auto.ConfigValue{Value: "pipeline_id", Secret: false},
}, configMap)
}
2 changes: 2 additions & 0 deletions test/new-e2e/pkg/runner/parameters/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ const (
SkipDeleteOnFailure StoreKey = "skip_delete_on_failure"
// StackParameters config file parameter name
StackParameters StoreKey = "stack_params"
// PipelineID config file parameter name
PipelineID StoreKey = "pipeline_id"
)

0 comments on commit 3ff5c02

Please sign in to comment.