Skip to content
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

Always get the latest version of targets #28

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

RichiH
Copy link
Member

@RichiH RichiH commented May 13, 2021

No description provided.

@RichiH RichiH requested a review from juliusv May 13, 2021 14:11
@RichiH RichiH requested a review from tomwilkie as a code owner May 13, 2021 14:11
const grafanaAgentDownloadURL = "https://github.com/grafana/agent/releases/download/v0.13.1/agent-{{.OS}}-{{.Arch}}.zip"
func getGrafanaDownloadURL() string {
version := latest.GetLatestVersion("grafana/agent")
return "https://github.com/grafana/agent/releases/download/" + version + "/agent-{{.OS}}-{{.Arch}}.zip"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we could make version a field in the URL template and have downloadBinary extract the github project, lookup the latest version and sub it in?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't make it work with templates, but regexp does the job.

@RichiH RichiH force-pushed the richih/lastest_version branch from 9e4261a to 8e83a43 Compare May 13, 2021 14:17
Signed-off-by: Richard Hartmann <richih@richih.org>
@RichiH RichiH force-pushed the richih/lastest_version branch from 8e83a43 to 07a813a Compare May 13, 2021 14:20
If you hammer GH API without a login too often, you will get rate
limited over time. As local binaries remain on disk, this should not
be too much of a concern.

Signed-off-by: Richard Hartmann <richih@richih.org>
@RichiH RichiH force-pushed the richih/lastest_version branch from 91abb5d to f9371b8 Compare May 13, 2021 19:10
@RichiH RichiH marked this pull request as draft May 14, 2021 12:56
@RichiH
Copy link
Member Author

RichiH commented May 14, 2021

GH API limits are too restrictive, I will need to solve this before we can merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants