-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #364 from ngrok/del/28005-policy-controller
initial policy controller update
- Loading branch information
Showing
12 changed files
with
64 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
18 changes: 8 additions & 10 deletions
18
helm/ingress-controller/templates/crds/ngrok.k8s.ngrok.com_ngroktrafficpolicies.yaml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package ngrok | ||
|
||
import ( | ||
"sigs.k8s.io/controller-runtime/pkg/event" | ||
"sigs.k8s.io/controller-runtime/pkg/predicate" | ||
) | ||
|
||
// common update func predicate filter | ||
func updateFuncPredicateFilter(ue event.UpdateEvent) bool { | ||
// First check if there are any annotations present that aren't in the old version | ||
oldAnnotations := ue.ObjectOld.GetAnnotations() | ||
for newKey, newValue := range ue.ObjectNew.GetAnnotations() { | ||
if oldAnnotations[newKey] != newValue { | ||
return true | ||
} | ||
} | ||
// No change to spec, so we can ignore. This does not filter out updates | ||
// that set metadata.deletionTimestamp, so this won't undermine finalizer. | ||
return ue.ObjectNew.GetGeneration() != ue.ObjectOld.GetGeneration() | ||
} | ||
|
||
var commonPredicateFilters = predicate.Funcs{ | ||
UpdateFunc: updateFuncPredicateFilter, | ||
} |