From cb68136f933c2723d7bb2cce6143f3b44ff233e7 Mon Sep 17 00:00:00 2001 From: lj176172 Date: Mon, 4 Jan 2021 17:26:34 +0800 Subject: [PATCH] remove --- pkg/appfile/storage/driver/task.go | 31 +----------------------------- 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/pkg/appfile/storage/driver/task.go b/pkg/appfile/storage/driver/task.go index ce46553f6..966993288 100644 --- a/pkg/appfile/storage/driver/task.go +++ b/pkg/appfile/storage/driver/task.go @@ -3,8 +3,6 @@ package driver import ( "encoding/json" - "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha2" @@ -67,7 +65,7 @@ func (app *Application) Object(ns string) (*v1alpha2.Application, []oam.Object, } servApp.SetGroupVersionKind(v1alpha2.SchemeGroupVersion.WithKind("Application")) - scopes := []oam.Object{addHealthScope(servApp)} + scopes := []oam.Object{} return servApp, scopes, nil } @@ -85,30 +83,3 @@ func (app *Application) InitTasks(io cmdutil.IOStreams) (*Application, error) { } return &newApp, nil } - -func addHealthScope(app *v1alpha2.Application) *v1alpha2.HealthScope { - health := &v1alpha2.HealthScope{ - TypeMeta: metav1.TypeMeta{ - APIVersion: v1alpha2.HealthScopeGroupVersionKind.GroupVersion().String(), - Kind: v1alpha2.HealthScopeKind, - }, - } - health.Name = FormatDefaultHealthScopeName(app.Name) - health.Namespace = app.Namespace - health.Spec.WorkloadReferences = make([]v1alpha1.TypedReference, 0) - for _, comp := range app.Spec.Components { - // TODO(wonderflow): Temporarily we add health scope here, should change to use scope framework - health.Spec.WorkloadReferences = append(health.Spec.WorkloadReferences, - v1alpha1.TypedReference{ - APIVersion: v1alpha2.SchemeGroupVersion.String(), - Kind: v1alpha2.ComponentKind, - Name: comp.Name, - }) - } - return health -} - -// FormatDefaultHealthScopeName will create a default health scope name. -func FormatDefaultHealthScopeName(appName string) string { - return appName + "-default-health" -}