mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-19 04:26:39 +00:00
remove
This commit is contained in:
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user