...

Source file src/github.com/chaos-mesh/chaos-mesh/controllers/fx.go

Documentation: github.com/chaos-mesh/chaos-mesh/controllers

     1  // Copyright 2021 Chaos Mesh Authors.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // See the License for the specific language governing permissions and
    12  // limitations under the License.
    13  
    14  package controllers
    15  
    16  import (
    17  	"go.uber.org/fx"
    18  
    19  	"github.com/chaos-mesh/chaos-mesh/controllers/chaosimpl"
    20  	"github.com/chaos-mesh/chaos-mesh/controllers/common"
    21  	"github.com/chaos-mesh/chaos-mesh/controllers/condition"
    22  	"github.com/chaos-mesh/chaos-mesh/controllers/desiredphase"
    23  	"github.com/chaos-mesh/chaos-mesh/controllers/finalizers"
    24  	"github.com/chaos-mesh/chaos-mesh/controllers/podhttpchaos"
    25  	"github.com/chaos-mesh/chaos-mesh/controllers/podiochaos"
    26  	"github.com/chaos-mesh/chaos-mesh/controllers/podnetworkchaos"
    27  	"github.com/chaos-mesh/chaos-mesh/controllers/schedule"
    28  	"github.com/chaos-mesh/chaos-mesh/controllers/utils/chaosdaemon"
    29  	"github.com/chaos-mesh/chaos-mesh/controllers/utils/recorder"
    30  	wfcontrollers "github.com/chaos-mesh/chaos-mesh/pkg/workflow/controllers"
    31  )
    32  
    33  var Module = fx.Options(
    34  	fx.Provide(
    35  		fx.Annotated{
    36  			Group:  "controller",
    37  			Target: common.NewController,
    38  		},
    39  		fx.Annotated{
    40  			Group:  "controller",
    41  			Target: finalizers.NewController,
    42  		},
    43  		fx.Annotated{
    44  			Group:  "controller",
    45  			Target: desiredphase.NewController,
    46  		},
    47  		fx.Annotated{
    48  			Group:  "controller",
    49  			Target: condition.NewController,
    50  		},
    51  		fx.Annotated{
    52  			Group:  "controller",
    53  			Target: podnetworkchaos.NewController,
    54  		},
    55  		fx.Annotated{
    56  			Group:  "controller",
    57  			Target: podhttpchaos.NewController,
    58  		},
    59  		fx.Annotated{
    60  			Group:  "controller",
    61  			Target: podiochaos.NewController,
    62  		},
    63  
    64  		chaosdaemon.New,
    65  		recorder.NewRecorderBuilder,
    66  	),
    67  	fx.Invoke(wfcontrollers.BootstrapWorkflowControllers),
    68  	schedule.Module,
    69  	chaosimpl.AllImpl)
    70