CSPL-4344: Add License Expired Event#1679
Merged
Igor-splunk merged 9 commits intodevelopfrom Feb 12, 2026
Merged
Conversation
Contributor
|
CLA Assistant Lite bot CLA Assistant Lite bot All contributors have signed the COC ✍️ ✅ |
5c684e8 to
bf5a91d
Compare
kasiakoziol
reviewed
Jan 30, 2026
| if licenseInfo.Status == "EXPIRED" { | ||
| eventPublisher.Warning(ctx, "LicenseExpired", | ||
| fmt.Sprintf("License '%s' has expired", licenseName)) | ||
| scopedLog.Info("Detected expired license", "licenseName", licenseName, "title", licenseInfo.Title) |
Collaborator
Pull Request Test Coverage Report for Build 21901106831Details
💛 - Coveralls |
kubabuczak
reviewed
Feb 9, 2026
| var pod corev1.Pod | ||
| err := client.Get(ctx, namespacedName, &pod) | ||
| if err != nil { | ||
| // Pod might not exist yet, which is normal during initial creation |
Collaborator
There was a problem hiding this comment.
Shouldn't we log something on return?
kubabuczak
reviewed
Feb 9, 2026
Collaborator
There was a problem hiding this comment.
Those tests look like they could be a table tests.
Which API call will fail in case of expected alerts? Shouldn't we mock it? I would prefer to have some positive test case
b2c1599 to
43a33fe
Compare
kasiakoziol
reviewed
Feb 11, 2026
|
|
||
| // checkLicenseRelatedPodFailures checks license status via Splunk API | ||
| // and publishes warning event when expired license is detected | ||
| func checkLicenseRelatedPodFailures(ctx context.Context, client splcommon.ControllerClient, cr *enterpriseApi.LicenseManager, statefulSet *appsv1.StatefulSet, eventPublisher *K8EventPublisher) { |
Collaborator
There was a problem hiding this comment.
Can't we just take the eventPublisher from the context?
kasiakoziol
reviewed
Feb 11, 2026
| scopedLog := reqLogger.WithName("checkLicenseRelatedPodFailures") | ||
|
|
||
| // Check if pod is ready before attempting API call | ||
| podName := fmt.Sprintf("%s-0", statefulSet.GetName()) |
Collaborator
There was a problem hiding this comment.
Do we want to only check it for one pod?
kasiakoziol
reviewed
Feb 11, 2026
| } | ||
|
|
||
| // Check for license-related pod failures before updating | ||
| checkLicenseRelatedPodFailures(ctx, client, cr, statefulSet, eventPublisher) |
Collaborator
There was a problem hiding this comment.
Don't we want to throw an error if sth goes wrong?
kasiakoziol
approved these changes
Feb 11, 2026
patrykw-splunk
approved these changes
Feb 12, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
What does this PR have in it?
Key Changes
Highlight the updates in specific files
Testing and Verification
How did you test these changes? What automated tests are added?
Related Issues
Jira tickets, GitHub issues, Support tickets...
PR Checklist