Skip to content

Commit

Permalink
fix: remove delete from etcd function
Browse files Browse the repository at this point in the history
Signed-off-by: Vishal Choudhary <[email protected]>
  • Loading branch information
vishal-chdhry committed Jul 9, 2024
1 parent 75a86af commit 2cf27d5
Showing 1 changed file with 44 additions and 44 deletions.
88 changes: 44 additions & 44 deletions pkg/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,17 @@ func (c Config) migration(store storage.Interface) error {
if err != nil {
klog.Error(err)
}
case watch.Deleted:
cpolr := event.Object.(*v1alpha2.ClusterPolicyReport)
if cpolr.Annotations != nil {
if _, ok := cpolr.Annotations[api.ServedByReportsServerAnnotation]; ok {
return
}
}
err := store.ClusterPolicyReports().Delete(context.TODO(), cpolr.Name)
if err != nil {
klog.Error(err)
}
// case watch.Deleted:
// cpolr := event.Object.(*v1alpha2.ClusterPolicyReport)
// if cpolr.Annotations != nil {
// if _, ok := cpolr.Annotations[api.ServedByReportsServerAnnotation]; ok {
// return
// }
// }
// err := store.ClusterPolicyReports().Delete(context.TODO(), cpolr.Name)
// if err != nil {
// klog.Error(err)
// }
}
}
}()
Expand Down Expand Up @@ -238,17 +238,17 @@ func (c Config) migration(store storage.Interface) error {
if err != nil {
klog.Error(err)
}
case watch.Deleted:
polr := event.Object.(*v1alpha2.PolicyReport)
if polr.Annotations != nil {
if _, ok := polr.Annotations[api.ServedByReportsServerAnnotation]; ok {
return
}
}
err := store.PolicyReports().Delete(context.TODO(), polr.Name, polr.Namespace)
if err != nil {
klog.Error(err)
}
// case watch.Deleted:
// polr := event.Object.(*v1alpha2.PolicyReport)
// if polr.Annotations != nil {
// if _, ok := polr.Annotations[api.ServedByReportsServerAnnotation]; ok {
// return
// }
// }
// err := store.PolicyReports().Delete(context.TODO(), polr.Name, polr.Namespace)
// if err != nil {
// klog.Error(err)
// }
}
}
}()
Expand Down Expand Up @@ -301,17 +301,17 @@ func (c Config) migration(store storage.Interface) error {
if err != nil {
klog.Error(err)
}
case watch.Deleted:
cephr := event.Object.(*reportsv1.ClusterEphemeralReport)
if cephr.Annotations != nil {
if _, ok := cephr.Annotations[api.ServedByReportsServerAnnotation]; ok {
return
}
}
err := store.ClusterEphemeralReports().Delete(context.TODO(), cephr.Name)
if err != nil {
klog.Error(err)
}
// case watch.Deleted:
// cephr := event.Object.(*reportsv1.ClusterEphemeralReport)
// if cephr.Annotations != nil {
// if _, ok := cephr.Annotations[api.ServedByReportsServerAnnotation]; ok {
// return
// }
// }
// err := store.ClusterEphemeralReports().Delete(context.TODO(), cephr.Name)
// if err != nil {
// klog.Error(err)
// }
}
}
}()
Expand Down Expand Up @@ -363,17 +363,17 @@ func (c Config) migration(store storage.Interface) error {
if err != nil {
klog.Error(err)
}
case watch.Deleted:
ephr := event.Object.(*reportsv1.EphemeralReport)
if ephr.Annotations != nil {
if _, ok := ephr.Annotations[api.ServedByReportsServerAnnotation]; ok {
return
}
}
err := store.EphemeralReports().Delete(context.TODO(), ephr.Name, ephr.Namespace)
if err != nil {
klog.Error(err)
}
// case watch.Deleted:
// ephr := event.Object.(*reportsv1.EphemeralReport)
// if ephr.Annotations != nil {
// if _, ok := ephr.Annotations[api.ServedByReportsServerAnnotation]; ok {
// return
// }
// }
// err := store.EphemeralReports().Delete(context.TODO(), ephr.Name, ephr.Namespace)
// if err != nil {
// klog.Error(err)
// }
}
}
}()
Expand Down

0 comments on commit 2cf27d5

Please sign in to comment.