Skip to content

Conversation

@varundeepsaini
Copy link
Contributor

@varundeepsaini varundeepsaini commented Dec 23, 2025

Description

Add SSA (Server-Side Apply) listType markers to all slice fields in v1alpha1/alertmanager_config_types.go to satisfy the KAL ssatags linter.

  • Use listType=atomic for complex object lists (configs, matchers, etc.)
  • Use listType=set for unique string lists (GroupBy, MuteTimeIntervals, ActiveTimeIntervals, MrkdwnIn, Equal)

Related to: #8131

Type of change

  • CHANGE (fix or feature that would cause existing functionality to not work as expected)
  • FEATURE (non-breaking change which adds functionality)
  • BUGFIX (non-breaking change which fixes an issue)
  • ENHANCEMENT (non-breaking change which improves existing functionality)
  • NONE (if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)

Verification

Ran the linter locally, no violations left in this file

Changelog entry

NONE

@varundeepsaini varundeepsaini requested a review from a team as a code owner December 23, 2025 16:50
@varundeepsaini varundeepsaini force-pushed the ssatags-v1alpha1-alertmanagerconfig branch from 4f39d3f to ef01795 Compare December 23, 2025 17:02
@pull-request-size pull-request-size bot added size/L and removed size/M labels Dec 23, 2025
@varundeepsaini
Copy link
Contributor Author

@simonpasquier Could you review these, please

Copy link
Contributor

@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! For listType=set, I'd reserve it for lists which Alertmanager rejects if they are not sets.

@varundeepsaini
Copy link
Contributor Author

@simonpasquier have pushed the changes, please review again

// Labels must not be repeated (unique list).
// Special label "..." (aggregate by all possible labels), if provided, must be the only element in the list.
// +listType=set
// +listType=atomic
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for being unclear but a set here is ok (because Alertmanager would fail if duplicated groupby values are provided)


// muteTimeIntervals is a list of MuteTimeInterval names that will mute this route when matched,
// +listType=set
// +listType=atomic
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

MuteTimeIntervals []string `json:"muteTimeIntervals,omitempty"`
// activeTimeIntervals is a list of MuteTimeInterval names when this route should be active.
// +listType=set
// +listType=atomic
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@varundeepsaini
Copy link
Contributor Author

@simonpasquier my bad, reverted those specific changes

Copy link
Contributor

@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@simonpasquier simonpasquier merged commit a1f0fcb into prometheus-operator:main Dec 24, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants