<#4299 Restore deprecated NotificationsConfig.Regi...
# flyte-github
a
#4299 Restore deprecated NotificationsConfig.Region field Pull request opened by andrewwdye Tracking issue Fixes #3070 Fixes #4296 Describe your changes This change • Restores population of the
NotificationConfig.Region
field from the flyte-core configmap template. This was removed in #4055. While the config struct field has a comment indicating deprecated, the alternative
NotificationConfig.AWSConfig.Region
is not consumed everywhere yet. It is not safe to stop populating this field yet, and is in fact required for all existing versions of flyteadmin to use NotificationsProcessor and Emailer. The deprecated field is only populated in the absence of the
aws
block. • Updates flyteadmin to consume
NotificationConfig.AWSConfig.Region
and only fallback to the deprecated field if necessary. Testing I ran through a couple EKS and GCP helm templating scenarios to verify the fix correctly populates the deprecated region field if used and no other changes otherwise. EKS with deprecated region field
Copy code
❯ cat values-eks-notifications-deprecated.yaml
workflow_notifications:
  enabled: true
  config:
    notifications:
      type: aws
      region: "{{ .Values.userSettings.accountRegion }}"
Before:
Copy code
❯ helm template flyte-core -f flyte-core/values-eks.yaml -f values-eks-notifications-deprecated.yaml | grep notifications.yaml -A3
  notifications.yaml: |
    notifications:
      type: aws
      publisher:
After:
Copy code
❯ helm template flyte-core -f flyte-core/values-eks.yaml -f values-eks-notifications-deprecated.yaml | grep notifications.yaml -A4
  notifications.yaml: |
    notifications:
      type: aws
      region: <AWS_REGION>
      publisher:

❯ diff generated-old-eks-deprecated.yaml generated-new-eks-deprecated.yaml
3a4
>       region: <AWS_REGION>
EKS with AWS region field
Copy code
❯ helm template flyte-core -f flyte-core/values-eks.yaml -f values-eks-notifications.yaml | grep notifications.yaml -A14 > generated-old-eks.yaml

❯ helm template flyte-core -f flyte-core/values-eks.yaml -f values-eks-notifications.yaml | grep notifications.yaml -A15 > generated-new-eks.yaml

❯ diff generated-old-eks.yaml generated-new-eks.yaml
GCP
Copy code
❯ cat values-gcp-notifications.yaml
workflow_notifications:
  enabled: true
  config:
    notifications:
      type: gcp
      gcp:
        projectId: foo
      publisher:
        topicName: "arn:aws:sns:{{ .Values.userSettings.accountRegion }}:{{ .Values.userSettings.accountNumber }}:flyte-notifications-topic"
      processor:
        queueName: flyte-notifications-queue
        accountId: "{{ .Values.userSettings.accountNumber }}"
      emailer:
        subject: "Flyte: {{ project }}/{{ domain }}/{{ launch_plan.name }} has {{ phase }}"
        sender: "flyte@example.com"
        body: |
         "Execution {{ workflow.project }}/{{ workflow.domain }}/{{ workflow.name }}/{{ name }} has {{ phase }}.
          Details: https://flyte.example.com/console/projects/{{ project }}/domains/{{ domain }}/executions/{{ name }}.
          {{ error }}"

❯ helm template flyte-core -f flyte-core/values-gcp.yaml -f values-gcp-notifications.yaml | grep notifications.yaml -A14 > generated-old-gcp.yaml

❯ helm template flyte-core -f flyte-core/values-gcp.yaml -f values-gcp-notifications.yaml | grep notifications.yaml -A14 > generated-new-gcp.yaml

❯ diff generated-old-gcp.yaml generated-new-gcp.yaml
Check all the applicable boxes ☐ I updated the documentation accordingly. ☐ All new and existing tests passed. ☐ All commits are signed-off. flyteorg/flyte GitHub Actions: Build & Push Image GitHub Actions: Bump git tags Codecov: 0.00% of diff hit (target 58.73%) ✅ 27 other checks have passed 27/30 successful checks