-
Notifications
You must be signed in to change notification settings - Fork 154
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
feat(elastic-agent-services): add another tag to docker image for agentless use #6874
base: main
Are you sure you want to change the base?
Conversation
This pull request does not have a backport label. Could you fix it @olegsu? 🙏
|
e60e748
to
3186eb4
Compare
dev-tools/mage/dockerbuilder.go
Outdated
// additional tags should not be created with | ||
for _, tag := range additionalTags { | ||
if err := b.dockerSave(tag, "{{.Name}}{{if .OS}}-{{.OS}}{{end}}{{if .Arch}}-{{.Arch}}{{end}}"); err != nil { | ||
return fmt.Errorf("failed to save docker as artifact: %w", err) |
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.
specify a tag for narrowing down specifics in case of failure
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 think it looks ok.
dev-tools/mage/dockerbuilder.go
Outdated
moreTags := []string{} | ||
if commit, found := b.ExtraVars["commit"]; found && b.DockerVariant == Service { | ||
if len(commit) >= 12 { | ||
moreTags = append(moreTags, fmt.Sprintf("%s:%s", b.imageName, "git-"+commit[:12])) | ||
} | ||
} |
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.
ExtraVars contains raw values, expanded values are inside evalContext, use that one and replace also one for repository above
moreTags := []string{} | |
if commit, found := b.ExtraVars["commit"]; found && b.DockerVariant == Service { | |
if len(commit) >= 12 { | |
moreTags = append(moreTags, fmt.Sprintf("%s:%s", b.imageName, "git-"+commit[:12])) | |
} | |
} | |
moreTags := []string{} | |
if commitI, found := b.evalContext["commit"]; found && b.DockerVariant == Service { | |
commit, ok := commitI.(string) | |
if ok && len(commit) >= 12 { | |
moreTags = append(moreTags, fmt.Sprintf("%s:git-%s", b.imageName, commit[:12])) | |
} | |
} |
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.
hey @olegsu 👋 thanks for opening this PR. I believe that already @michalpristas has left some comments that capture some issues with this PR (ty @michalpristas ). However, I kinda have another thinking that affects the approach of this PR. I am not a fan of implicit actions, and here the new tag you try to introduce happens ambiguously if commit is found in extra vars. However, IMO, adding an extra vars shouldn't affect the tags as the two are not profoundly coupled. That said, would it make sense to you as well to alternate this PR, promoting explicitness, e.g. introduce extraTags
in package.yml and do utilise them from there? in this way if in the future we need to change/remove/add another tag this will be really straight-forward
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
3186eb4
to
285c705
Compare
Thank you for the feedback! |
a22f570
to
d67f9e1
Compare
Please wait for approval from @pkoutsovasilis before merging, but this looks good to me with the latest updates. |
8f77509
to
88d1289
Compare
@blakerouse Thanks for the approval but I am a bit confused. Didn't we agreed on giving approval only once CI is green to avoid code changes to make CI happy after approval that would not dismiss your review? |
88d1289
to
5a12ef9
Compare
c4eee0c
to
a2c4397
Compare
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.
Thanks for going through my comments @olegsu this LGTM. I had a look in the CI failures and they all seem to be related to already reported flaky tests and a new one which I have raised with eng prod team. That said, I invoked retries to get this PR merged 🙂
…ntless use p override the name in the template use map copy remove fmt update comments typo
a2c4397
to
6c9b1f3
Compare
⏳ Build in-progress, with failures
Failed CI StepsHistory
cc @olegsu |
|
What does this PR do?
This pr will add additional tag to docker image
elastic-agent-service
in form ofelastic-agent-service:git-{SHORT_COMMIT}
Why is it important?
Elastic-Agent is used in Agentless in both ECH and ES3.
While in ECH we must a version that will match the ELK stack, in ES3 we dont have that restriction.
Two reasons why this is important for ES3:
I do not want to elaborate on the details in a public repo, please check the RFC and https://github.com/elastic/security-team/issues/9273 with full context
Checklist
./changelog/fragments
using the changelog toolDisruptive User Impact
How to test this PR locally
Related issues
Questions to ask yourself