Repository navigation
fix: require authorization for Webex receivers - #8899
Closed
spicysharkco wants to merge 1 commit into
Closed
spicysharkco wants to merge 1 commit into
spicysharkco wants to merge 1 commit into
Conversation
Build on prometheus-operator#8897 and accept authorization or bearerTokenSecret in both AlertmanagerConfig versions. Reject references to empty credentials before configuration assembly, using the existing secret validator. Keep the alpha regression cases with the operator tests. Closes prometheus-operator#8889 Co-authored-by: Aryan Deshmukh <[email protected]> Signed-off-by: spicysharkco <[email protected]>
1 task done
Contributor
|
duplicates #8897 which was submitted before |
Member
|
closing as #8897 was merged already |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes #8889.
A selected AlertmanagerConfig with
webexConfigs: [{roomID: room-1}]and nohttpConfigpasses validation, but Alertmanager refuses the configuration. A token reference to an existing Secret key with an empty value has the same effect, including with #8897.pkg/assets/store.go:350accepts an empty value. Rendering drops empty authorization credentials (pkg/alertmanager/amcfg.go:1890) and omits an empty bearer token (pkg/alertmanager/types.go:240). Alertmanager v0.34.1 rejects the receiver atconfig/notifiers.go:152, before global HTTP fallback atconfig/config.go:578.Require
authorizationorbearerTokenSecretin both API versions. Reject empty referenced credentials with the existingvalidation.NotEmptycheck atpkg/alertmanager/operator.go:1639. The shared check covers selected resources andspec.alertmanagerConfiguration.Builds on #8897 by @A-RYAN-1, which supplies the field-presence validation and tests, including bearer-token compatibility. This adds the two empty-secret regressions and their fix. Overlap checked: #8897 is the only Webex overlap.
release-0.94also has the missing check.Type of change
BUGFIX(non-breaking change which fixes an issue)Verification
Run locally:
go test -p 4 -count=1 -json ./pkg/alertmanager ./pkg/alertmanager/validation/v1beta1 -run 'TestCheckWebexAlertmanagerConfig|TestValidateWebexConfigsRequireAuthorization': main has 6 failing and 4 passing subtests; fix: require httpConfig.authorization for Webex receivers #8897 has 2 failing and 8 passing; this fix passes all 10.go test -p 4 -count=1 -json ./pkg/alertmanager/...: 102 tests and 606 subtests pass across 4 packages; 2 packages have no tests.make generate-crds bundle.yaml Documentation/api-reference/api.md: no additional diff.make check: passes with zero issues.go test -p 4 -count=1 -json ./pkg/admission: 11 tests and 14 subtests pass;TestAdmitBadRuleWithBooleanInAnnotationsfails. That failure also reproduces on main withgo test -p 4 -count=1 -json ./pkg/admission -run '^TestAdmitBadRuleWithBooleanInAnnotations$'.Not tested: live configuration reload or Webex delivery.
Changelog entry