Skip to content

Commit

Permalink
Do not react on maintenance annotation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 committed May 8, 2024
1 parent a129aba commit 92b9101
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions controllers/deployment/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func SetupWithManager(log logr.Logger, recorder record.EventRecorder, mgr ctrl.M
&v2.FirewallDeployment{},
builder.WithPredicates(
predicate.And(
predicate.Not(v2.AnnotationAddedPredicate(v2.MaintenanceAnnotation)),
predicate.Not(v2.AnnotationRemovedPredicate(v2.MaintenanceAnnotation)),
predicate.Or(
predicate.GenerationChangedPredicate{}, // prevents reconcile on status sub resource update
Expand Down
9 changes: 9 additions & 0 deletions integration/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/metal-stack/firewall-controller-manager/controllers/firewall"
"github.com/metal-stack/firewall-controller-manager/controllers/monitor"
"github.com/metal-stack/firewall-controller-manager/controllers/set"
"github.com/metal-stack/firewall-controller-manager/controllers/update"
metalclient "github.com/metal-stack/metal-go/test/client"
"github.com/metal-stack/metal-lib/pkg/tag"
. "github.com/onsi/ginkgo/v2"
Expand Down Expand Up @@ -158,6 +159,14 @@ var _ = BeforeSuite(func() {
)
Expect(err).ToNot(HaveOccurred())

err = update.SetupWithManager(
ctrl.Log.WithName("controllers").WithName("update"),
mgr.GetEventRecorderFor("update-controller"),
mgr,
cc,
)
Expect(err).ToNot(HaveOccurred())

err = deployment.SetupWebhookWithManager(ctrl.Log.WithName("defaulting-webhook"), mgr, cc)
Expect(err).ToNot(HaveOccurred())
err = set.SetupWebhookWithManager(ctrl.Log.WithName("defaulting-webhook"), mgr, cc)
Expand Down

0 comments on commit 92b9101

Please sign in to comment.