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: add context to notification #1305

Merged

Conversation

saumeya
Copy link
Collaborator

@saumeya saumeya commented Apr 16, 2024

What type of PR is this?

/kind bug

What does this PR do / why we need it:
To allpow users to set context in their notificationConfiguration CR

Have you updated the necessary documentation?

  • Documentation update is required by this PR.
  • Documentation has been updated.

Which issue(s) this PR fixes:

Fixes #?

How to test changes / Special notes to the reviewer:

  1. Run the operator locally using make install run
  2. Create argo-cd instance with notifications enabled
apiVersion: argoproj.io/v1alpha1
kind: ArgoCD
metadata:
  name: argocd
spec:
  notifications:
    enabled: true
  1. Verify the the notification CR default-notifications-configuration is created
  2. Add a context to the notification CR and save the CR. By default there is no context set in the CR.
spec:
  context: 
    key1: value1
    key2: value2
  templates:
    template.app-created: |-
      email:
        subject: Application {{.app.metadata.name}} has been created.
      message: Application {{.app.metadata.name}} has been created.
      teams:
        title: Application {{.app.metadata.name}} has been created.
    template.app-deleted: |-
     ...
     ...
  1. Check the configmap argocd-notifications-cm , verify the context appears correctly.

Signed-off-by: Saumeya Katyal <skatyal@skatyal-thinkpadt14sgen1.bengluru.csb>

changes

Signed-off-by: Saumeya Katyal <skatyal@skatyal-thinkpadt14sgen1.bengluru.csb>

ci failures

Signed-off-by: Saumeya Katyal <skatyal@skatyal-thinkpadt14sgen1.bengluru.csb>

review comments

Signed-off-by: Saumeya Katyal <skatyal@skatyal-thinkpadt14sgen1.bengluru.csb>
@saumeya saumeya force-pushed the add-context-to-notification branch from a6e5a2b to 7206579 Compare April 18, 2024 09:15
Signed-off-by: Saumeya Katyal <skatyal@skatyal-thinkpadt14sgen1.bengluru.csb>
Copy link
Collaborator

@svghadi svghadi left a comment

Choose a reason for hiding this comment

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

Tested out the changes. Looks good.
Thanks @saumeya !!

@iam-veeramalla iam-veeramalla merged commit 80a3a9d into argoproj-labs:master Apr 18, 2024
7 checks passed
@svghadi
Copy link
Collaborator

svghadi commented Apr 24, 2024

/cherry-pick release-0.10

gcp-cherry-pick-bot bot pushed a commit that referenced this pull request Apr 24, 2024
* fix: add condtext to notification

Signed-off-by: Saumeya Katyal <skatyal@skatyal-thinkpadt14sgen1.bengluru.csb>

changes

Signed-off-by: Saumeya Katyal <skatyal@skatyal-thinkpadt14sgen1.bengluru.csb>

ci failures

Signed-off-by: Saumeya Katyal <skatyal@skatyal-thinkpadt14sgen1.bengluru.csb>

review comments

Signed-off-by: Saumeya Katyal <skatyal@skatyal-thinkpadt14sgen1.bengluru.csb>

* type

Signed-off-by: Saumeya Katyal <skatyal@skatyal-thinkpadt14sgen1.bengluru.csb>

---------

Signed-off-by: Saumeya Katyal <skatyal@skatyal-thinkpadt14sgen1.bengluru.csb>
Co-authored-by: Saumeya Katyal <skatyal@skatyal-thinkpadt14sgen1.bengluru.csb>
svghadi pushed a commit that referenced this pull request Apr 26, 2024
* fix: add condtext to notification

---------

Signed-off-by: Saumeya Katyal <skatyal@skatyal-thinkpadt14sgen1.bengluru.csb>
Co-authored-by: Saumeya Katyal <saumeyakatyal@gmail.com>
Co-authored-by: Saumeya Katyal <skatyal@skatyal-thinkpadt14sgen1.bengluru.csb>
@svghadi svghadi added the backport-to-redesign Changes which need to be backported to operator-redesign branch label Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-to-redesign Changes which need to be backported to operator-redesign branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants