mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-19 04:26:39 +00:00
Feat: add filter in list definitions (#2835)
* Feat: add filter in list definitions * add workload type
This commit is contained in:
+12
-2
@@ -36,8 +36,18 @@ const (
|
||||
)
|
||||
|
||||
const (
|
||||
// AnnDescription is the annotation which describe what is the capability used for in a WorkloadDefinition/TraitDefinition Object
|
||||
AnnDescription = "definition.oam.dev/description"
|
||||
// AnnoDefinitionDescription is the annotation which describe what is the capability used for in a WorkloadDefinition/TraitDefinition Object
|
||||
AnnoDefinitionDescription = "definition.oam.dev/description"
|
||||
// AnnoDefinitionAppliedWorkloads is the annotation which describe what is the workloads used for in a TraitDefinition Object
|
||||
AnnoDefinitionAppliedWorkloads = "definition.oam.dev/appliedWorkloads"
|
||||
// LabelDefinition is the label for definition
|
||||
LabelDefinition = "definition.oam.dev"
|
||||
// LabelDefinitionName is the label for definition name
|
||||
LabelDefinitionName = "definition.oam.dev/name"
|
||||
// LabelDefinitionDeprecated is the label which describe whether the capability is deprecated
|
||||
LabelDefinitionDeprecated = "custom.definition.oam.dev/deprecated"
|
||||
// LabelDefinitionHidden is the label which describe whether the capability is hidden by UI
|
||||
LabelDefinitionHidden = "custom.definition.oam.dev/ui-hidden"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -5766,8 +5766,6 @@ data:
|
||||
annotations:
|
||||
definition.oam.dev/description: helm release is a group of K8s resources
|
||||
from either git repository or helm repo
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: helm
|
||||
namespace: vela-system
|
||||
spec:
|
||||
@@ -5846,8 +5844,6 @@ data:
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: A list of JSON6902 patch to selected target
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: kustomize-json-patch
|
||||
spec:
|
||||
schematic:
|
||||
@@ -5873,8 +5869,6 @@ data:
|
||||
annotations:
|
||||
definition.oam.dev/description: A list of StrategicMerge or JSON6902 patch
|
||||
to selected target
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: kustomize-patch
|
||||
spec:
|
||||
schematic:
|
||||
@@ -5898,8 +5892,6 @@ data:
|
||||
annotations:
|
||||
definition.oam.dev/description: kustomize can fetching, building, updating
|
||||
and applying Kustomize manifests from git repo.
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: kustomize
|
||||
namespace: vela-system
|
||||
spec:
|
||||
@@ -6011,8 +6003,6 @@ data:
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: A list of strategic merge to kustomize config
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: kustomize-strategy-merge
|
||||
spec:
|
||||
schematic:
|
||||
|
||||
@@ -30,8 +30,6 @@ data:
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: WorkflowStepDefinition
|
||||
metadata:
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: canary-rollout
|
||||
namespace: vela-system
|
||||
spec:
|
||||
@@ -101,8 +99,6 @@ data:
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: use istio to manage in-cluster traffic
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: istio-gateway
|
||||
namespace: vela-system
|
||||
spec:
|
||||
@@ -132,8 +128,6 @@ data:
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: WorkflowStepDefinition
|
||||
metadata:
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: canary-rollback
|
||||
namespace: vela-system
|
||||
spec:
|
||||
@@ -212,8 +206,6 @@ data:
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: use istio to manage traffic
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: canary-traffic
|
||||
namespace: vela-system
|
||||
spec:
|
||||
|
||||
@@ -31,8 +31,6 @@ data:
|
||||
services that have a stable network endpoint to receive external network
|
||||
traffic from customers. If workload type is skipped for any service defined
|
||||
in Appfile, it will be defaulted to `webservice` type.
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: cloneset
|
||||
namespace: vela-system
|
||||
spec:
|
||||
@@ -142,8 +140,6 @@ data:
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: WorkflowStepDefinition
|
||||
metadata:
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: predownloadimage
|
||||
spec:
|
||||
schematic:
|
||||
|
||||
@@ -27,7 +27,6 @@ data:
|
||||
definition.oam.dev/description: Terraform configuration for Alibaba Cloud
|
||||
ACK cluster
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
type: terraform
|
||||
name: alibaba-ack
|
||||
namespace: vela-system
|
||||
@@ -51,7 +50,6 @@ data:
|
||||
definition.oam.dev/description: Terraform configuration for Alibaba Cloud
|
||||
Serverless Kubernetes (ASK)
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
type: terraform
|
||||
name: alibaba-ask
|
||||
namespace: vela-system
|
||||
@@ -75,7 +73,6 @@ data:
|
||||
definition.oam.dev/description: Terraform configuration for Alibaba Cloud
|
||||
Elastic IP
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
type: terraform
|
||||
name: alibaba-eip
|
||||
namespace: vela-system
|
||||
@@ -100,7 +97,6 @@ data:
|
||||
definition.oam.dev/description: Terraform configuration for Alibaba Cloud
|
||||
OSS object
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
type: terraform
|
||||
name: alibaba-oss
|
||||
namespace: vela-system
|
||||
@@ -131,7 +127,6 @@ data:
|
||||
definition.oam.dev/description: Terraform configuration for Alibaba Cloud
|
||||
RDS object
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
type: terraform
|
||||
name: alibaba-rds
|
||||
namespace: vela-system
|
||||
@@ -212,7 +207,6 @@ data:
|
||||
definition.oam.dev/description: Terraform configuration for Alibaba Cloud
|
||||
Redis
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
type: terraform
|
||||
name: alibaba-redis
|
||||
namespace: vela-system
|
||||
@@ -235,7 +229,6 @@ data:
|
||||
definition.oam.dev/description: Terraform configuration for Alibaba Cloud
|
||||
SLS Project
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
type: terraform
|
||||
name: alibaba-sls-project
|
||||
namespace: vela-system
|
||||
@@ -259,7 +252,6 @@ data:
|
||||
definition.oam.dev/description: Terraform configuration for Alibaba Cloud
|
||||
SLS Store
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
type: terraform
|
||||
name: alibaba-sls-store
|
||||
namespace: vela-system
|
||||
@@ -283,7 +275,6 @@ data:
|
||||
definition.oam.dev/description: Terraform configuration for Alibaba Cloud
|
||||
VPC
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
type: terraform
|
||||
name: alibaba-vpc
|
||||
namespace: vela-system
|
||||
@@ -307,7 +298,6 @@ data:
|
||||
definition.oam.dev/description: Terraform configuration for Alibaba Cloud
|
||||
VSwitch
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
type: terraform
|
||||
name: alibaba-vswitch
|
||||
namespace: vela-system
|
||||
@@ -330,7 +320,6 @@ data:
|
||||
annotations:
|
||||
definition.oam.dev/description: Terraform configuration for AWS S3
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
type: terraform
|
||||
name: aws-s3
|
||||
namespace: vela-system
|
||||
@@ -373,7 +362,6 @@ data:
|
||||
Mariadb
|
||||
provider: azure
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
type: terraform
|
||||
name: azure-database-mariadb
|
||||
namespace: vela-system
|
||||
@@ -490,7 +478,6 @@ data:
|
||||
Account
|
||||
provider: azure
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
type: terraform
|
||||
name: azure-storage-account
|
||||
namespace: vela-system
|
||||
|
||||
@@ -248,4 +248,5 @@ spec:
|
||||
definition:
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
type: jobs.batch
|
||||
|
||||
|
||||
@@ -509,4 +509,5 @@ spec:
|
||||
definition:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
type: deployments.apps
|
||||
|
||||
|
||||
@@ -413,4 +413,5 @@ spec:
|
||||
definition:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
type: deployments.apps
|
||||
|
||||
|
||||
@@ -248,4 +248,5 @@ spec:
|
||||
definition:
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
type: jobs.batch
|
||||
|
||||
|
||||
@@ -509,4 +509,5 @@ spec:
|
||||
definition:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
type: deployments.apps
|
||||
|
||||
|
||||
@@ -413,4 +413,5 @@ spec:
|
||||
definition:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
type: deployments.apps
|
||||
|
||||
|
||||
@@ -484,9 +484,10 @@ type DetailDefinitionResponse struct {
|
||||
|
||||
// DefinitionBase is the definition base model
|
||||
type DefinitionBase struct {
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Icon string `json:"icon"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
WorkloadType string `json:"workloadType,omitempty"`
|
||||
Icon string `json:"icon"`
|
||||
}
|
||||
|
||||
// CreatePolicyRequest create app policy
|
||||
|
||||
@@ -24,15 +24,18 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/getkin/kin-openapi/openapi3"
|
||||
"github.com/pkg/errors"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
k8stypes "k8s.io/apimachinery/pkg/types"
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
"sigs.k8s.io/yaml"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha2"
|
||||
"github.com/oam-dev/kubevela/apis/core.oam.dev/v1beta1"
|
||||
"github.com/oam-dev/kubevela/apis/types"
|
||||
"github.com/oam-dev/kubevela/pkg/apiserver/clients"
|
||||
"github.com/oam-dev/kubevela/pkg/apiserver/log"
|
||||
@@ -44,7 +47,7 @@ import (
|
||||
// DefinitionUsecase definition usecase, Implement the management of ComponentDefinition、TraitDefinition and WorkflowStepDefinition.
|
||||
type DefinitionUsecase interface {
|
||||
// ListDefinitions list definition base info
|
||||
ListDefinitions(ctx context.Context, envName, defType string) ([]*apisv1.DefinitionBase, error)
|
||||
ListDefinitions(ctx context.Context, envName, defType, appliedWorkloads string) ([]*apisv1.DefinitionBase, error)
|
||||
// DetailDefinition get definition detail
|
||||
DetailDefinition(ctx context.Context, name, defType string) (*apisv1.DetailDefinitionResponse, error)
|
||||
// AddDefinitionUISchema add or update custom definition ui schema
|
||||
@@ -74,46 +77,88 @@ func NewDefinitionUsecase() DefinitionUsecase {
|
||||
return &definitionUsecaseImpl{kubeClient: kubecli, caches: make(map[string]*utils.MemoryCache)}
|
||||
}
|
||||
|
||||
func (d *definitionUsecaseImpl) ListDefinitions(ctx context.Context, envName, defType string) ([]*apisv1.DefinitionBase, error) {
|
||||
func (d *definitionUsecaseImpl) ListDefinitions(ctx context.Context, envName, defType, appliedWorkload string) ([]*apisv1.DefinitionBase, error) {
|
||||
defs := &unstructured.UnstructuredList{}
|
||||
switch defType {
|
||||
case "component":
|
||||
defs.SetAPIVersion(definitionAPIVersion)
|
||||
defs.SetKind(kindComponentDefinition)
|
||||
return d.listDefinitions(ctx, defs, kindComponentDefinition)
|
||||
return d.listDefinitions(ctx, defs, kindComponentDefinition, "")
|
||||
|
||||
case "trait":
|
||||
defs.SetAPIVersion(definitionAPIVersion)
|
||||
defs.SetKind(kindTraitDefinition)
|
||||
return d.listDefinitions(ctx, defs, kindTraitDefinition)
|
||||
return d.listDefinitions(ctx, defs, kindTraitDefinition, appliedWorkload)
|
||||
|
||||
case "workflowstep":
|
||||
defs.SetAPIVersion(definitionAPIVersion)
|
||||
defs.SetKind(kindWorkflowStepDefinition)
|
||||
return d.listDefinitions(ctx, defs, kindWorkflowStepDefinition)
|
||||
return d.listDefinitions(ctx, defs, kindWorkflowStepDefinition, "")
|
||||
|
||||
default:
|
||||
return nil, bcode.ErrDefinitionTypeNotSupport
|
||||
}
|
||||
}
|
||||
|
||||
func (d *definitionUsecaseImpl) listDefinitions(ctx context.Context, list *unstructured.UnstructuredList, cache string) ([]*apisv1.DefinitionBase, error) {
|
||||
if mc := d.caches[cache]; mc != nil && !mc.IsExpired() {
|
||||
func (d *definitionUsecaseImpl) listDefinitions(ctx context.Context, list *unstructured.UnstructuredList, cache, appliedWorkload string) ([]*apisv1.DefinitionBase, error) {
|
||||
if mc := d.caches[cache]; mc != nil && !mc.IsExpired() && appliedWorkload == "" {
|
||||
return mc.GetData().([]*apisv1.DefinitionBase), nil
|
||||
}
|
||||
matchLabels := metav1.LabelSelector{
|
||||
MatchExpressions: []metav1.LabelSelectorRequirement{
|
||||
{
|
||||
Key: types.LabelDefinitionDeprecated,
|
||||
Operator: metav1.LabelSelectorOpDoesNotExist,
|
||||
},
|
||||
{
|
||||
Key: types.LabelDefinitionHidden,
|
||||
Operator: metav1.LabelSelectorOpDoesNotExist,
|
||||
},
|
||||
},
|
||||
}
|
||||
selector, err := metav1.LabelSelectorAsSelector(&matchLabels)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := d.kubeClient.List(ctx, list, &client.ListOptions{
|
||||
Namespace: types.DefaultKubeVelaNS,
|
||||
LabelSelector: selector,
|
||||
}); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var defs []*apisv1.DefinitionBase
|
||||
for _, def := range list.Items {
|
||||
defs = append(defs, &apisv1.DefinitionBase{
|
||||
if appliedWorkload != "" {
|
||||
traitDef := &v1beta1.TraitDefinition{}
|
||||
if err := runtime.DefaultUnstructuredConverter.FromUnstructured(def.Object, traitDef); err != nil {
|
||||
return nil, errors.Wrap(err, "invalid trait definition")
|
||||
}
|
||||
filter := false
|
||||
for _, workload := range traitDef.Spec.AppliesToWorkloads {
|
||||
if workload == appliedWorkload || workload == "*" {
|
||||
filter = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !filter {
|
||||
continue
|
||||
}
|
||||
}
|
||||
definition := &apisv1.DefinitionBase{
|
||||
Name: def.GetName(),
|
||||
Description: def.GetAnnotations()[types.AnnDescription],
|
||||
})
|
||||
Description: def.GetAnnotations()[types.AnnoDefinitionDescription],
|
||||
}
|
||||
if cache == kindComponentDefinition {
|
||||
compDef := &v1beta1.ComponentDefinition{}
|
||||
if err := runtime.DefaultUnstructuredConverter.FromUnstructured(def.Object, compDef); err != nil {
|
||||
return nil, errors.Wrap(err, "invalid component definition")
|
||||
}
|
||||
definition.WorkloadType = compDef.Spec.Workload.Type
|
||||
}
|
||||
defs = append(defs, definition)
|
||||
}
|
||||
if appliedWorkload == "" {
|
||||
d.caches[cache] = utils.NewMemoryCache(defs, time.Minute*3)
|
||||
}
|
||||
d.caches[cache] = utils.NewMemoryCache(defs, time.Minute*3)
|
||||
return defs, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ var _ = Describe("Test namespace usecase functions", func() {
|
||||
Expect(err).Should(Succeed())
|
||||
err = k8sClient.Create(context.Background(), &cd)
|
||||
Expect(err).Should(Succeed())
|
||||
components, err := definitionUsecase.ListDefinitions(context.TODO(), "", "component")
|
||||
components, err := definitionUsecase.ListDefinitions(context.TODO(), "", "component", "")
|
||||
Expect(err).Should(BeNil())
|
||||
Expect(cmp.Diff(len(components), 1)).Should(BeEmpty())
|
||||
Expect(cmp.Diff(components[0].Name, "webservice-test")).Should(BeEmpty())
|
||||
@@ -74,7 +74,7 @@ var _ = Describe("Test namespace usecase functions", func() {
|
||||
Expect(err).Should(Succeed())
|
||||
err = k8sClient.Create(context.Background(), &td)
|
||||
Expect(err).Should(Succeed())
|
||||
traits, err := definitionUsecase.ListDefinitions(context.TODO(), "", "trait")
|
||||
traits, err := definitionUsecase.ListDefinitions(context.TODO(), "", "trait", "")
|
||||
Expect(err).Should(BeNil())
|
||||
Expect(cmp.Diff(len(traits), 1)).Should(BeEmpty())
|
||||
Expect(cmp.Diff(traits[0].Name, "myingress")).Should(BeEmpty())
|
||||
@@ -88,7 +88,7 @@ var _ = Describe("Test namespace usecase functions", func() {
|
||||
Expect(err).Should(Succeed())
|
||||
err = k8sClient.Create(context.Background(), &sd)
|
||||
Expect(err).Should(Succeed())
|
||||
wfstep, err := definitionUsecase.ListDefinitions(context.TODO(), "", "workflowstep")
|
||||
wfstep, err := definitionUsecase.ListDefinitions(context.TODO(), "", "workflowstep", "")
|
||||
Expect(err).Should(BeNil())
|
||||
Expect(cmp.Diff(len(wfstep), 1)).Should(BeEmpty())
|
||||
Expect(cmp.Diff(wfstep[0].Name, "apply-application")).Should(BeEmpty())
|
||||
|
||||
@@ -43,6 +43,7 @@ func (d *definitionWebservice) GetWebService() *restful.WebService {
|
||||
Metadata(restfulspec.KeyOpenAPITags, tags).
|
||||
Param(ws.QueryParameter("type", "query the definition type").DataType("string").Required(true).AllowableValues(map[string]string{"component": "", "trait": "", "workflowstep": ""})).
|
||||
Param(ws.QueryParameter("envName", "if specified, query the definition supported by the env.").DataType("string")).
|
||||
Param(ws.QueryParameter("appliedWorkload", "if specified, query the trait definition applied to the workload.").DataType("string")).
|
||||
Returns(200, "", apis.ListDefinitionResponse{}).
|
||||
Writes(apis.ListDefinitionResponse{}).Do(returns200, returns500))
|
||||
|
||||
@@ -64,7 +65,7 @@ func NewDefinitionWebservice(du usecase.DefinitionUsecase) WebService {
|
||||
}
|
||||
|
||||
func (d *definitionWebservice) listDefinitions(req *restful.Request, res *restful.Response) {
|
||||
definitions, err := d.definitionUsecase.ListDefinitions(req.Request.Context(), req.QueryParameter("envName"), req.QueryParameter("type"))
|
||||
definitions, err := d.definitionUsecase.ListDefinitions(req.Request.Context(), req.QueryParameter("envName"), req.QueryParameter("type"), req.QueryParameter("appliedWorkload"))
|
||||
if err != nil {
|
||||
bcode.ReturnError(req, res, err)
|
||||
return
|
||||
|
||||
@@ -249,7 +249,7 @@ func (def *CapabilityComponentDefinition) StoreOpenAPISchema(ctx context.Context
|
||||
Controller: pointer.BoolPtr(true),
|
||||
BlockOwnerDeletion: pointer.BoolPtr(true),
|
||||
}}
|
||||
cmName, err := def.CreateOrUpdateConfigMap(ctx, k8sClient, namespace, componentDefinition.Name, typeComponentDefinition, jsonSchema, ownerReference)
|
||||
cmName, err := def.CreateOrUpdateConfigMap(ctx, k8sClient, namespace, componentDefinition.Name, typeComponentDefinition, componentDefinition.Labels, nil, jsonSchema, ownerReference)
|
||||
if err != nil {
|
||||
return cmName, err
|
||||
}
|
||||
@@ -267,7 +267,7 @@ func (def *CapabilityComponentDefinition) StoreOpenAPISchema(ctx context.Context
|
||||
Controller: pointer.BoolPtr(true),
|
||||
BlockOwnerDeletion: pointer.BoolPtr(true),
|
||||
}}
|
||||
_, err = def.CreateOrUpdateConfigMap(ctx, k8sClient, namespace, revName, typeComponentDefinition, jsonSchema, ownerReference)
|
||||
_, err = def.CreateOrUpdateConfigMap(ctx, k8sClient, namespace, revName, typeComponentDefinition, defRev.Spec.ComponentDefinition.Labels, nil, jsonSchema, ownerReference)
|
||||
if err != nil {
|
||||
return cmName, err
|
||||
}
|
||||
@@ -330,7 +330,7 @@ func (def *CapabilityTraitDefinition) StoreOpenAPISchema(ctx context.Context, k8
|
||||
Controller: pointer.BoolPtr(true),
|
||||
BlockOwnerDeletion: pointer.BoolPtr(true),
|
||||
}}
|
||||
cmName, err := def.CreateOrUpdateConfigMap(ctx, k8sClient, namespace, traitDefinition.Name, typeTraitDefinition, jsonSchema, ownerReference)
|
||||
cmName, err := def.CreateOrUpdateConfigMap(ctx, k8sClient, namespace, traitDefinition.Name, typeTraitDefinition, traitDefinition.Labels, traitDefinition.Spec.AppliesToWorkloads, jsonSchema, ownerReference)
|
||||
if err != nil {
|
||||
return cmName, err
|
||||
}
|
||||
@@ -348,7 +348,7 @@ func (def *CapabilityTraitDefinition) StoreOpenAPISchema(ctx context.Context, k8
|
||||
Controller: pointer.BoolPtr(true),
|
||||
BlockOwnerDeletion: pointer.BoolPtr(true),
|
||||
}}
|
||||
_, err = def.CreateOrUpdateConfigMap(ctx, k8sClient, namespace, revName, typeTraitDefinition, jsonSchema, ownerReference)
|
||||
_, err = def.CreateOrUpdateConfigMap(ctx, k8sClient, namespace, revName, typeTraitDefinition, defRev.Spec.TraitDefinition.Labels, defRev.Spec.TraitDefinition.Spec.AppliesToWorkloads, jsonSchema, ownerReference)
|
||||
if err != nil {
|
||||
return cmName, err
|
||||
}
|
||||
@@ -399,7 +399,7 @@ func (def *CapabilityStepDefinition) StoreOpenAPISchema(ctx context.Context, k8s
|
||||
Controller: pointer.BoolPtr(true),
|
||||
BlockOwnerDeletion: pointer.BoolPtr(true),
|
||||
}}
|
||||
cmName, err := def.CreateOrUpdateConfigMap(ctx, k8sClient, namespace, stepDefinition.Name, typeWorkflowStepDefinition, jsonSchema, ownerReference)
|
||||
cmName, err := def.CreateOrUpdateConfigMap(ctx, k8sClient, namespace, stepDefinition.Name, typeWorkflowStepDefinition, stepDefinition.Labels, nil, jsonSchema, ownerReference)
|
||||
if err != nil {
|
||||
return cmName, err
|
||||
}
|
||||
@@ -417,7 +417,7 @@ func (def *CapabilityStepDefinition) StoreOpenAPISchema(ctx context.Context, k8s
|
||||
Controller: pointer.BoolPtr(true),
|
||||
BlockOwnerDeletion: pointer.BoolPtr(true),
|
||||
}}
|
||||
_, err = def.CreateOrUpdateConfigMap(ctx, k8sClient, namespace, revName, typeWorkflowStepDefinition, jsonSchema, ownerReference)
|
||||
_, err = def.CreateOrUpdateConfigMap(ctx, k8sClient, namespace, revName, typeWorkflowStepDefinition, defRev.Spec.WorkflowStepDefinition.Labels, nil, jsonSchema, ownerReference)
|
||||
if err != nil {
|
||||
return cmName, err
|
||||
}
|
||||
@@ -430,12 +430,22 @@ type CapabilityBaseDefinition struct {
|
||||
|
||||
// CreateOrUpdateConfigMap creates ConfigMap to store OpenAPI v3 schema or or updates data in ConfigMap
|
||||
func (def *CapabilityBaseDefinition) CreateOrUpdateConfigMap(ctx context.Context, k8sClient client.Client, namespace,
|
||||
definitionName, definitionType string, jsonSchema []byte, ownerReferences []metav1.OwnerReference) (string, error) {
|
||||
definitionName, definitionType string, labels map[string]string, appliedWorkloads []string, jsonSchema []byte, ownerReferences []metav1.OwnerReference) (string, error) {
|
||||
cmName := fmt.Sprintf("%s-%s%s", definitionType, types.CapabilityConfigMapNamePrefix, definitionName)
|
||||
var cm v1.ConfigMap
|
||||
var data = map[string]string{
|
||||
types.OpenapiV3JSONSchema: string(jsonSchema),
|
||||
}
|
||||
if labels == nil {
|
||||
labels = make(map[string]string)
|
||||
}
|
||||
labels[types.LabelDefinition] = "schema"
|
||||
labels[types.LabelDefinitionName] = definitionName
|
||||
annotations := make(map[string]string)
|
||||
if appliedWorkloads != nil {
|
||||
annotations[types.AnnoDefinitionAppliedWorkloads] = strings.Join(appliedWorkloads, ",")
|
||||
}
|
||||
|
||||
// No need to check the existence of namespace, if it doesn't exist, API server will return the error message
|
||||
// before it's to be reconciled by ComponentDefinition/TraitDefinition controller.
|
||||
err := k8sClient.Get(ctx, client.ObjectKey{Namespace: namespace, Name: cmName}, &cm)
|
||||
@@ -449,10 +459,8 @@ func (def *CapabilityBaseDefinition) CreateOrUpdateConfigMap(ctx context.Context
|
||||
Name: cmName,
|
||||
Namespace: namespace,
|
||||
OwnerReferences: ownerReferences,
|
||||
Labels: map[string]string{
|
||||
"definition.oam.dev": "schema",
|
||||
"definition.oam.dev/name": definitionName,
|
||||
},
|
||||
Labels: labels,
|
||||
Annotations: annotations,
|
||||
},
|
||||
Data: data,
|
||||
}
|
||||
@@ -465,6 +473,8 @@ func (def *CapabilityBaseDefinition) CreateOrUpdateConfigMap(ctx context.Context
|
||||
}
|
||||
|
||||
cm.Data = data
|
||||
cm.Labels = labels
|
||||
cm.Annotations = annotations
|
||||
if err = k8sClient.Update(ctx, &cm); err != nil {
|
||||
return cmName, fmt.Errorf(util.ErrUpdateCapabilityInConfigMap, definitionName, err)
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ spec:
|
||||
Controller: pointer.BoolPtr(true),
|
||||
BlockOwnerDeletion: pointer.BoolPtr(true),
|
||||
}}
|
||||
_, err := def.CreateOrUpdateConfigMap(ctx, k8sClient, namespace, definitionName, typeTraitDefinition, []byte(""), ownerReference)
|
||||
_, err := def.CreateOrUpdateConfigMap(ctx, k8sClient, namespace, definitionName, typeTraitDefinition, nil, nil, []byte(""), ownerReference)
|
||||
Expect(err).Should(BeNil())
|
||||
})
|
||||
})
|
||||
|
||||
@@ -229,7 +229,7 @@ func GetDescription(annotation map[string]string) string {
|
||||
if annotation == nil {
|
||||
return DescriptionUndefined
|
||||
}
|
||||
desc, ok := annotation[types.AnnDescription]
|
||||
desc, ok := annotation[types.AnnoDefinitionDescription]
|
||||
if !ok {
|
||||
return DescriptionUndefined
|
||||
}
|
||||
|
||||
@@ -5763,8 +5763,6 @@ spec:
|
||||
annotations:
|
||||
definition.oam.dev/description: helm release is a group of K8s resources
|
||||
from either git repository or helm repo
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: helm
|
||||
namespace: vela-system
|
||||
spec:
|
||||
@@ -5843,8 +5841,6 @@ spec:
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: A list of JSON6902 patch to selected target
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: kustomize-json-patch
|
||||
spec:
|
||||
schematic:
|
||||
@@ -5870,8 +5866,6 @@ spec:
|
||||
annotations:
|
||||
definition.oam.dev/description: A list of StrategicMerge or JSON6902 patch
|
||||
to selected target
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: kustomize-patch
|
||||
spec:
|
||||
schematic:
|
||||
@@ -5895,8 +5889,6 @@ spec:
|
||||
annotations:
|
||||
definition.oam.dev/description: kustomize can fetching, building, updating
|
||||
and applying Kustomize manifests from git repo.
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: kustomize
|
||||
namespace: vela-system
|
||||
spec:
|
||||
@@ -6008,8 +6000,6 @@ spec:
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: A list of strategic merge to kustomize config
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: kustomize-strategy-merge
|
||||
spec:
|
||||
schematic:
|
||||
|
||||
@@ -27,8 +27,6 @@ spec:
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: WorkflowStepDefinition
|
||||
metadata:
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: canary-rollout
|
||||
namespace: vela-system
|
||||
spec:
|
||||
@@ -98,8 +96,6 @@ spec:
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: use istio to manage in-cluster traffic
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: istio-gateway
|
||||
namespace: vela-system
|
||||
spec:
|
||||
@@ -129,8 +125,6 @@ spec:
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: WorkflowStepDefinition
|
||||
metadata:
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: canary-rollback
|
||||
namespace: vela-system
|
||||
spec:
|
||||
@@ -209,8 +203,6 @@ spec:
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/description: use istio to manage traffic
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: canary-traffic
|
||||
namespace: vela-system
|
||||
spec:
|
||||
|
||||
@@ -28,8 +28,6 @@ spec:
|
||||
services that have a stable network endpoint to receive external network
|
||||
traffic from customers. If workload type is skipped for any service defined
|
||||
in Appfile, it will be defaulted to `webservice` type.
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: cloneset
|
||||
namespace: vela-system
|
||||
spec:
|
||||
@@ -139,8 +137,6 @@ spec:
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: WorkflowStepDefinition
|
||||
metadata:
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: predownloadimage
|
||||
spec:
|
||||
schematic:
|
||||
|
||||
@@ -24,7 +24,6 @@ spec:
|
||||
definition.oam.dev/description: Terraform configuration for Alibaba Cloud
|
||||
ACK cluster
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
type: terraform
|
||||
name: alibaba-ack
|
||||
namespace: vela-system
|
||||
@@ -48,7 +47,6 @@ spec:
|
||||
definition.oam.dev/description: Terraform configuration for Alibaba Cloud
|
||||
Serverless Kubernetes (ASK)
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
type: terraform
|
||||
name: alibaba-ask
|
||||
namespace: vela-system
|
||||
@@ -72,7 +70,6 @@ spec:
|
||||
definition.oam.dev/description: Terraform configuration for Alibaba Cloud
|
||||
Elastic IP
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
type: terraform
|
||||
name: alibaba-eip
|
||||
namespace: vela-system
|
||||
@@ -97,7 +94,6 @@ spec:
|
||||
definition.oam.dev/description: Terraform configuration for Alibaba Cloud
|
||||
OSS object
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
type: terraform
|
||||
name: alibaba-oss
|
||||
namespace: vela-system
|
||||
@@ -128,7 +124,6 @@ spec:
|
||||
definition.oam.dev/description: Terraform configuration for Alibaba Cloud
|
||||
RDS object
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
type: terraform
|
||||
name: alibaba-rds
|
||||
namespace: vela-system
|
||||
@@ -209,7 +204,6 @@ spec:
|
||||
definition.oam.dev/description: Terraform configuration for Alibaba Cloud
|
||||
Redis
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
type: terraform
|
||||
name: alibaba-redis
|
||||
namespace: vela-system
|
||||
@@ -232,7 +226,6 @@ spec:
|
||||
definition.oam.dev/description: Terraform configuration for Alibaba Cloud
|
||||
SLS Project
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
type: terraform
|
||||
name: alibaba-sls-project
|
||||
namespace: vela-system
|
||||
@@ -256,7 +249,6 @@ spec:
|
||||
definition.oam.dev/description: Terraform configuration for Alibaba Cloud
|
||||
SLS Store
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
type: terraform
|
||||
name: alibaba-sls-store
|
||||
namespace: vela-system
|
||||
@@ -280,7 +272,6 @@ spec:
|
||||
definition.oam.dev/description: Terraform configuration for Alibaba Cloud
|
||||
VPC
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
type: terraform
|
||||
name: alibaba-vpc
|
||||
namespace: vela-system
|
||||
@@ -304,7 +295,6 @@ spec:
|
||||
definition.oam.dev/description: Terraform configuration for Alibaba Cloud
|
||||
VSwitch
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
type: terraform
|
||||
name: alibaba-vswitch
|
||||
namespace: vela-system
|
||||
@@ -327,7 +317,6 @@ spec:
|
||||
annotations:
|
||||
definition.oam.dev/description: Terraform configuration for AWS S3
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
type: terraform
|
||||
name: aws-s3
|
||||
namespace: vela-system
|
||||
@@ -370,7 +359,6 @@ spec:
|
||||
Mariadb
|
||||
provider: azure
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
type: terraform
|
||||
name: azure-database-mariadb
|
||||
namespace: vela-system
|
||||
@@ -487,7 +475,6 @@ spec:
|
||||
Account
|
||||
provider: azure
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
type: terraform
|
||||
name: azure-storage-account
|
||||
namespace: vela-system
|
||||
|
||||
@@ -3,8 +3,6 @@ kind: ComponentDefinition
|
||||
metadata:
|
||||
name: helm
|
||||
namespace: vela-system
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
annotations:
|
||||
definition.oam.dev/description: "helm release is a group of K8s resources from either git repository or helm repo"
|
||||
spec:
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: TraitDefinition
|
||||
metadata:
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
annotations:
|
||||
definition.oam.dev/description: "A list of JSON6902 patch to selected target"
|
||||
name: kustomize-json-patch
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: TraitDefinition
|
||||
metadata:
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
annotations:
|
||||
definition.oam.dev/description: "A list of StrategicMerge or JSON6902 patch to selected target"
|
||||
name: kustomize-patch
|
||||
|
||||
@@ -3,8 +3,6 @@ kind: ComponentDefinition
|
||||
metadata:
|
||||
name: kustomize
|
||||
namespace: vela-system
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
annotations:
|
||||
definition.oam.dev/description: "kustomize can fetching, building, updating and applying Kustomize manifests from git repo."
|
||||
spec:
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: TraitDefinition
|
||||
metadata:
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
annotations:
|
||||
definition.oam.dev/description: "A list of strategic merge to kustomize config"
|
||||
name: kustomize-strategy-merge
|
||||
|
||||
@@ -3,8 +3,6 @@ kind: WorkflowStepDefinition
|
||||
metadata:
|
||||
name: canary-rollout
|
||||
namespace: vela-system
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
spec:
|
||||
schematic:
|
||||
cue:
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: TraitDefinition
|
||||
metadata:
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
annotations:
|
||||
definition.oam.dev/description: use istio to manage in-cluster traffic
|
||||
name: istio-gateway
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: WorkflowStepDefinition
|
||||
metadata:
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: canary-rollback
|
||||
namespace: vela-system
|
||||
spec:
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: TraitDefinition
|
||||
metadata:
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
annotations:
|
||||
definition.oam.dev/description: use istio to manage traffic
|
||||
name: canary-traffic
|
||||
|
||||
@@ -3,8 +3,6 @@ kind: ComponentDefinition
|
||||
metadata:
|
||||
name: cloneset
|
||||
namespace: vela-system
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
annotations:
|
||||
definition.oam.dev/description: "Describes long-running, scalable, containerized services that have a stable network endpoint to receive external network traffic from customers.
|
||||
If workload type is skipped for any service defined in Appfile, it will be defaulted to `webservice` type."
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
kind: WorkflowStepDefinition
|
||||
metadata:
|
||||
labels:
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
name: predownloadimage
|
||||
spec:
|
||||
schematic:
|
||||
|
||||
@@ -7,7 +7,6 @@ metadata:
|
||||
definition.oam.dev/description: Terraform configuration for Alibaba Cloud ACK cluster
|
||||
labels:
|
||||
type: terraform
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
spec:
|
||||
workload:
|
||||
definition:
|
||||
|
||||
@@ -7,7 +7,6 @@ metadata:
|
||||
definition.oam.dev/description: Terraform configuration for Alibaba Cloud Serverless Kubernetes (ASK)
|
||||
labels:
|
||||
type: terraform
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
spec:
|
||||
workload:
|
||||
definition:
|
||||
|
||||
@@ -7,7 +7,6 @@ metadata:
|
||||
definition.oam.dev/description: Terraform configuration for Alibaba Cloud Elastic IP
|
||||
labels:
|
||||
type: terraform
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
spec:
|
||||
workload:
|
||||
definition:
|
||||
|
||||
@@ -12,7 +12,6 @@ metadata:
|
||||
# the outputs which are sensitive. Separate them by a comma if there are more than one
|
||||
labels:
|
||||
type: terraform
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
spec:
|
||||
workload:
|
||||
definition:
|
||||
|
||||
@@ -13,7 +13,6 @@ metadata:
|
||||
cloud-resource/sensitive-outputs: "DB_PASSWORD"
|
||||
labels:
|
||||
type: terraform
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
spec:
|
||||
workload:
|
||||
definition:
|
||||
|
||||
@@ -7,7 +7,6 @@ metadata:
|
||||
definition.oam.dev/description: Terraform configuration for Alibaba Cloud Redis
|
||||
labels:
|
||||
type: terraform
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
spec:
|
||||
workload:
|
||||
definition:
|
||||
|
||||
@@ -7,7 +7,6 @@ metadata:
|
||||
definition.oam.dev/description: Terraform configuration for Alibaba Cloud SLS Project
|
||||
labels:
|
||||
type: terraform
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
spec:
|
||||
workload:
|
||||
definition:
|
||||
|
||||
@@ -7,7 +7,6 @@ metadata:
|
||||
definition.oam.dev/description: Terraform configuration for Alibaba Cloud SLS Store
|
||||
labels:
|
||||
type: terraform
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
spec:
|
||||
workload:
|
||||
definition:
|
||||
|
||||
@@ -7,7 +7,6 @@ metadata:
|
||||
definition.oam.dev/description: Terraform configuration for Alibaba Cloud VPC
|
||||
labels:
|
||||
type: terraform
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
spec:
|
||||
workload:
|
||||
definition:
|
||||
|
||||
@@ -7,7 +7,6 @@ metadata:
|
||||
definition.oam.dev/description: Terraform configuration for Alibaba Cloud VSwitch
|
||||
labels:
|
||||
type: terraform
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
spec:
|
||||
workload:
|
||||
definition:
|
||||
|
||||
@@ -7,7 +7,6 @@ metadata:
|
||||
definition.oam.dev/description: Terraform configuration for AWS S3
|
||||
labels:
|
||||
type: terraform
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
spec:
|
||||
workload:
|
||||
definition:
|
||||
|
||||
@@ -8,7 +8,6 @@ metadata:
|
||||
definition.oam.dev/description: Terraform configuration for Azure Database Mariadb
|
||||
labels:
|
||||
type: terraform
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
spec:
|
||||
workload:
|
||||
definition:
|
||||
|
||||
@@ -8,7 +8,6 @@ metadata:
|
||||
provider: azure
|
||||
labels:
|
||||
type: terraform
|
||||
custom.definition.oam.dev/ui-hidden: "true"
|
||||
spec:
|
||||
workload:
|
||||
definition:
|
||||
|
||||
@@ -3,9 +3,12 @@ task: {
|
||||
annotations: {}
|
||||
labels: {}
|
||||
description: "Describes jobs that run code or a script to completion."
|
||||
attributes: workload: definition: {
|
||||
apiVersion: "batch/v1"
|
||||
kind: "Job"
|
||||
attributes: workload: {
|
||||
definition: {
|
||||
apiVersion: "batch/v1"
|
||||
kind: "Job"
|
||||
}
|
||||
type: "jobs.batch"
|
||||
}
|
||||
}
|
||||
template: {
|
||||
|
||||
@@ -4,9 +4,12 @@ webservice: {
|
||||
labels: {}
|
||||
description: "Describes long-running, scalable, containerized services that have a stable network endpoint to receive external network traffic from customers."
|
||||
attributes: {
|
||||
workload: definition: {
|
||||
apiVersion: "apps/v1"
|
||||
kind: "Deployment"
|
||||
workload: {
|
||||
definition: {
|
||||
apiVersion: "apps/v1"
|
||||
kind: "Deployment"
|
||||
}
|
||||
type: "deployments.apps"
|
||||
}
|
||||
status: {
|
||||
customStatus: #"""
|
||||
|
||||
@@ -6,9 +6,12 @@ worker: {
|
||||
}
|
||||
description: "Describes long-running, scalable, containerized services that running at backend. They do NOT have network endpoint to receive external network traffic."
|
||||
attributes: {
|
||||
workload: definition: {
|
||||
apiVersion: "apps/v1"
|
||||
kind: "Deployment"
|
||||
workload: {
|
||||
definition: {
|
||||
apiVersion: "apps/v1"
|
||||
kind: "Deployment"
|
||||
}
|
||||
type: "deployments.apps"
|
||||
}
|
||||
status: {
|
||||
customStatus: #"""
|
||||
|
||||
Reference in New Issue
Block a user