Skip to content

Commit

Permalink
fix: 使controller不自动resync
Browse files Browse the repository at this point in the history
  • Loading branch information
googs1025 committed May 11, 2023
1 parent af6f180 commit 7a96a08
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/manager/signals"
"sigs.k8s.io/controller-runtime/pkg/source"
"time"
)

/*
Expand All @@ -28,9 +29,11 @@ import (
func main() {

logf.SetLogger(zap.New())
var d time.Duration = 0
// 1. 管理器初始化
mgr, err := manager.New(k8sconfig.K8sRestConfig(), manager.Options{
Logger: logf.Log.WithName("poddeployer-operator"),
SyncPeriod: &d, // resync不设置触发
})
if err != nil {
mgr.GetLogger().Error(err, "unable to set up manager")
Expand Down

0 comments on commit 7a96a08

Please sign in to comment.