Fix: parse template disable resolve provider functions (#5905)

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>
This commit is contained in:
JohnJan
2023-04-24 09:57:16 +08:00
committed by GitHub
parent 1aaab58f15
commit efb2f1b083
2 changed files with 1 additions and 4 deletions

View File

@@ -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"

View File

@@ -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)
}