Skip to content

Commit 106f849

Browse files
[8.5](backport #1504) Fix k8s template link versioning (#1505)
* Fix k8s template link versioning (#1504) (cherry picked from commit 8904833) # Conflicts: # deploy/kubernetes/Makefile # deploy/kubernetes/elastic-agent-standalone-kubernetes.yaml * Update elastic-agent-standalone-kubernetes.yaml * Update Makefile Co-authored-by: Chris Mark <[email protected]>
1 parent 67d6b2a commit 106f849

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

deploy/kubernetes/Makefile

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
ALL=elastic-agent-standalone elastic-agent-managed
22
BEAT_VERSION=$(shell head -n 1 ../../version/docs/version.asciidoc | cut -c 17- )
3+
BRANCH_VERSION=$(shell sed -n '2p' ../../version/docs/version.asciidoc | cut -c 14- )
34

45
#variables needed for ci-create-kubernetes-templates-pull-request
56
ELASTIC_AGENT_REPO=kibana
@@ -9,7 +10,7 @@ ELASTIC_AGENT_BRANCH=update-k8s-templates-$(shell date "+%Y%m%d%H%M%S")
910

1011
.PHONY: generate-k8s $(ALL)
1112
generate-k8s: $(ALL)
12-
13+
1314
test: generate-k8s
1415
for FILE in $(shell ls *-kubernetes.yaml); do \
1516
BEAT=$$(echo $$FILE | cut -d \- -f 1); \
@@ -19,21 +20,21 @@ test: generate-k8s
1920
clean:
2021
@for f in $(ALL); do rm -f "$$f-kubernetes.yaml"; done
2122

22-
$(ALL):
23+
$(ALL):
2324
ifdef WITHOUTCONFIG
2425
@echo "Generating [email protected]"
2526
2627
@for f in $(shell ls $@/*.yaml | grep -v daemonset-configmap); do \
27-
sed "s/%VERSION%/VERSION/g" $$f >> [email protected]; \
28+
sed -e "s/%VERSION%/VERSION/g" -e "s/%BRANCH%/${BRANCH_VERSION}/g" $$f >> [email protected]; \
2829
echo --- >> [email protected]; \
2930
done
3031
else
31-
@echo "Generating [email protected]"
32-
32+
@echo "Generating [email protected]"
33+
3334
@for f in $(shell ls $@/*.yaml); do \
34-
sed "s/%VERSION%/${BEAT_VERSION}/g" $$f >> [email protected]; \
35+
sed -e "s/%VERSION%/${BEAT_VERSION}/g" -e "s/%BRANCH%/${BRANCH_VERSION}/g" $$f >> [email protected]; \
3536
echo --- >> [email protected]; \
36-
done
37+
done
3738
endif
3839

3940
CHDIR_SHELL := $(SHELL)
@@ -47,7 +48,7 @@ endef
4748
ci-clone-kibana-repository:
4849
git clone [email protected]:elastic/kibana.git
4950
cp $(FILE_REPO) $(ELASTIC_AGENT_REPO)/$(ELASTIC_AGENT_REPO_PATH)
50-
51+
5152
## ci-create-kubernetes-templates-pull-request : Create the pull request for the kubernetes templates
5253
.PHONY: ci-create-kubernetes-templates-pull-request
5354
ci-create-kubernetes-templates-pull-request:

deploy/kubernetes/elastic-agent-standalone-kubernetes.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ spec:
662662
# - -c
663663
# - >-
664664
# mkdir -p /etc/elastic-agent/inputs.d &&
665-
# wget -O - https://github.com/elastic/elastic-agent/archive/8.5.0.tar.gz | tar xz -C /etc/elastic-agent/inputs.d --strip=5 "elastic-agent-main/deploy/kubernetes/elastic-agent-standalone/templates.d"
665+
# wget -O - https://github.com/elastic/elastic-agent/archive/main.tar.gz | tar xz -C /etc/elastic-agent/inputs.d --strip=5 "elastic-agent-main/deploy/kubernetes/elastic-agent-standalone/templates.d"
666666
# volumeMounts:
667667
# - name: external-inputs
668668
# mountPath: /etc/elastic-agent/inputs.d

deploy/kubernetes/elastic-agent-standalone/elastic-agent-standalone-daemonset.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ spec:
3434
# - -c
3535
# - >-
3636
# mkdir -p /etc/elastic-agent/inputs.d &&
37-
# wget -O - https://github.com/elastic/elastic-agent/archive/%VERSION%.tar.gz | tar xz -C /etc/elastic-agent/inputs.d --strip=5 "elastic-agent-main/deploy/kubernetes/elastic-agent-standalone/templates.d"
37+
# wget -O - https://github.com/elastic/elastic-agent/archive/%BRANCH%.tar.gz | tar xz -C /etc/elastic-agent/inputs.d --strip=5 "elastic-agent-main/deploy/kubernetes/elastic-agent-standalone/templates.d"
3838
# volumeMounts:
3939
# - name: external-inputs
4040
# mountPath: /etc/elastic-agent/inputs.d

0 commit comments

Comments
 (0)