diff --git a/charts/vela-core/templates/defwithtemplate/autoscale.yaml b/charts/vela-core/templates/defwithtemplate/autoscale.yaml index 8db3037cb..7665d539b 100644 --- a/charts/vela-core/templates/defwithtemplate/autoscale.yaml +++ b/charts/vela-core/templates/defwithtemplate/autoscale.yaml @@ -38,6 +38,7 @@ spec: condition: { type: "Utilization" if parameter["cpuPercent"] != _|_ { + // Temporarily use `strconv` for type converting. This bug will be fixed in kubevela#585 value: strconv.FormatInt(parameter.cpuPercent, 10) } } diff --git a/charts/vela-core/templates/defwithtemplate/webservice.yaml b/charts/vela-core/templates/defwithtemplate/webservice.yaml index 64ea23c19..a63fe31a9 100644 --- a/charts/vela-core/templates/defwithtemplate/webservice.yaml +++ b/charts/vela-core/templates/defwithtemplate/webservice.yaml @@ -82,7 +82,7 @@ spec: } } }] - // +usage=Number of CPU units for the service, like `500m` (0.5 CPU core), `1` (1 CPU core) + // +usage=Number of CPU units for the service, like `0.5` (0.5 CPU core), `1` (1 CPU core) cpu?: string } diff --git a/docs/en/developers/references/workload-types/web-service.md b/docs/en/developers/references/workload-types/web-service.md index 674989916..914909c7c 100644 --- a/docs/en/developers/references/workload-types/web-service.md +++ b/docs/en/developers/references/workload-types/web-service.md @@ -38,7 +38,7 @@ Name | Type | Description | Notes **Env** | [**[]WebserviceEnv**](#webserviceenv) | | [optional] **Image** | **string** | Which image would you like to use for your service | **Port** | **int32** | Which port do you want customer traffic sent to | [default to 80] -**cpu** | **string** | Number of CPU units for the service, like `500m` (0.5 CPU core), `1` (1 CPU core) | [optional] +**cpu** | **string** | Number of CPU units for the service, like `0.5` (0.5 CPU core), `1` (1 CPU core) | [optional] ### WebserviceEnv diff --git a/e2e/commonContext.go b/e2e/commonContext.go index fd818b0ee..316b9a79e 100644 --- a/e2e/commonContext.go +++ b/e2e/commonContext.go @@ -286,7 +286,7 @@ var ( a: "8080", }, { - q: "Number of CPU units for the service, like `500m` (0.5 CPU core), `1` (1 CPU core) (optional):", + q: "Number of CPU units for the service, like `0.5` (0.5 CPU core), `1` (1 CPU core) (optional):", a: "0.5", }, } diff --git a/hack/vela-templates/cue/autoscale.cue b/hack/vela-templates/cue/autoscale.cue index 0f3992ea9..db0679a7f 100644 --- a/hack/vela-templates/cue/autoscale.cue +++ b/hack/vela-templates/cue/autoscale.cue @@ -23,6 +23,7 @@ cpuScaler: { condition: { type: "Utilization" if parameter["cpuPercent"] != _|_ { + // Temporarily use `strconv` for type converting. This bug will be fixed in kubevela#585 value: strconv.FormatInt(parameter.cpuPercent, 10) } } diff --git a/hack/vela-templates/cue/webservice.cue b/hack/vela-templates/cue/webservice.cue index 627022f8e..049757c74 100644 --- a/hack/vela-templates/cue/webservice.cue +++ b/hack/vela-templates/cue/webservice.cue @@ -71,6 +71,6 @@ parameter: { } } }] - // +usage=Number of CPU units for the service, like `500m` (0.5 CPU core), `1` (1 CPU core) + // +usage=Number of CPU units for the service, like `0.5` (0.5 CPU core), `1` (1 CPU core) cpu?: string }