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

Fixed the send agg mail message: #731

Merged
merged 2 commits into from
Feb 26, 2024

Conversation

athiruma
Copy link
Collaborator

Type of change

Note: Fill x in []

  • bug
  • enhancement
  • documentation
  • dependencies

Description

Sending the aggregated mail report by using the elastic search.
This helps us to verify upcoming resources that to be deleted.

For security reasons, all pull requests need to be approved first before running any automated CI

@athiruma athiruma added enhancement New feature or request ok-to-test PR ok to test labels Feb 20, 2024
@athiruma athiruma requested a review from ebattat February 20, 2024 08:33
@athiruma athiruma self-assigned this Feb 20, 2024
@@ -195,6 +195,7 @@ def __init__(self):
self._environment_variables_dict['DEFAULT_ADMINS'] = literal_eval(EnvironmentVariables.get_env('DEFAULT_ADMINS', '[]'))
self._environment_variables_dict['KERBEROS_USERS'] = literal_eval(EnvironmentVariables.get_env('KERBEROS_USERS', '[]'))
self._environment_variables_dict['POLICIES_TO_ALERT'] = literal_eval(EnvironmentVariables.get_env('POLICIES_TO_ALERT', '[]'))
self._environment_variables_dict['ONLY_ADMINS'] = EnvironmentVariables.get_boolean_from_environment('ONLY_ADMINS', False)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need admin email list ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No,
I added the extra var EMAIL_TO here we can add the admin mail and EMIAL_CC to add other users

Copy link
Collaborator

@ebattat ebattat Feb 20, 2024

Choose a reason for hiding this comment

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

@athiruma Pls fix it as we discussed, ADMINS_ONLY (instead of ONLY_ADMINS) should be list of emails, if the list is filled, need to send the email TO it, if it empty should send email per user resource.

@ebattat
Copy link
Collaborator

ebattat commented Feb 21, 2024

self.__policy_action_days = self.__environment_variables.get('POLICY_ACTIONS_DAYS')
self.__days_to_delete_resource = int(self.__environment_variables.get('DAYS_TO_DELETE_RESOURCE'))
self.__mail_to = self.__environment_variables.get('EMAIL_TO') # testing purposes
self.__mail_cc = self.__environment_variables.get('EMAIL_CC', [])
self.__mail_message = MailMessage()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why we need EMAIL_TO and EMAIL_CC, do we use it anywhere ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It forcefully replaces to and cc. I used this variable to work on local env and running in dev containers.

@ebattat
Copy link
Collaborator

ebattat commented Feb 26, 2024

I dont see ADMINS_ONLY, are you using DEFAULT_ADMINS variable ?

@athiruma
Copy link
Collaborator Author

I dont see ADMINS_ONLY, are you using DEFAULT_ADMINS variable ?

ADMIN_MAIL_LIST this one.

@ebattat
Copy link
Collaborator

ebattat commented Feb 26, 2024

Why we cannot using DEFAULT_ADMINS ?

@athiruma
Copy link
Collaborator Author

Why we cannot using DEFAULT_ADMINS ?

No special reason. We have an admin list so named it ADMIN_MAIL_LIST.

Copy link
Collaborator

@ebattat ebattat left a comment

Choose a reason for hiding this comment

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

/LGTM

@ebattat ebattat merged commit 9fcb0d5 into redhat-performance:main Feb 26, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ok-to-test PR ok to test
Projects
Development

Successfully merging this pull request may close these issues.

2 participants