Skip to content

Commit

Permalink
fix: add event filter (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiGuranIonos authored Nov 27, 2024
1 parent 5aedd8c commit 1d20bd4
Show file tree
Hide file tree
Showing 35 changed files with 34 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/ionoscloud/compute/statefulserverset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ metadata:
name: sss-example
spec:
forProvider:
replicas: 1
replicas: 2
deploymentStrategy:
type: ZONES
datacenterConfig:
Expand Down
6 changes: 0 additions & 6 deletions examples/ionoscloud/compute/volume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ spec:
bus: VIRTIO
licenceType: LINUX
availabilityZone: AUTO
substitutions:
- key: $NIC0_ipv6Address
type: random-ipv6
unique: true
additionalProperties:
cidr: fd00:1337:1::/64
# imageAlias: ubuntu:latest
# imagePassword:
datacenterConfig:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.ApplicationLoadBalancer{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.ApplicationLoadBalancerGroupVersionKind),
Expand Down
1 change: 1 addition & 0 deletions internal/controller/alb/forwardingrule/forwardingrule.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.ForwardingRule{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.ForwardingRuleGroupVersionKind),
Expand Down
1 change: 1 addition & 0 deletions internal/controller/alb/targetgroup/targetgroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.TargetGroup{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.TargetGroupGroupVersionKind),
Expand Down
1 change: 1 addition & 0 deletions internal/controller/backup/backupunit/backupunit.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.BackupUnit{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.BackupUnitGroupVersionKind),
Expand Down
1 change: 1 addition & 0 deletions internal/controller/compute/cubeserver/cubeserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.CubeServer{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.CubeServerGroupVersionKind),
Expand Down
1 change: 1 addition & 0 deletions internal/controller/compute/datacenter/datacenter.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.Datacenter{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.DatacenterGroupVersionKind),
Expand Down
1 change: 1 addition & 0 deletions internal/controller/compute/firewallrule/firewallrule.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.FirewallRule{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.FirewallRuleGroupVersionKind),
Expand Down
1 change: 1 addition & 0 deletions internal/controller/compute/group/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.Group{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.GroupGroupVersionKind),
Expand Down
1 change: 1 addition & 0 deletions internal/controller/compute/ipblock/ipblock.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.IPBlock{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.IPBlockGroupVersionKind),
Expand Down
1 change: 1 addition & 0 deletions internal/controller/compute/ipfailover/ipfailover.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.IPFailover{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.IPFailoverGroupVersionKind),
Expand Down
1 change: 1 addition & 0 deletions internal/controller/compute/lan/lan.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.Lan{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.LanGroupVersionKind),
Expand Down
1 change: 1 addition & 0 deletions internal/controller/compute/nic/nic.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.Nic{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.NicGroupVersionKind),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.Pcc{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.PrivateCrossConnectGroupVersionKind),
Expand Down
1 change: 1 addition & 0 deletions internal/controller/compute/s3key/s3Key.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.S3Key{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.S3KeyGroupVersionKind),
Expand Down
1 change: 1 addition & 0 deletions internal/controller/compute/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.Server{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.ServerGroupVersionKind),
Expand Down
1 change: 1 addition & 0 deletions internal/controller/compute/statefulserverset/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.StatefulServerSet{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.StatefulServerSetGroupVersionKind),
Expand Down
1 change: 1 addition & 0 deletions internal/controller/compute/user/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.User{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.UserGroupVersionKind),
Expand Down
1 change: 1 addition & 0 deletions internal/controller/compute/volume/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.Volume{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.VolumeGroupVersionKind),
Expand Down
1 change: 1 addition & 0 deletions internal/controller/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.ProviderConfig{}).
Watches(&v1alpha1.ProviderConfigUsage{},
&resource.EnqueueRequestForProviderConfig{}).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.DataplatformCluster{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.DataplatformClusterGroupVersionKind),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.DataplatformNodepool{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.DataplatformNodepoolGroupVersionKind),
Expand Down
1 change: 1 addition & 0 deletions internal/controller/dbaas/mongocluster/mongoluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.MongoCluster{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.MongoClusterGroupVersionKind),
Expand Down
1 change: 1 addition & 0 deletions internal/controller/dbaas/mongouser/mongouser.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.MongoUser{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.MongoUserGroupVersionKind),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.PostgresCluster{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.PostgresClusterGroupVersionKind),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.PostgresDatabase{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.PostgresDatabaseGroupVersionKind),
Expand Down
1 change: 1 addition & 0 deletions internal/controller/dbaas/postgresuser/postgresuser.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.PostgresUser{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.PostgresUserGroupVersionKind),
Expand Down
1 change: 1 addition & 0 deletions internal/controller/k8s/k8scluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.Cluster{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.ClusterGroupVersionKind),
Expand Down
1 change: 1 addition & 0 deletions internal/controller/k8s/k8snodepool/nodepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.NodePool{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.NodePoolGroupVersionKind),
Expand Down
1 change: 1 addition & 0 deletions internal/controller/nlb/flowlog/flowlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.FlowLog{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.FlowLogGroupVersionKind),
Expand Down
1 change: 1 addition & 0 deletions internal/controller/nlb/forwardingrule/forwardingrule.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.ForwardingRule{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.ForwardingRuleGroupVersionKind),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.NetworkLoadBalancer{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.NetworkLoadBalancerGroupVersionKind),
Expand Down
1 change: 1 addition & 0 deletions internal/controller/serverset/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ func SetupServerSet(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.ServerSet{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.ServerSetGroupVersionKind),
Expand Down
1 change: 1 addition & 0 deletions internal/controller/volumeselector/volumeselector.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error {
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(opts.CtrlOpts.ForControllerRuntime()).
WithEventFilter(resource.DesiredStateChanged()).
For(&v1alpha1.Volumeselector{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.VolumeselectorGroupVersionKind),
Expand Down

0 comments on commit 1d20bd4

Please sign in to comment.