feat: multi-language support — PHP, Ruby, Perl, Go (binary-env)
- PHP: ghcr.io/fission/php-env, entrypoint main.php::handler
- Ruby: ghcr.io/fission/ruby-env, entrypoint handler (single-word)
- Perl: ghcr.io/fission/perl-env (version=1), sub {} return value
- Go: ghcr.io/fission/binary-env with pre-compiled binary (shell script placeholder)
Provider changes:
- package_resource: added main.php, main.rb, main.pl to source_dir candidates
- function_resource: relaxed entrypoint validation to allow PHP (::), Ruby, Perl (single-word)
- function_resource_test: updated BadFormat test to reflect new valid formats
This commit is contained in:
@@ -70,7 +70,12 @@ func TestValidateEntrypointAgainstPackageSourcePythonMissing(t *testing.T) {
|
||||
|
||||
func TestValidateEntrypointAgainstPackageSourceBadFormat(t *testing.T) {
|
||||
pkg := &unstructured.Unstructured{}
|
||||
if err := validateEntrypointAgainstPackageSource("main", pkg); err == nil {
|
||||
t.Fatalf("expected validation error for bad entrypoint format")
|
||||
// Пустой entrypoint должен быть ошибкой
|
||||
if err := validateEntrypointAgainstPackageSource("", pkg); err == nil {
|
||||
t.Fatalf("expected validation error for empty entrypoint")
|
||||
}
|
||||
// Одиночное слово допустимо (Ruby, Perl)
|
||||
if err := validateEntrypointAgainstPackageSource("handler", pkg); err != nil {
|
||||
t.Fatalf("unexpected error for single-word entrypoint: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user