Skip to content

Commit 8f7b8f7

Browse files
authored
dca: provide the major version (#36510)
1 parent 5aa27d4 commit 8f7b8f7

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

.gitlab/binary_build/cluster_agent.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
- !reference [.retrieve_linux_go_deps]
1010
script:
1111
- dda inv -- check-go-version
12-
- dda inv -- -e cluster-agent.build
12+
- dda inv -- -e cluster-agent.build --major-version "$AGENT_MAJOR_VERSION"
1313
artifacts:
1414
paths:
1515
- $CLUSTER_AGENT_BINARIES_DIR/datadog-cluster-agent
@@ -23,6 +23,7 @@
2323
KUBERNETES_MEMORY_REQUEST: "8Gi"
2424
KUBERNETES_MEMORY_LIMIT: "8Gi"
2525
KUBERNETES_CPU_REQUEST: 6
26+
AGENT_MAJOR_VERSION: 7
2627

2728
cluster_agent-build_amd64:
2829
extends: .cluster_agent-build_common

tasks/cluster_agent.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def build(
3535
development=True,
3636
skip_assets=False,
3737
policies_version=None,
38+
major_version='7',
3839
):
3940
"""
4041
Build Cluster Agent
@@ -53,6 +54,7 @@ def build(
5354
race,
5455
development,
5556
skip_assets,
57+
major_version=major_version,
5658
)
5759

5860
if policies_version is None:

tasks/cluster_agent_helpers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def build_common(
2121
development,
2222
skip_assets,
2323
go_mod="readonly",
24+
major_version="7",
2425
):
2526
"""
2627
Build Cluster Agent
@@ -31,7 +32,7 @@ def build_common(
3132
build_tags = get_build_tags(build_include, build_exclude)
3233

3334
# We rely on the go libs embedded in the debian stretch image to build dynamically
34-
ldflags, gcflags, env = get_build_flags(ctx, static=False)
35+
ldflags, gcflags, env = get_build_flags(ctx, static=False, major_version=major_version)
3536

3637
cmd = "go build -mod={go_mod} {race_opt} {build_type} -tags '{build_tags}' -o {bin_name} "
3738
cmd += "-gcflags=\"{gcflags}\" -ldflags=\"{ldflags}\" {REPO_PATH}/cmd/cluster-agent{suffix}"

0 commit comments

Comments
 (0)