Skip to content

Commit

Permalink
sync root podstatus from leaf
Browse files Browse the repository at this point in the history
Signed-off-by: gaoyuan <[email protected]>
  • Loading branch information
gao12312 committed Dec 20, 2024
1 parent 0100663 commit 14c4368
Show file tree
Hide file tree
Showing 5 changed files with 408 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/clustertree/cluster-manager/app/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
clusterManager "github.com/kosmos.io/kosmos/pkg/clustertree/cluster-manager"
"github.com/kosmos.io/kosmos/pkg/clustertree/cluster-manager/controllers"
"github.com/kosmos.io/kosmos/pkg/clustertree/cluster-manager/controllers/mcs"
"github.com/kosmos.io/kosmos/pkg/clustertree/cluster-manager/controllers/pod"
podcontrollers "github.com/kosmos.io/kosmos/pkg/clustertree/cluster-manager/controllers/pod"
"github.com/kosmos.io/kosmos/pkg/clustertree/cluster-manager/controllers/pv"
"github.com/kosmos.io/kosmos/pkg/clustertree/cluster-manager/controllers/pvc"
Expand Down Expand Up @@ -247,6 +248,15 @@ func run(ctx context.Context, opts *options.Options) error {
return fmt.Errorf("error starting root pv controller %v", err)
}

RootPodSyncReconciler := pod.RootPodSyncReconciler{
RootClient: mgr.GetClient(),
GlobalLeafManager: globalLeafResourceManager,
GlobalLeafClientManager: globalLeafClientManager,
}
if err := RootPodSyncReconciler.SetupWithManager(mgr); err != nil {
return fmt.Errorf("error starting root podsync controller %v", err)
}

if len(os.Getenv("USE-ONEWAY-STORAGE")) > 0 {
onewayPVController := pv.OnewayPVController{
Root: mgr.GetClient(),
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ require (
github.com/spf13/afero v1.9.2 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/stoewer/go-strcase v1.2.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/subosito/gotenv v1.3.0 // indirect
github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f // indirect
github.com/xlab/treeprint v1.1.0 // indirect
Expand Down
Loading

0 comments on commit 14c4368

Please sign in to comment.