Skip to content

Commit

Permalink
ignore not found
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanxin committed Aug 8, 2024
1 parent 42742e6 commit 7e53026
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/controller/watcher/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (r *Reconciler) stateHandling(ctx context.Context, watcher *v1beta2.Watcher

func (r *Reconciler) handleDeletingState(ctx context.Context, watcher *v1beta2.Watcher) (ctrl.Result, error) {
err := r.IstioClient.DeleteVirtualService(ctx, watcher.GetName(), watcher.GetNamespace())
if err != nil {
if err != nil && !util.IsNotFound(err) {
vsConfigDelErr := fmt.Errorf("failed to delete virtual service (config): %w", err)
return r.updateWatcherState(ctx, watcher, shared.StateError, vsConfigDelErr)
}
Expand Down Expand Up @@ -174,7 +174,8 @@ func (r *Reconciler) handleProcessingState(ctx context.Context, watcherCR *v1bet
return r.updateWatcherState(ctx, watcherCR, shared.StateReady, nil)
}

func (r *Reconciler) updateWatcherState(ctx context.Context, watcher *v1beta2.Watcher, state shared.State, err error) (ctrl.Result, error) {
func (r *Reconciler) updateWatcherState(ctx context.Context, watcher *v1beta2.Watcher, state shared.State,
err error) (ctrl.Result, error) {

Check failure on line 178 in internal/controller/watcher/controller.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gofumpt`-ed (gofumpt)
watcher.Status.State = state
if state == shared.StateReady {
watcher.UpdateWatcherConditionStatus(v1beta2.WatcherConditionTypeVirtualService, apimetav1.ConditionTrue)
Expand Down

0 comments on commit 7e53026

Please sign in to comment.