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

Add Rust extension to list of known runtimes #1117

Merged
merged 1 commit into from
Feb 18, 2021
Merged
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
6 changes: 6 additions & 0 deletions runtimes/runtimes.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const (
PHP_FILE_EXTENSION = "php"
ZIP_FILE_EXTENSION = "zip"
RUBY_FILE_EXTENSION = "rb"
RUST_FILE_EXTENSION = "rs"
Copy link
Member

Choose a reason for hiding this comment

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

do we expect rlib as well?

GO_FILE_EXTENSION = "go"
NODEJS_RUNTIME = "nodejs"
SWIFT_RUNTIME = SWIFT_FILE_EXTENSION
Expand All @@ -51,6 +52,7 @@ const (
DOTNET_RUNTIME = ZIP_FILE_EXTENSION
PHP_RUNTIME = PHP_FILE_EXTENSION
RUBY_RUNTIME = "ruby"
RUST_RUNTIME = "rust"
GO_RUNTIME = GO_FILE_EXTENSION
HTTP_CONTENT_TYPE_KEY = "Content-Type"
HTTP_CONTENT_TYPE_VALUE = "application/json; charset=UTF-8"
Expand Down Expand Up @@ -205,6 +207,8 @@ func FileExtensionRuntimes(op OpenWhiskInfo) (ext map[string]string) {
ext[JAR_FILE_EXTENSION] = k
} else if strings.Contains(k, RUBY_RUNTIME) {
ext[RUBY_FILE_EXTENSION] = k
} else if strings.Contains(k, RUST_RUNTIME) {
ext[RUST_FILE_EXTENSION] = k
} else if strings.Contains(k, GO_RUNTIME) {
ext[GO_FILE_EXTENSION] = k
} else if strings.Contains(k, DOTNET_RUNTIME) {
Expand Down Expand Up @@ -233,6 +237,8 @@ func FileRuntimeExtensions(op OpenWhiskInfo) (rte map[string]string) {
rte[v[i].Kind] = JAVA_FILE_EXTENSION
} else if strings.Contains(k, RUBY_RUNTIME) {
rte[v[i].Kind] = RUBY_FILE_EXTENSION
} else if strings.Contains(k, RUST_RUNTIME) {
rte[v[i].Kind] = RUST_FILE_EXTENSION
} else if strings.Contains(k, GO_RUNTIME) {
rte[v[i].Kind] = GO_FILE_EXTENSION
} else if strings.Contains(k, DOTNET_RUNTIME) {
Expand Down