-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing script to read ascii code #3556
Conversation
This pull request does not have a backport label. Could you fix it @gizas? 🙏
NOTE: |
@cmacknz I move our discussion here: #3523 (comment) Only thing is that Is this expected? |
@@ -1,7 +1,7 @@ | |||
ALL=elastic-agent-standalone elastic-agent-managed | |||
|
|||
BEAT_VERSION=$(shell grep '^:stack-version:' ../../version/docs/version.asciidoc | cut -c 17- ) | |||
BRANCH_VERSION=$(shell grep '^:doc-branch:' ../../version/docs/version.asciidoc | cut -c 14- ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears the :stack-version
key here isn't being updated properly since this shouldn't be 8.8.
The one you want and is guarnateed to be right is
elastic-agent/version/version.go
Line 7 in 99b14c8
const defaultBeatVersion = "8.12.0" |
There are a couple of examples for parsing this you could reuse. For one example see
BEAT_VERSION=$(grep -oE '[0-9]+\.[0-9]+\.[0-9]+(\-[a-zA-Z]+[0-9]+)?' "${WORKSPACE}/version/version.go") |
You'd still have to drop the patch version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I also now see why we were trying to use doc-branch because this needs to be main
and not 8.12
for main.
I would suggest git branch --show-current
but that will break when this is run on developer branches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it to read from version.go
Both managed and standalone updated
@@ -683,7 +683,7 @@ spec: | |||
# - -c | |||
# - >- | |||
# mkdir -p /etc/elastic-agent/inputs.d && | |||
# 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" | |||
# wget -O - https://github.com/elastic/elastic-agent/archive/8.8.tar.gz | tar xz -C /etc/elastic-agent/inputs.d --strip=5 "elastic-agent-8.8/deploy/kubernetes/elastic-agent-standalone/templates.d" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the files probably should have updated, not just one.
/test |
Do you have any idea why the check fails in https://fleet-ci.elastic.co/blue/organizations/jenkins/elastic-agent%2Felastic-agent-mbp/detail/PR-3556/4/pipeline ? # mkdir -p /etc/elastic-agent/inputs.d &&
[2023-10-19T13:50:42.860Z] - # wget -O - https://github.com/elastic/elastic-agent/archive/8.12.tar.gz | tar xz -C /etc/elastic-agent/inputs.d --strip=5 "elastic-agent-8.12/deploy/kubernetes/elastic-agent-standalone/templates.d"
[2023-10-19T13:50:42.860Z] + # wget -O - https://github.com/elastic/elastic-agent/archive/.tar.gz | tar xz -C /etc/elastic-agent/inputs.d --strip=5 "elastic-agent-/deploy/kubernetes/elastic-agent-standalone/templates.d" |
🌐 Coverage report
|
/test |
SonarQube Quality Gate |
-- Bug
What does this PR do?
WHAT: Updates makefile to read from different value of version.doc file
WHY: The
doc-branch
is a field that no longer is udpated. Thus we replace it withstack-version
fieldWhy is it important?
To avoid wrong references to main and alwasy reference to latest release of templates
Checklist
./changelog/fragments
using the changelog toolHow to test this PR locally
cd elastic-agent/deploy/kubernetes
make generate-k8s
See in
elastic-agent-standalone-kubernetes.yaml
# wget -O - https://github.com/elastic/elastic-agent/archive/8.8.tar.gz | tar xz -C /etc/elastic-agent/inputs.d --strip=5 "elastic-agent-8.8/deploy/kubernetes/elastic-agent-standalone/templates.d"
make check
output #3523