Feat: add vela minimal chart (#2340)

* Feat: add vela minimal chart

* Feat: add README in minimal chart
This commit is contained in:
Tianxin Dong
2021-09-24 17:02:43 +08:00
committed by GitHub
parent 11103b31bb
commit 360c19cf2d
71 changed files with 14033 additions and 11 deletions
+2
View File
@@ -23,6 +23,8 @@ const (
DisableAllCaps = "all"
// DisableNoneCaps disable none of capabilities
DisableNoneCaps = ""
// ManualScalerTraitControllerName is the controller name of manual scaler trait
ManualScalerTraitControllerName = "manualscalertrait"
// ContainerizedWorkloadControllerName is the controller name of containerized workload
ContainerizedWorkloadControllerName = "containerizedwokrload"
// HealthScopeControllerName is the controller name of healthScope controller
+27 -5
View File
@@ -33,7 +33,26 @@ import (
// Setup workload controllers.
func Setup(mgr ctrl.Manager, args controller.Args) error {
if args.OAMSpecVer == "v0.3" || args.OAMSpecVer == "all" {
switch args.OAMSpecVer {
case "all":
for _, setup := range []func(ctrl.Manager, controller.Args) error{
application.Setup, applicationrollout.Setup, appdeployment.Setup,
traitdefinition.Setup, componentdefinition.Setup, policydefinition.Setup, workflowstepdefinition.Setup,
initializer.Setup, applicationconfiguration.Setup,
} {
if err := setup(mgr, args); err != nil {
return err
}
}
case "minimal":
for _, setup := range []func(ctrl.Manager, controller.Args) error{
application.Setup, traitdefinition.Setup, componentdefinition.Setup, policydefinition.Setup, workflowstepdefinition.Setup,
} {
if err := setup(mgr, args); err != nil {
return err
}
}
case "v0.3":
for _, setup := range []func(ctrl.Manager, controller.Args) error{
application.Setup, applicationrollout.Setup, appdeployment.Setup,
traitdefinition.Setup, componentdefinition.Setup, policydefinition.Setup, workflowstepdefinition.Setup,
@@ -43,10 +62,13 @@ func Setup(mgr ctrl.Manager, args controller.Args) error {
return err
}
}
}
if args.OAMSpecVer == "v0.2" || args.OAMSpecVer == "all" {
if err := applicationconfiguration.Setup(mgr, args); err != nil {
return err
case "v0.2":
for _, setup := range []func(ctrl.Manager, controller.Args) error{
applicationconfiguration.Setup,
} {
if err := setup(mgr, args); err != nil {
return err
}
}
}
return nil
+3
View File
@@ -44,6 +44,9 @@ func Setup(mgr ctrl.Manager, disableCaps string, args controller.Args) error {
case common.DisableAllCaps:
default:
disableCapsSet := utils.StoreInSet(disableCaps)
if !disableCapsSet.Contains(common.ManualScalerTraitControllerName) {
functions = append(functions, manualscalertrait.Setup)
}
if !disableCapsSet.Contains(common.ContainerizedWorkloadControllerName) {
functions = append(functions, containerizedworkload.Setup)
}
+7 -1
View File
@@ -70,7 +70,13 @@ const LabelPodSpecable = "workload.oam.dev/podspecable"
// allBuiltinCapabilities includes all builtin controllers
// TODO(zzxwill) needs to automatically discovery all controllers
var allBuiltinCapabilities = mapset.NewSet(common.RolloutControllerName, common.ContainerizedWorkloadControllerName, common.HealthScopeControllerName)
var allBuiltinCapabilities = mapset.NewSet(
common.ManualScalerTraitControllerName,
common.RolloutControllerName,
common.ContainerizedWorkloadControllerName,
common.HealthScopeControllerName,
common.EnvBindingControllerName,
)
// GetPodSpecPath get podSpec field and label
func GetPodSpecPath(workloadDef *v1alpha2.WorkloadDefinition) (string, bool) {