mirror of
https://github.com/kubevela/kubevela.git
synced 2026-02-14 10:00:06 +00:00
Fix: parse template disable resolve provider functions (#5905)
Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>
This commit is contained in:
@@ -76,9 +76,6 @@ const TemplateValidationReturns = SaveTemplateKey + ".validation.$returns"
|
||||
// TemplateOutput define the key name for the config-template output
|
||||
const TemplateOutput = SaveTemplateKey + ".output"
|
||||
|
||||
// TemplateParameter define the key name for the config-template parameter
|
||||
const TemplateParameter = SaveTemplateKey + ".parameter"
|
||||
|
||||
// TemplateOutputs define the key name for the config-template outputs
|
||||
const TemplateOutputs = SaveTemplateKey + ".outputs"
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ func (c CUE) ParseToValue() (*value.Value, error) {
|
||||
func (c CUE) ParseToValueWithCueX() (cuelang.Value, error) {
|
||||
// the cue script must be first, it could include the imports
|
||||
template := string(c) + "\n" + cue.BaseTemplate
|
||||
val, err := velacuex.KubeVelaDefaultCompiler.Get().CompileString(context.Background(), template)
|
||||
val, err := velacuex.KubeVelaDefaultCompiler.Get().CompileStringWithOptions(context.Background(), template, cuex.DisableResolveProviderFunctions{})
|
||||
if err != nil {
|
||||
return cuelang.Value{}, fmt.Errorf("failed to compile config template: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user