Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
Signed-off-by: huabing zhao <[email protected]>
  • Loading branch information
zhaohuabing committed Feb 26, 2024
1 parent e428910 commit 9959535
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/k8s/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,12 @@ func (s *SecretController) Name() string { return "Secret controller" }
// The controller manager is encapsulated in the secret controller because we
// only need it to watch secrets and update the configuration.
func (s *SecretController) ServeContext(ctx context.Context) error {
var err error
// If there are no secrets to watch, we can skip starting the controller manager
if s.secrets.Len() == 0 {
return nil
}

var err error
if s.restConf == nil {
s.restConf, err = config.GetConfig()
if err != nil {
Expand Down

0 comments on commit 9959535

Please sign in to comment.