mirror of
https://github.com/kubevela/kubevela.git
synced 2026-02-14 18:10:21 +00:00
generate OpenAPI schema for Helm schematic compDef (#1250)
* get JSON schema for Helm schematic ComponentDefinition Signed-off-by: roy wang <seiwy2010@gmail.com> * add e2e test update doc add unit tests Signed-off-by: roywang <seiwy2010@gmail.com>
This commit is contained in:
@@ -340,6 +340,7 @@ var _ = Describe("Versioning mechanism of components", func() {
|
||||
var w1 unstructured.Unstructured
|
||||
Eventually(
|
||||
func() error {
|
||||
reconcileAppConfigNow(ctx, &appconfig)
|
||||
w1.SetAPIVersion("example.com/v1")
|
||||
w1.SetKind("Bar")
|
||||
return k8sClient.Get(ctx, client.ObjectKey{Namespace: namespace, Name: revisionNameV1}, &w1)
|
||||
|
||||
@@ -2,6 +2,7 @@ package controllers_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -285,4 +286,18 @@ var _ = Describe("Test application containing helm module", func() {
|
||||
}, 120*time.Second, 10*time.Second).Should(BeTrue())
|
||||
})
|
||||
|
||||
It("Test store JSON schema of Helm Chart in ConfigMap", func() {
|
||||
By("Get the ConfigMap")
|
||||
cmName := fmt.Sprintf("schema-%s", cdName)
|
||||
Eventually(func() error {
|
||||
cm := &corev1.ConfigMap{}
|
||||
if err := k8sClient.Get(ctx, client.ObjectKey{Name: cmName, Namespace: namespace}, cm); err != nil {
|
||||
return err
|
||||
}
|
||||
if cm.Data["openapi-v3-json-schema"] == "" {
|
||||
return errors.New("json schema is not found in the ConfigMap")
|
||||
}
|
||||
return nil
|
||||
}, 60*time.Second, 5*time.Second).Should(Succeed())
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user