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

Explicitly check the error received via curl when checking for fields quota #1523

Closed
pmalek-sumo opened this issue Mar 24, 2021 · 0 comments · Fixed by #1524
Closed

Explicitly check the error received via curl when checking for fields quota #1523

pmalek-sumo opened this issue Mar 24, 2021 · 0 comments · Fixed by #1524
Assignees
Labels
bug Something isn't working

Comments

@pmalek-sumo
Copy link
Contributor

Let's add checks for the errors that we get when checking for fields quota

function remaining_fields() {
local RESPONSE="$(curl -XGET -s \
-u "${SUMOLOGIC_ACCESSID}:${SUMOLOGIC_ACCESSKEY}" \
"${SUMOLOGIC_BASE_URL}"v1/fields/quota)"
echo "${RESPONSE}" | jq '.remaining'
}
# Check if we'd have at least 10 fields remaining after additional fields
# would be created for the collection
function should_create_fields() {
local REMAINING=$(remaining_fields)
if [[ $(( REMAINING - {{ len .Values.sumologic.logs.fields }} )) -ge 10 ]] ; then
return 0
else
return 1
fi
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant