From 2989f738c9ccd2a08b74bb079c4eb5aba0177620 Mon Sep 17 00:00:00 2001 From: erdun <494251936@qq.com> Date: Mon, 3 Aug 2020 20:58:36 +0800 Subject: [PATCH] workload label --- pkg/cmd/workload_run.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/cmd/workload_run.go b/pkg/cmd/workload_run.go index bc0b9ceb7..423733236 100644 --- a/pkg/cmd/workload_run.go +++ b/pkg/cmd/workload_run.go @@ -20,6 +20,9 @@ import ( cmdutil "github.com/cloud-native-application/rudrx/pkg/cmd/util" ) +// ComponentWorkloadDefLabel indicate which workloaddefinition generate from +const ComponentWorkloadDefLabel = "rudrx.oam.dev/workloadDef" + type runOptions struct { Template types.Template Env *EnvMeta @@ -108,6 +111,8 @@ func (o *runOptions) Complete(cmd *cobra.Command, args []string, ctx context.Con o.Component.Spec.Workload.Object = &unstructured.Unstructured{Object: pvd.UnstructuredContent()} o.Component.Name = args[0] o.Component.Namespace = namespace + o.Component.Labels[ComponentWorkloadDefLabel] = workloadName + o.AppConfig.Name = args[0] o.AppConfig.Namespace = namespace o.AppConfig.Spec.Components = append(o.AppConfig.Spec.Components, corev1alpha2.ApplicationConfigurationComponent{ComponentName: args[0]})