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 @@

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)

Check warning on line 71 in flyteadmin/pkg/async/notifications/factory.go

View check run for this annotation

Codecov / codecov/patch

flyteadmin/pkg/async/notifications/factory.go#L67-L71

Added lines #L67 - L71 were not covered by tests
awsSession, err := session.NewSession(awsConfig)
if err != nil {
panic(err)
Expand Down Expand Up @@ -98,7 +102,11 @@
// 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
}

Check warning on line 109 in flyteadmin/pkg/async/notifications/factory.go

View check run for this annotation

Codecov / codecov/patch

flyteadmin/pkg/async/notifications/factory.go#L105-L109

Added lines #L105 - L109 were not covered by tests
var err error
err = async.Retry(reconnectAttempts, reconnectDelay, func() error {
sub, err = gizmoAWS.NewSubscriber(sqsConfig)
Expand Down
Loading