Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagate firewall status update when controller version changes. #56

Merged
merged 2 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions controllers/monitor/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ func significantFirewallStatusChange(o, n v2.FirewallStatus) bool {
return true
}

if o.ControllerStatus != nil && n.ControllerStatus != nil && o.ControllerStatus.ActualVersion != n.ControllerStatus.ActualVersion {
return true
}

if !cmp.Equal(o.Conditions, n.Conditions, cmpopts.IgnoreFields(v2.Condition{}, "Message", "LastUpdateTime", "LastTransitionTime")) {
return true
}
Expand Down
14 changes: 14 additions & 0 deletions controllers/monitor/reconcile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,20 @@ func Test_significantFirewallStatusChange(t *testing.T) {
},
want: true,
},
{
name: "controller version update",
o: v2.FirewallStatus{
ControllerStatus: &v2.ControllerConnection{
ActualVersion: "v1.2.3",
},
},
n: v2.FirewallStatus{
ControllerStatus: &v2.ControllerConnection{
ActualVersion: "v1.2.4",
},
},
want: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down