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

Bump prometheus-auth to a more recent version of Go and stop using vendored modules and rancher/trash #12

Merged
merged 14 commits into from
Dec 13, 2022

Conversation

aiyengar2
Copy link
Contributor

@aiyengar2 aiyengar2 commented Dec 12, 2022

Related Issue: rancher/rancher#39533

Arvind Iyengar added 7 commits December 12, 2022 15:16
In previous versions of the prometheus client, promlb.Matcher was just a struct that contained strings.

However, in recent versions of the client, promlb.Matcher contains a FastRegexMatcher instantiated within it, which is only instantiated when you call promlb.NewMatcher on a matcher whose type is a regex match.

As a result, simply modifying the promlb.Matcher struct fields results in a segfault on trying to parse a regex label selector using a new client, which is fixed with the change introduced here.
@@ -59,11 +60,7 @@ func Test_accessControl(t *testing.T) {
dbDir, err := ioutil.TempDir("", "tsdb-ready")
defer os.RemoveAll(dbDir)

testutil.Ok(t, err)
Copy link
Contributor Author

@aiyengar2 aiyengar2 Dec 12, 2022

Choose a reason for hiding this comment

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

fyi testutil no longer exists, that's why we're shifting to testify

Comment on lines +437 to +447
type dbAdapter struct {
*promtsdb.DB
}

func (a *dbAdapter) Stats(statsByLabelName string) (*promtsdb.Stats, error) {
return a.Head().Stats(statsByLabelName), nil
}

func (a *dbAdapter) WALReplayStatus() (promtsdb.WALReplayStatus, error) {
return promtsdb.WALReplayStatus{}, nil
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

copied from upstream

Comment on lines -361 to -369
resp, err = http.Post("http://localhost:9090/api/v2/admin/tsdb/snapshot", "", strings.NewReader(""))

testutil.Ok(t, err)
testutil.Equals(t, http.StatusOK, resp.StatusCode)

resp, err = http.Post("http://localhost:9090/api/v2/admin/tsdb/delete_series", "", strings.NewReader("{}"))

testutil.Ok(t, err)
testutil.Equals(t, http.StatusOK, resp.StatusCode)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not checked in upstream either anymore, so removed from our tests

@aiyengar2 aiyengar2 merged commit f78ab78 into rancher:master Dec 13, 2022
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