CLI 无法创建「微服务应用函数」:CreateFunction(CpuStrategy=always) 实际建成「云沙箱」,且 help/文档无说明、无法区分

Open
#33 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
go
Domain
api, cli, documentation

Research direction

Review the ve vefaas CreateFunction --help output and the linked Go SDK example, then compare the resulting resources through ListFunctions, ListSandboxes, and GetFunction. Done means the CLI or its documentation explains how function types are selected and distinguished, including the CpuStrategy=always ambiguity, with the misleading SDK example addressed.

Written by the indexing model from the issue text.

Description

问题

veFaaS 控制台「创建函数」提供 4 种类型(事件函数 / Web 应用函数 / 微服务应用函数 / 任务函数),但 CLI 没有任何文档或 --help 说明如何创建「微服务应用函数」,照现有资料操作会建错资源。

实测:参照官方 Go SDK 文档示例(把 CpuStrategy:"always" 标注为「创建微服务应用」,见 https://www.volcengine.com/docs/6662/1386372 ),执行

ve vefaas CreateFunction --body '{
  "Name":"...","SourceType":"image","Source":"...:tag",
  "CpuStrategy":"always","MemoryMB":512,"Port":8000,
  "VpcConfig":{...},"Envs":[...]
}'

创建后得到的是 云沙箱(Cloud Sandbox):它出现在控制台「云沙箱」页 / ListSandboxes不在函数列表 ListFunctions,也无法当作微服务应用来启用/管理。真正的「微服务应用函数」目前只能在控制台用「微服务应用函数」入口创建(创建后才会出现在 ListFunctions、可 Release / UpdateFunctionResource 设常驻实例)。

无法区分两者

对创建出的资源调用 GetFunctionCpuStrategy(两者都是 always)、InstanceType(空)、FunctionType(空)等字段都无法区分它是「云沙箱」还是「微服务应用函数」——CLI 层面没有任何可判别的字段或开关。

help 不全

ve vefaas CreateFunction --help 只列出 body 字段模板,未说明

  • 哪个字段/取值决定函数类型(事件 / Web 应用 / 微服务应用 / 任务);
  • 如何通过 CLI 创建「微服务应用函数」;
  • CpuStrategy=always 同时被云沙箱与微服务应用使用,二者到底靠什么区分。

期望

  1. CLI --help / 文档明确给出用 CLI 创建各类型函数(尤其「微服务应用函数」)的方法及其判别字段
  2. 或提供专门的参数/动作来显式指定要创建的函数类型;
  3. 修正 Go SDK 文档(6662/1386372)中把 CpuStrategy=always 直接等同于「创建微服务应用」的误导性示例。

影响

用户(以及照官方示例操作的自动化 / AI 工具)会误把「微服务应用」建成「云沙箱」,且事后无法从 CLI 判别建出来的是哪一种,排查与纠错成本很高。

环境:ve darwin/arm64,复现于 v1.0.47 与 v1.0.48。

Dominant language
Go
Stars
67
Forks
8
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from volcengine/volcengine-cli

All issues in volcengine/volcengine-cli

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.