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

Restore deprecated NotificationsConfig.Region field #4299

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions charts/flyte-core/templates/admin/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ data:
notifications.yaml: |
notifications:
type: {{ .Values.workflow_notifications.config.notifications.type }}
{{- if not .Values.workflow_notifications.config.notifications.aws }}
{{- with .Values.workflow_notifications.config.notifications.region }}
region: {{ tpl . $ }}
{{- end }}
{{- end }}
{{- if eq .Values.workflow_notifications.config.notifications.type "aws" }}
{{- with .Values.workflow_notifications.config.notifications.aws }}
aws: {{ tpl (toYaml .) $ | nindent 8 }}
Expand Down
12 changes: 10 additions & 2 deletions flyteadmin/pkg/async/notifications/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ func GetEmailer(config runtimeInterfaces.NotificationsConfig, scope promutils.Sc

switch config.Type {
case common.AWS:
awsConfig := aws.NewConfig().WithRegion(config.Region).WithMaxRetries(maxRetries)
region := config.AWSConfig.Region
if region == "" {
region = config.Region
}
awsConfig := aws.NewConfig().WithRegion(region).WithMaxRetries(maxRetries)
awsSession, err := session.NewSession(awsConfig)
if err != nil {
panic(err)
Expand Down Expand Up @@ -98,7 +102,11 @@ func NewNotificationsProcessor(config runtimeInterfaces.NotificationsConfig, sco
// However, the message body of SQS is the SNS message format which isn't Base64 encoded.
ConsumeBase64: &enable64decoding,
}
sqsConfig.Region = config.Region
if config.AWSConfig.Region != "" {
sqsConfig.Region = config.AWSConfig.Region
} else {
sqsConfig.Region = config.Region
}
var err error
err = async.Retry(reconnectAttempts, reconnectDelay, func() error {
sub, err = gizmoAWS.NewSubscriber(sqsConfig)
Expand Down