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

fix: alertmanager: Add TLS-assets for email and webhook receivers to assets secret when using alertmanagerConfiguration #6567

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

name212
Copy link

@name212 name212 commented May 6, 2024

Description

When we are using alertmanagerConfiguration email and webhook receivers from this config which contain TLS setting (TLS-assets), they do not add in internal store and therese assets do not save to TLS-assets secret which will mounted to alert manager pod.

Type of change

What type of changes does your code introduce to the Prometheus operator? Put an x in the box that apply.

  • 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

Please check the Prometheus-Operator testing guidelines for recommendations about automated tests.

Changelog entry

Add TLS-assets for email and webhook receivers to assets secret when using alertmanagerConfiguration


…ng alertmanagerConfiguration

When we are using alertmanagerConfiguration email and webhook receivers from this config which contain TLS setting (TLS-assets), they do not add in internal store and therese assets do not save to TLS-assets secret which will mounted to alert manager pod.

Signed-off-by: Nikolay Mitrofanov <nikolay.mitrofanov@flant.com>
@name212 name212 requested a review from a team as a code owner May 6, 2024 19:23
@simonpasquier
Copy link
Contributor

Are you using it for the global AlertmanagerConfig? Otherwise the operator should already load the TLS assets into the store.

@name212
Copy link
Author

name212 commented May 7, 2024

Are you using it for the global AlertmanagerConfig

Yes.

@simonpasquier
Copy link
Contributor

My recommendation would be to call checkAlertmanagerConfigResource() on the global AlertmanagerConfig object which we don't IIUC. E.g. before calling initializeFromAlertmanagerConfig()

// Load the base configuration from the referenced AlertmanagerConfig.
globalAmConfig, err := c.mclient.MonitoringV1alpha1().AlertmanagerConfigs(am.Namespace).
Get(ctx, am.Spec.AlertmanagerConfiguration.Name, metav1.GetOptions{})
if err != nil {
return fmt.Errorf("failed to get global AlertmanagerConfig: %w", err)
}
err = cfgBuilder.initializeFromAlertmanagerConfig(ctx, am.Spec.AlertmanagerConfiguration.Global, globalAmConfig)
if err != nil {
return fmt.Errorf("failed to initialize from global AlertmangerConfig: %w", err)
}

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.

None yet

2 participants