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:
@@ -71,7 +71,7 @@ func (r *PackageResource) Schema(_ context.Context, _ resource.SchemaRequest, re
|
||||
},
|
||||
"source_dir": schema.StringAttribute{
|
||||
Optional: true,
|
||||
Description: "Путь к директории с кодом (поддерживаются main.py, main.js, main.go).",
|
||||
Description: "Путь к директории с кодом (поддерживаются main.py, main.js, main.go, main.php, main.rb, main.pl).",
|
||||
},
|
||||
"code_path": schema.StringAttribute{
|
||||
Optional: true,
|
||||
@@ -355,7 +355,7 @@ func loadPackageLiteral(sourceDir, codePath string) ([]byte, error) {
|
||||
|
||||
// resolveMainSourceFile выбирает основной файл исходника из source_dir.
|
||||
func resolveMainSourceFile(sourceDir string) (string, error) {
|
||||
candidates := []string{"main.py", "main.js", "main.go"}
|
||||
candidates := []string{"main.py", "main.js", "main.go", "main.php", "main.rb", "main.pl"}
|
||||
for _, candidate := range candidates {
|
||||
candidatePath := filepath.Join(sourceDir, candidate)
|
||||
fileInfo, err := os.Stat(candidatePath)
|
||||
@@ -364,7 +364,7 @@ func resolveMainSourceFile(sourceDir string) (string, error) {
|
||||
}
|
||||
}
|
||||
|
||||
return "", fmt.Errorf("source_dir %q must contain one of: main.py, main.js, main.go", sourceDir)
|
||||
return "", fmt.Errorf("source_dir %q must contain one of: main.py, main.js, main.go, main.php, main.rb, main.pl", sourceDir)
|
||||
}
|
||||
|
||||
// packageToUnstructured преобразует Terraform model в Kubernetes CRD payload.
|
||||
|
||||
Reference in New Issue
Block a user