mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-19 04:26:39 +00:00
Merge pull request #435 from captainroy-hy/cap-template-URI
fix getting CUE template from remote
This commit is contained in:
@@ -132,6 +132,7 @@ func HandleTemplate(in *runtime.RawExtension, name, syncDir string) (types.Capab
|
||||
return types.Capability{}, err
|
||||
}
|
||||
cueTemplate = string(b)
|
||||
tmp.CueTemplate = cueTemplate
|
||||
} else {
|
||||
if tmp.CueTemplate == "" {
|
||||
return types.Capability{}, errors.New("template not exist in definition")
|
||||
|
||||
@@ -107,6 +107,9 @@ var _ = Describe("DefinitionFiles", func() {
|
||||
Expect(err).Should(BeNil())
|
||||
logf.Log.Info(fmt.Sprintf("Getting trait definitions %v", traitDefs))
|
||||
for i := range traitDefs {
|
||||
// CueTemplate should always be fulfilled, even those whose CueTemplateURI is assigend,
|
||||
By("check CueTemplate is fulfilled")
|
||||
Expect(traitDefs[i].CueTemplate).ShouldNot(BeEmpty())
|
||||
traitDefs[i].CueTemplate = ""
|
||||
traitDefs[i].DefinitionPath = ""
|
||||
}
|
||||
@@ -120,6 +123,9 @@ var _ = Describe("DefinitionFiles", func() {
|
||||
Expect(err).Should(BeNil())
|
||||
logf.Log.Info(fmt.Sprintf("Getting workload definitions %v", workloadDefs))
|
||||
for i := range workloadDefs {
|
||||
// CueTemplate should always be fulfilled, even those whose CueTemplateURI is assigend,
|
||||
By("check CueTemplate is fulfilled")
|
||||
Expect(workloadDefs[i].CueTemplate).ShouldNot(BeEmpty())
|
||||
workloadDefs[i].CueTemplate = ""
|
||||
workloadDefs[i].DefinitionPath = ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user