-
Notifications
You must be signed in to change notification settings - Fork 207
Self service: agent version: default to "latest" #2968
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
base: master
Are you sure you want to change the base?
Conversation
358d525 to
301455f
Compare
301455f to
c08705d
Compare
| ->where('api_key IS NOT NULL') | ||
| ->query(); | ||
|
|
||
| $result = self::loadAll($db, $query); | ||
| if (count($result) !== 1) { | ||
| throw new NotFoundError('Got invalid API key "%s"', $key); | ||
| foreach ($query as $row) { | ||
| if (hash_equals($row->api_key, $key)) { | ||
| return (new static())->setConnection($db)->setDbProperties($row); | ||
| } | ||
| } | ||
|
|
||
| return current($result); | ||
| throw new NotFoundError('Got invalid API key "%s"', $key); |
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.
This is not related to the issue, if I understand correctly. Please fix this in a separate PR.
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.
c08705d to
9d2251f
Compare
raviks789
left a comment
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.
LGTM!
lippserd
left a comment
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.
@raviks789 Please feel free to merge.

fixes #2965
fixes Icinga/icinga-powershell-framework#795
ref/IP/58492
CC @slalomsk8er
As discussed in Icinga/icinga-powershell-framework#795 (comment), pinning agent versions is a delayed shoot in the foot. Luckily IfW accepts "latest"!
Test
Spoiler: IfW accepts "latest" as version 👍