-
Notifications
You must be signed in to change notification settings - Fork 27
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: enable must-gather for uwm #305
feat: enable must-gather for uwm #305
Conversation
must-gather/gather-monitoring-info
Outdated
|
||
get_rules() { | ||
log "getting prometheus rules" | ||
THANOS_RULER_ROUTE="$(oc get routes -n $UWM_NS thanos-ruler -o jsonpath='{.status.ingress[0].host}')" |
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.
As a general rule of thumb, all initialisations that is more complex than an variable assignment, is better placed in to an init
function. Use UPPER_CASE
for globals and snake_case
for local
(use local).
af36248
to
f6267ba
Compare
must-gather/gather-monitoring-info
Outdated
|
||
THANOS_RULER_ROUTE="$(oc get routes -n $UWM_NS thanos-ruler -o jsonpath='{.status.ingress[0].host}')" | ||
SA_TOKEN="$(oc create token default)" | ||
PROM_PODS="$(oc -n $UWM_NS get pods -l app.kubernetes.io/component=prometheus -oname 2>/dev/null || echo "")" |
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.
PROM_PODS="$(oc -n $UWM_NS get pods -l app.kubernetes.io/component=prometheus -oname 2>/dev/null || echo "")" | |
PROM_PODS="$(oc -n $UWM_NS get pods -l app.kubernetes.io/component=prometheus -oname)" || true | |
declare -r PROM_PODS THANOS_RULER_ROUTE SA_TOKEN |
PROM_PODS="$(oc -n $UWM_NS get pods -l app.kubernetes.io/component=prometheus -oname 2>/dev/null || echo "")" | ||
} | ||
|
||
cleanup() { |
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.
how about trap cleanup EXIT
?
|
||
main() { | ||
init | ||
|
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.
we should return 0
if PROM_PODS
is empty
how about init || { warn "cannot gather UWM details"; return 0; }
init
can return 0
or 1
depending on the vars could be initialised or not - right?
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 but do consider addressing the comments in this PR or as a follow up.
Signed-off-by: Vibhu Prashar <[email protected]>
f6267ba
to
6902902
Compare
This PR adds support for capturing
User-Workload-Monitoring
related info in must-gather